ska_sdp_instrumental_calibration.xarray_processors.rotation_measures module

Post-calibration fits.

class ska_sdp_instrumental_calibration.xarray_processors.rotation_measures.ModelRotationData(gaintable, refant, oversample=5)[source]

Bases: object

Create Model Rotation Data

Parameters:
  • gaintable (GainTable) -- Calibrated gaintable of shape (time, stations, frequency, 2, 2)

  • refant (int) -- Reference antenna.

  • oversample (int, default: 5) -- Oversampling value used in the rotation calculatiosn. Note that setting this value to some higher integer may result in high memory usage.

get_plot_params_for_station(stn=None)[source]

Getter for plot params for any particular station.

Parameters:

stn (int) -- Station number.

Returns:

rm_vals: dask.array

rm value array.

rm_spec: dask.array

rm spec array.

rm_peak: dask.array

rm peak array.

rm_est: dask.array

rm estimate array.

rm_est_refant: dask.array

rm estimate of refant.

J: dask.array

Jones array.

lambda_sq: dask.array

lambda square array.

xlim: dask.array

x-limit array.

stn: int

Station number.

ska_sdp_instrumental_calibration.xarray_processors.rotation_measures.model_rotations(gaintable, peak_threshold=0.5, refine_fit=True, refant=0, oversample=5)[source]

Fit a rotation measure for each station Jones matrix.

For each station, the approach discussed in appendix B of de Gasperin et al. (2019) A&A 622, A5, is used to estimate the angle of rotation in each Jones matrix as a function of frequency. The result is expressed as a spectrum of complex numbers and Fourier transformed with respect to wavelength squared. The peak of this RM spectrum is taken as the rotation measure for the station, and optionally improved upon using a secondary nonlinear fit to the original spectrum.

In the current form, each matrix is first multiplied by the Hermitian transpose of the matrix of a reference station at the same frequency, and the product is normalised by the L2 norm. This will likely be updated as actual data are processed.

Parameters:
  • gaintable (GainTable) -- Bandpass calibrated gainTable dataset to be to modelled.

  • peak_threshold (float, default: 0.5) -- Height of peak in the RM spectrum required for a rotation detection.

  • refine_fit (bool, default: True) -- Whether or not to refine the RM spectrum peak locations with a nonlinear optimisation of the station RM values.

  • refant (int, default: 0) -- Reference antenna

  • oversample (int, default: 5) -- Oversampling value used in the rotation calculation. This determines the resolution of phasor. Note that setting this value to some higher integer may result in high memory usage.

Return type:

ModelRotationData

Returns:

A container whose rm_est attribute contains the estimated rotations. It also contains other data useful for plots.

ska_sdp_instrumental_calibration.xarray_processors.rotation_measures.get_rm_spec(phi_raw, mask, phasor)[source]

Calculate RM spec.

Parameters:
  • phi_raw (Array) -- Phi raw value. Shape: (nstations, nchannels)

  • mask (Array) -- Mask. Shape: (nstations, nchannels)

  • phasor (Array) -- Phasor. Shape: (resolution, nchannels)

Return type:

Array

Returns:

Array of RM spec. Shape: (nstations, resolution)