create_gaintable_from_visibility

ska_sdp_datamodels.calibration.create_gaintable_from_visibility(vis: Visibility, timeslice: float | Literal['auto'] | None = None, jones_type: Literal['T', 'G', 'B'] = 'T') GainTable[source]

Create a unity- or identity-initialised GainTable consistent with the given Visibility.

GainTable either represents:

  • a collection of complex-valued scalar gains, if Visibility carries only Stokes I data.

  • a collection of 2x2 complex-valued Jones matrices otherwise.

In the first case, gains are initialised to unity. In the second case, Jones matrices are initialised to the identity matrix.

Parameters:
  • vis (Visibility) – Visibility object for which we want to create a matching GainTable

  • timeslice (float, str or None, optional) –

    Defines the time scale over which each gain solution is valid. This is used to define the time axis of the GainTable. This parameter is interpreted as follows depending on its type:

    • float: this is a custom time interval in seconds. Input timestamps are grouped by intervals of this duration, and said groups are separately averaged to produce the output time axis.

    • ”auto” or None: match the time resolution of the input, i.e. copy the time axis of the input Visibility

  • jones_type (str, optional) –

    Type of Jones term, one of {“T”, “G”, “B”}. The frequency axis of the output GainTable depends on the value provided:

    • ”B”: the output frequency axis is the same as that of the input Visibility.

    • ”T” or “G”: the solution is assumed to be frequency-independent, and the frequency axis of the output contains a single value: the average frequency of the input Visibility’s channels.

Returns:

GainTable object; its “gain” data variable is always 5-dimensional [ntimes, nants, nfreqs, nrec, nrec] but some axes may have a length of 1 as explained above. In particular, nrec=1 when given pure Stokes I visibilities.

Return type:

GainTable