ragavi-vis

To be used for visibility plotting. Supported arguments are

For x axis:

  • amplitude
  • antenna1
  • antenna2
  • frequency
  • phase
  • real
  • scan
  • time
  • uvdistance
  • uvwave

For y-axis:

  • amplitude
  • phase
  • real
  • imaginary

Iterations:

  • Correlations (corr)
  • Scan (scan)
  • Spectral windows (spw)

Mandatory arguments are --xaxis, --yaxis, --table.

API

class ragavi.visibilities.DataCoreProcessor(xds_table_obj, ms_name, xaxis, yaxis, chan=None, corr=None, cbin=None, ddid=<class 'int'>, datacol='DATA', flag=True)

Process Measurement Set data into forms desirable for visualisation.

Parameters:
  • chan (slice or int) – Channels that will be selected. Defaults to all
  • cbin (int) – Channel averaging bin size
  • corr (int or slice) – Correlation indices to be selected. Defaults to all
  • datacol (str) – Data column to be selected. Defaults to ‘DATA’
  • ddid (slice) – Spectral windows to be selected. Defaults to all
  • flag (bool) – To flag or not. Defaults to True
  • ms_name (str) – Name / path to the Measurement Set
  • xds_table_obj (xarray.Dataset) – Table object from which data will be extracted
  • xaxis (str) – x-axis to be selected for plotting
  • yaxis (str) – y-axis to be selected for plotting
act()

Activate the ragavi.ragavi.DataCoreProcessor.blackbox()

blackbox(xds_table_obj, ms_name, xaxis, yaxis, cbin=None, chan=None, corr=None, datacol='DATA', ddid=None, flag=True)

Get raw input data and churn out processed data.

This function incorporates all function in the class to get the desired result. Takes in all inputs from the instance initialising object. 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.visibilities.hv_plotter(x, y, xaxis, xlab='', yaxis='amplitude', ylab='', color='blue', xds_table_obj=None, ms_name=None, iterate=None, x_min=None, x_max=None, y_min=None, y_max=None)

Responsible for plotting in this script.

This is responsible for:

  • Selection of the iteration column. ie. Setting it to a categorical column
  • Creating the image callback to Datashader
  • Creating Bokeh canvas onto which image will be placed
  • Calculation of maximums and minimums for the plot
  • Formatting fonts, axes and titles
Parameters:
  • x (xarray.DataArray) – x data to plot
  • y (xarray.DataArray) – y data to plot
  • xaxis (str) – xaxis selected for plotting
  • xlab (str) – Label to appear on x-axis
  • yaxis (str) – yaxis selected for plotting
  • ylab (str) – Label to appear on y-axis
  • iterate (str) – Column in the dataset over which to iterate. It should be noted that currently iteration is done using colors to denote the different parts of the iteration axis. These colors are explicitly selected in the code and are cycled through. i.e repetitive. This option is akin to the colorise_by function in CASA.
  • ititle (str) – Title to appear incasea of iteration
  • color (str, colormap, itertools.cycler) – Color scheme to be used in the plot. It could be a string containing a color, a matplotlib or bokeh or colorcet colormap of a cycler containing specified colors.
  • xds_table_obj (xarray.Dataset) – Dataset object containing the columns of the MS. This is passed on in case there are items required from the actual dataset.
  • ms_nmae (str) – Name or [can include path] to Measurement Set
  • xmin (float) –

    Minimum x value to be plotted

    Note

    This may be difficult to achieve in the case where xaxis is time because time in ragavi-vis is converted into milliseconds from epoch for ease of plotting by bokeh.

  • xmax (float) – Maximum x value to be plotted
  • ymin (float) – Minimum y value to be plotted
  • ymax (float) – Maximum y value to be plotted
Returns:

fig (bokeh.plotting.figure)