Plotting Calibration Outputs

ska_sdp_wflow_pointing_offset.plotting.on_sky_offsets_plot.plot_on_sky_offsets(on_sky_offsets, ants, prefix='test')

Plot the on-sky offsets which are the position coordinates for the beam fitting routine

Parameters:
  • on_sky_offsets – The commanded pointings relative to the target in degrees in the reference pointing observation in xEl-El coordinates with dimensions (nscans, nants, 2)

  • ants – A list of Katpoint Antenna objects [nants]

  • prefix – Unique plot name prefix (e.g. MeerKAT)

ska_sdp_wflow_pointing_offset.plotting.vis_amp_plot.plot_vis_amp(amplitudes, prefix='test')

Plot visibility amplitude for each scan over number of antennas with one curve per frequency chunk

Parameters:
  • amplitudes – Visibility amplitudes with dimensions (nants, num_chunks, nscans). If num_chunks=1, then has dimension (nants, nscans)

  • prefix – Unique plot name prefix (e.g. MeerKAT)

Plots the gain amplitudes for each discrete pointing scan

class ska_sdp_wflow_pointing_offset.plotting.gain_amp_plot.PlotGainAmpClass(gain_sol, prefix='test')[source]

Bases: object

Class for plotting the gain amplitudes at each discrete offset pointing

Parameters:
  • gain_sol – Gain amplitudes for all antennas for all scans with dimensions (nants, num_chunks, nscans) where num_chunks is the number of usable frequency chunks. Note that num_chunks equal to 2 is not allowed since the bottom and top part of the band amplitudes are discarded. When fitting to the parallel-hands polarisation gain amplitudes, the amplitudes have dimensions (2, nants, num_chunks, nscans)

  • prefix – Unique plot name prefix (e.g. MeerKAT)

avg_pol_amp()[source]

Direct scatter plot of the StokesI gain amplitudes at each discrete offset pointing

parallel_hands_amp(polarisation)[source]

Direct scatter plot of the gain amplitudes of the parallel-hands polarisations at each discrete offset pointing scan

Parameters:

polarisation – Polarisation products

Plots the Gaussian fits to the gain or visibility amplitudes from which the fitted parameters are extracted

class ska_sdp_wflow_pointing_offset.plotting.gaussian_fits_plot.GenerateGaussianFitsPlot(x_per_scan, y_per_scan, frequency_per_chunk, ants, fitted_beams, prefix='test')[source]

Bases: object

Generates the plots of the Gaussian fits to the visibility or gain amplitudes

Parameters:
  • x_per_scan – The commanded pointings relative to the target in degrees in the reference pointing observation in xEl-El coordinates with dimensions (nscans, nants, 2)

  • y_per_scan – Gain amplitudes of each antenna for all discrete pointings with dimensions (nants, num_chunks, nscans). Note that num_chunks equal to 2 is not allowed since the bottom and top part of the band amplitudes are discarded. When fitting to the parallel-hands polarisation gain amplitudes, the amplitudes have dimensions (2, nants, num_chunks, nscans)

  • frequency_per_chunk – 1D array of the averaged-frequency in each chunk in Hz with equal length as num_chunks

  • ants – List of katpoint Antenna objects [nants]

  • fitted_beams – A dictionary of the fitted beams obtained from beam_fitting.py.SolveForOffsets.fit_to_gains() or beam_fitting.py.SolveForOffsets.fit_to_vis()

  • prefix – Unique plot name prefix (e.g. MeerKAT)

generate_parallel_hands_pol_amp_fits(**kwargs)
generate_total_intensity_amp_fits(**kwargs)
class ska_sdp_wflow_pointing_offset.plotting.gaussian_fits_plot.PlotStokesGaussianFits(num_beams, ant_name, fig_label)[source]

Bases: object

A direct plot of the Gaussian fits from which the pointing offsets are extracted.

Parameters:
  • num_beams – Number of fitted beams

  • ant_name – Antenna name

  • fig_label – Parallel-hand polarisation label for the plot

plot_multiple_beams(frequency, updated_x_per_scan, updated_y_per_scan, beam_per_ant, axis)[source]

Plots multiple fitted Gaussian beams. This is the case when num_chunks greater than one (except 1, 2 or 3) is used. Note that num_chunks of 2 is not allowed since the top and bottom visibility or gain amplitudes are discarded so there will be no remaining amplitudes to fit the beams to

Parameters:
  • frequency – The frequency in each frequency chunk in Hz

  • updated_x_per_scan – The on-sky offsets corresponding to the non-zero visibility or gain amplitudes with dimensions (nscans, 2)

  • updated_y_per_scan – Non-zero visibility or gain amplitudes with dimensions (nscans, )

  • beam_per_ant – Fitted beam per antenna. Contains the fitted parameters with the centre and width in degrees, and height in arbitrary units

  • axis – Axis to make plot

plot_single_beam(beam_per_ant, updated_x_per_scan, updated_y_per_scan)[source]

Plots single fitted Gaussian beam. This is the case when num_chunks of 1 or 3 is used. For num_chunks of 3, the top and bottom visibility or gain amplitudes are discarded so the beams are fitted to the remaining one set of amplitudes

Parameters:
  • beam_per_ant – Fitted beam per antenna. Contains the fitted parameters with the centre and width in degrees, and height in arbitrary units

  • updated_x_per_scan – The on-sky offsets corresponding to the non-zero visibility or gain amplitudes with dimensions (nscans, 2)

  • updated_y_per_scan – Non-zero visibility or gain amplitudes with dimensions (nscans, )

Functions for plotting and visualisation of the pointing offsets and other fitted parameters and their uncertainties

class ska_sdp_wflow_pointing_offset.plotting.pointing_offsets_plot.PlotOffsetClass(pointing_table, prefix='test')[source]

Bases: object

Direct scatter plot of the fitted pointing offsets and other parameters.

Parameters:
  • pointing_table – The PointingTable hosting the pointing offsets and other fitted parameters and their uncertainties.

  • prefix – Unique plot name prefix (e.g. MeerKAT)

avg_pol_gains(polarisation, fit_to_sep_pol=False)[source]

Direct scatter plot of the fitted pointing offsets obtained from fitting the primary beams to the StokesI gain amplitudes.

Parameters:
  • polarisation – Polarisation products

  • fit_to_sep_pol – Fit primary beam to the parallel-hands gain

avg_pol_vis()[source]

Direct scatter plot of the fitted pointing offsets obtained from fitting the primary beams to the StokesI visibility amplitudes.

Error handling function

ska_sdp_wflow_pointing_offset.plotting.plot_exception_handler.exception_handler(plot_func)[source]

Decorator for functions with try except