Calibrator Class

The Calibrator class handles flux and polarization calibration of profile data.

Warning

This class is under construction.

class Calibrator(freqs, S[, Serr=None, pol_type='Coherence', fd_poln='LIN', Funit=None, Sunit=None, verbose=True, **kwargs])
Parameters:
  • freqs (list/numpy.ndarray) – Frequency array
  • S (list/numpy.ndarray) – Array of polarization data, a 4xN shaped array
  • Serr (list/numpy.ndarray) – Optional errors on the polarization data
  • pol_type (str) – Form of polarization data: “Coherence” or “Stokes”
  • fd_poln (str) – Feed design polarization: “LIN” for linear or “CIRC” for circular
  • Funit (str) – Unit for frequencies
  • Sunit (str) – Unit for polarization data
  • verbose (bool) – Set True for verbose printing

Methods

pacv([filename=None])

Emulates PSRCHIVE’s pacv <file>.

Parameters:filename (str) – Filename to save image to.
pacv_csu([filename=None])

Emulates PSRCHIVE’s pacv -n csu <file>.

Parameters:filename (str) – Filename to save image to.
plot([mode="I", ax=None, show=True, filename=None])

Basic plotter

Parameters:
  • mode (str) – Polarization parameter or parameters to plot. Options include “I”, “Q”, “U”, and “V” for the various Stokes parameters, and “A” and “B” for the feed polarizations. Can contain multiple of these modes to plot simultaneously.
  • ax (matplotlib.axes._subplots.AxesSubplot) – matplotlib Axes to draw on
  • show (bool) – If True, show the figure
  • filename (str) – Filename to save image to.
Returns:

ax, matplotlib.axes._subplots.AxesSubplot

applyFluxcal(fluxcalonar[, fluxcaloffar=None])
applyCalibration(ar)
Parameters:ar (Archive) – Archive to apply calibration to
buildMuellerMatrixPA(PA)

Build the parallactic angle Mueller matrix

Parameters:PA (float) – Parallactic angle
buildMuellerMatrixDifferential(differential)

Build the differential gain Mueller matrix.

Parameters:differential (list/tuple/numpy.ndarray) – The input is a two-element list/array that gives \(\Delta G\) and \(\Delta \psi\), the differential gain and phase.
convertPolarization(S, intype, outtype[, linear=True])

Convenience function to convert a polarization vector between Stokes and Coherence mode

Parameters:
  • S (array) – Polarization vector
  • intype (str) – Input vector type, “Coherence”/”AABBCRCI” or “Stokes”/”IQUV”
  • outtype (str) – Output vector type. For now, since only two modes are implemented, this is redundant.
  • linear (bool) – Linear versus circular input polarization
buildMuellerMatrix([PA=None, feed=None, CC=None, differential=None])

Cross coupling (CC) is not implemented

Parameters:
  • PA (float) – parallactic angle
  • feed (float) – feed type
  • differential (float) –
calculatePA(lat, dec, HA)

Helper function to calculate the parallactic angle

Parameters:
  • lat (float) – latitude of source
  • dec (float) – declination of source
  • HA (float) – hour angle
getI()
Returns:Stokes I
getQ()
Returns:Stokes Q
getU()
Returns:Stokes U
getV()
Returns:Stokes V
getA()
Returns:A polarization
getB()
Returns:B polarization