ragavi-gains

To be used for gain table visualisation.

Currently, gain tables supported for visualisation by ragavi-gains are :

  • Flux calibration (F tables)
  • Bandpass calibration (B tables)
  • Delay calibration (D tables)
  • Gain calibration (G tables)
  • D-Jones Leakage tables (D tables)

Mandatory fields are --table, --gain_type

If a field name is not specified to ragavi-vis all the fields will be plotted by default

It is possible to place multiple gain table plots of different [or same] types into a single HTML document using ragavi This can be done by specifying the table names and gain types as space separate list as below

$ragavi-gains --table table/one/name table/two/name table/three/name table/four/name --gain_types B G D F --fields 0

This will yield an output HTML file, with plots in the order

–table field gain
table1 0 B
table2 0 G
table3 0 D
table4 0 F

Note

  • At least a single field, spectral window and correlation must be selected in order for plots to show up.
  • While antenna data can be made visible through clicking its corresponding legend, this behaviour is not linked to the field, SPW, correlation selection checkboxes. Therefore, clicking the legend for a specific antenna will make data from all fields, SPWs and correlation for that antenna visible. As a workaround, data points can be identifies using tooltip information
  • Unless all the available fields, SPWs and correlations have not been selected, the antenna legends will appear greyed-out. This is because a single legend is attached to multiple data for each of the available categories. Therefore, clicking on legends without meeting the preceeding condition may lead to some awkward results (a toggling effect).

To use ragavi-gains in a notebook environment, run in a notebook cell

from ragavi.ragavi import plot_table

#specifying function arguments
args = dict(mytabs=[], gain_types=[], cmap='viridis', doplot='ri', corr=1, ant='1,2,3,9,10')

#inline plotting will be done
plot_table(**args)

API

class ragavi.ragavi.DataCoreProcessor(xds_table_obj, ms_name, gtype, fid=None, doplot='ap', corr=0, flag=True, kx=None, ddid=None)

Process gain table data into forms desirable for visualisation.

Parameters:
  • antenna (str) –
  • corr (int) – Correlation index to plot
  • doplot (str) – Kind of plot to do. Default is ap
  • flag (bool) – To flag or not. Default is True
  • fid (int) – Field id
  • gtype (str) – Gain table type
  • ms_name (str) – Name / path to the table
  • xds_table_obj (xarray.Dataset) – Table object from which data will be extracted
act()

Activate the ragavi.ragavi.DataCoreProcessor.blackbox()

blackbox(xds_table_obj, ms_name, gtype, fid=None, doplot='ap', corr=0, flag=True)

Get raw input data and churn out processed data. Takes in all inputs from the instance initialising object

This function incorporates all function in the class to get the desired result. It performs:

  • xaxis data and error data acquisition
  • xaxis data and error preparation and processing
  • yaxis data and error data acquisition
  • yaxis data and error preparation and processing
Returns:d (collections.namedtuple) – A named tuple containing all processed x-axis data, errors and label, as well as both pairs of y-axis data, their error margins and labels. Items from this tuple can be gotten by using the dot notation.
ragavi.ragavi.plot_table(mytabs, gain_types, **kwargs)

Plot gain tables within Jupyter notebooks.

Parameters:
  • _corr (int, optional) – Correlation index to plot. Can be a single integer or comma separated integers e.g ‘0,2’. Defaults to all.
  • doplot (str, optional) – Plot complex values as amp and phase (ap) or real and imag (ri). Default is ‘ap’.
  • ddid (int) – SPECTRAL_WINDOW_ID or ddid number. Defaults to all
  • fields (str, optional) – Field ID(s) / NAME(s) to plot. Can be specified as “0”, “0,2,4”, “0~3” (inclusive range), “0:3” (exclusive range), “3:” (from 3 to last) or using a field name or comma separated field names. Defaults to all.
  • gain_types (str, list) – Cal-table (list of caltypes) type to be plotted. Can be either ‘B’-bandpass, ‘D’- D jones leakages, G’-gains, ‘K’-delay or ‘F’-flux. Default is none
  • image_name (str, optional) – Output image name. Default is of the form: table_corr_doplot_fields
  • mycmap (str, optional) – Matplotlib colour map to use for antennas. Default is coolwarm
  • mytabs (str or list required) – The table (list of tables) to be plotted.
  • plotants (str, optional) – Plot only this antenna, or comma-separated string of antennas. Default is all
  • taql (str, optional) – TAQL where clause
  • t0 (int, optional) – Minimum time [in seconds] to plot. Default is full range
  • t1 (int, optional) – Maximum time [in seconds] to plot. Default is full range