ska_sdp_wflow_pointing_offset.beam_fitting module

Fits primary beams modelled by a 2D Gaussian to the visibility or gain amplitudes and computes the cross-elevation and elevation offsets for each dish. These routines follow those used by the South African Radio Astronomy Observatory (SARAO) team for the MeerKAT array.

class ska_sdp_wflow_pointing_offset.beam_fitting.BeamPatternFit(centre, width, height)[source]

Bases: ScatterFit

Fit analytic beam pattern to total power data defined on 2-D plane. This fits a two-dimensional Gaussian curve (with diagonal covariance matrix) to total power data as a function of 2-D coordinates. The Gaussian bump represents an antenna beam pattern convolved with a point source.

Parameters:
  • centre – Initial guess of 2-element beam centre, in target coordinate units

  • width – Initial guess of single beam width for both dimensions, or 2-element beam width vector, expressed as FWHM in units of target coordinates

  • height – Initial guess of beam pattern amplitude or height

Attributes

expected_width: real array, shape (2,), or float

Initial guess of beamwidth, saved as expected width for checks

is_validbool

True if beam parameters are within reasonable ranges after fit

std_centre: array of float, shape (2,)

Standard error of beam centre, only set after fit()

std_width: array of float, shape (2,), or float

Standard error of beamwidth(s), only set after fit()

std_height: float

Standard error of beam height, only set after fit()

fit(x, y, std_y=1.0, thresh_width=1.15)[source]

Fit a beam pattern to data. The centre, width and height of the fitted beam pattern (and their standard errors) can be obtained from the corresponding member variables after this is run.

Parameters:
  • x – Sequence of (2, N) target coordinates (as column vectors)

  • y – Sequence of (N, ) corresponding total power values to fit

  • std_y – Optional measurement error or uncertainty of (N, ) y values, expressed as standard deviation in units of y.

  • thresh_width – The maximum ratio of the fitted to expected beamwidth

Returns:

The fitted beam parameters (centre, width, height and their uncertainties)

class ska_sdp_wflow_pointing_offset.beam_fitting.SolveForOffsets(x_per_scan, y_per_scan, stddev_per_scan, frequency_per_chunk, beamwidth_factor, ants, thresh_width)[source]

Bases: object

Fit the beam pattern to the visibility or gain amplitudes and outputs the fitted parameters and their uncertainties.

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

  • y_per_scan – Visibility or gain amplitudes of all antennas for all scans with dimensions (nants, num_chunks, nscans), where num_chunks is the number of usable frequency chunks

  • stddev_per_scan – The weighted standard deviations from the weighted-average of the visibility or gain amplitudes. Has same shape as y_per_scan

  • frequency_per_chunk – 1D array of the usable frequencies in each chunk in Hz. When fitting the beams to the visibility amplitudes across the entire band, this frequency is that at the higher end of the band for better pointing accuracy. If num_chunks > 1, then this frequency is the frequency at the higher end of each chunk

  • beamwidth_factor – The beamwidth factor for the two orthogonal directions. Two values are expected as one value for the horizontal co-polarisation and the other value for the vertical co-polarisation. These values often range between 1.03 and 1.22 depending on the illumination pattern of the dish

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

  • thresh_width – The tolerance on the fitted beamwidth i.e, the ratio of the fitted to expected beamwidths

fit_to_gains()[source]

Fit the primary beams to the gain amplitudes of each dish and returns the fitted parameters and their uncertainties.

Returns:

A dictionary of the fitted beams (parameters and their uncertainties)

fit_to_vis()[source]

Fit the primary beams to the visibility amplitude of the dish under test i.e, the moving dish in each observation group and returns the fitted parameters and their uncertainties.

Returns:

A dictionary of the fitted beams (parameters and their uncertainties) for the moving dish i.e, the dish performing the five-point or similar scan