low_comm_tools.vis_rotate

Attributes

EAST

RotModeType

Classes

RotationJones

Functions

_hashable_freqs(→ tuple[int, Ellipsis])

_load_eeps(→ dict[int, ...)

_load_eeps_cached(→ dict[int, ...)

get_parser(→ argparse.ArgumentParser)

get_rot_jones(→ RotationJones)

hermite_transpose(→ low_comm_tools.ms_utils.ComplexArray)

Perform a Hermetian transpose of a Jones matrix.

main(→ None)

oskar_e_phi(→ float)

Evaluate E_phi for dipole to match current OSKAR function.

oskar_e_theta(→ float)

Evaluate E_theta for dipole to match current OSKAR function.

rot_analytic(→ RotationJones)

Create a rotation Jones from an analytic basis.

rot_eep(→ RotationJones)

rot_mat(→ RotationJones)

Simple rotation matrix

rot_oskar(→ RotationJones)

Create a rotation Jones from OSKAR

rotate_ms(, eepbase, eepsuff, eepcorr)

Module Contents

class low_comm_tools.vis_rotate.RotationJones[source]

Bases: NamedTuple

jones: low_comm_tools.ms_utils.ComplexArray[source]

Rotation Jones matrix

jones_h: low_comm_tools.ms_utils.ComplexArray[source]

Hermetian conjugate of matrix

low_comm_tools.vis_rotate._hashable_freqs(chan_freq_int_round_mhz: numpy.typing.NDArray[numpy.integer[Any]]) tuple[int, Ellipsis][source]
low_comm_tools.vis_rotate._load_eeps(chan_freqs: tuple[int, Ellipsis], eepdir: pathlib.Path, eepbase: str, eepsuff: str) dict[int, low_comm_tools.ms_utils.ComplexArray][source]
low_comm_tools.vis_rotate._load_eeps_cached(chan_freq_int_round_mhz: numpy.typing.NDArray[numpy.integer[Any]], eepdir: pathlib.Path, eepbase: str, eepsuff: str) dict[int, low_comm_tools.ms_utils.ComplexArray][source]
low_comm_tools.vis_rotate.get_parser(add_help: bool = True) argparse.ArgumentParser[source]
low_comm_tools.vis_rotate.get_rot_jones(mode: RotModeType, station_rot_ant1_rad: float, station_rot_ant2_rad: float, invert: bool, times: astropy.time.Time, target: astropy.coordinates.SkyCoord, freqs: astropy.units.Quantity, eepdir: pathlib.Path, eepbase: str, eepsuff: str, eepcorr: bool) RotationJones[source]
low_comm_tools.vis_rotate.hermite_transpose(jones: low_comm_tools.ms_utils.ComplexArray) low_comm_tools.ms_utils.ComplexArray[source]

Perform a Hermetian transpose of a Jones matrix.

Can be shape […, 2, 2] Transpose will be performed over the last two axes.

Parameters:

array (ComplexArray) – The Jones matrix

Returns:

Hermetian transposed Jones

Return type:

ComplexArray

low_comm_tools.vis_rotate.main() None[source]
low_comm_tools.vis_rotate.oskar_e_phi(kl: float, theta: float, phi: float) float[source]

Evaluate E_phi for dipole to match current OSKAR function.

This is also in ska-sdp-func (and therefore also used by EveryBeam?). The dipole is oriented with its axis along the x-axis, where phi = 0.

A hack was added in order to help identify where phi = 0.

TODO: Add descriptions for arguments. These appear to be angles in radians.

Parameters:
  • kl (float) – TODO: Add description

  • theta (float) – TODO: Add description

  • phi (float) – TODO: Add description

Returns:

E_phi term

Return type:

float

low_comm_tools.vis_rotate.oskar_e_theta(kl: float, theta: float, phi: float) float[source]

Evaluate E_theta for dipole to match current OSKAR function.

This is also in ska-sdp-func (and therefore also used by EveryBeam?). The dipole is oriented with its axis along the x-axis, where phi = 0.

A hack was added in order to help identify where phi = 0.

TODO: Add descriptions for arguments. These appear to be angles in radians.

Parameters:
  • kl (float) – TODO: Add description

  • theta (float) – TODO: Add description

  • phi (float) – TODO: Add description

Returns:

E_theta term

Return type:

float

low_comm_tools.vis_rotate.rot_analytic(times: astropy.time.Time, loc: astropy.coordinates.EarthLocation, radec: astropy.coordinates.SkyCoord, ang_rad: float, do_inv: bool) RotationJones[source]

Create a rotation Jones from an analytic basis.

Parameters:
  • time (Time) – Times of observation

  • loc (EarthLocation) – Station location

  • radec (SkyCoord) – Beam centre location

  • ang (float) – Station rotation

  • do_inv (bool) – Invert matrices?

Returns:

matrix, matrix_h

Return type:

RotationJones

low_comm_tools.vis_rotate.rot_eep(eeps: list[numpy.typing.NDArray[numpy.complex64 | numpy.complex128]], times: astropy.time.Time, loc: astropy.coordinates.EarthLocation, radec: astropy.coordinates.SkyCoord, ang_rad: float, do_inv: bool, **eep_kwargs) RotationJones[source]
low_comm_tools.vis_rotate.rot_mat(angle_rad: float, do_inv: bool) RotationJones[source]

Simple rotation matrix

Parameters:
  • angle (float) – Angle of rotation

  • do_inv (bool) – Invert matrices?

Returns:

matrix, matrix_h

Return type:

RotationJones

low_comm_tools.vis_rotate.rot_oskar(times: astropy.time.Time, loc: astropy.coordinates.EarthLocation, radec: astropy.coordinates.SkyCoord, ang_rad: float, do_inv: bool) RotationJones[source]

Create a rotation Jones from OSKAR

This should be the same as OSKAR uses for its analytic model, except that here we have added an extra factor of cos(zenithangle)

Parameters:
  • time (Time) – Times of observation

  • loc (EarthLocation) – Station location

  • radec (SkyCoord) – Beam centre location

  • ang (float) – Station rotation

  • do_inv (bool) – Invert matrices?

Returns:

_description_

Return type:

RotationJones

low_comm_tools.vis_rotate.rotate_ms(msname: pathlib.Path, column: str = 'CORRECTED_DATA', write_to_column: str | None = None, mode: RotModeType = 'analytic', invert: bool = False, dryrun: bool = False, eepdir: pathlib.Path = Path('/shared/eep-data/Perturbed_Vogel_HARP/Average_EEPs/'), eepbase: str = 'HARP_SKALA41_randvogel_avg_', eepsuff: str = '.npz', eepcorr: bool = False) None[source]
low_comm_tools.vis_rotate.EAST[source]
low_comm_tools.vis_rotate.RotModeType[source]