katcbf_vlbi_resample.polarisation module

Convert polarised data between bases.

Note that the equations in this module require that the electric field sign convention is such that phase increases with time at a given position in space. That is valid for MeerKAT for not for KAT-7.

class katcbf_vlbi_resample.polarisation.ConvertPolarisation(input_data: Stream[DataArray], matrix: ndarray, in_pol_labels: Iterable[str] = ('pol0', 'pol1'), out_pol_labels: Iterable[str] = ('pol0', 'pol1'))

Bases: ChunkwiseStream[DataArray, DataArray]

Convert polarisation basis of a stream.

Parameters:
  • input_data – Input data stream. Each chunk must contain an axis called pol with coordinates given by in_pol_labels, and must not contain an axis called in_pol.

  • matrix – Jones matrix to convert from input to output polarisation basis.

  • in_pol_labels – Coordinates used for the input polarisations (must be a list of 2 elements)

  • out_pol_labels – Coordinates that will be used by the polarisations on output.

katcbf_vlbi_resample.polarisation.from_linear(pols: Sequence[str]) ndarray

Create a Jones matrix to convert to a linear coordinate system (x, y).

See to_linear() for details. This function simply returns the inverse.

katcbf_vlbi_resample.polarisation.parse_pol(spec: str) ndarray

Parse a single polarisation.

A polarisation is one of x, y, R or L, optionally prefixed with a + or -.

The return value is a vector giving the coordinates of a unit signal of this polarisation in linear x, y coordinates.

Raises:

ValueError – if the argument does not match the expected format.

katcbf_vlbi_resample.polarisation.parse_spec(spec: str) ndarray

Parse a polarisation conversion specification.

The specification has the form a,b:c,d where a and b are the basis for the input and c and d are the basis for the output. See parse_pol() for the format of these elements.

The return value is a Jones matrix which is multiplied by the electric field vector to get the output vector.

Raises:

ValueError – if the argument does not match the expected format.

katcbf_vlbi_resample.polarisation.to_linear(pols: Sequence[str]) ndarray

Create a Jones matrix to convert to a linear coordinate system (x, y).

Parameters:

pols – A sequence with exactly two elements. Each element is parsed by parse_pol().

Raises:

ValueError – If pols has the wrong length, parse_pol() fails to parse a string element, or the two elements are linearly dependent.