wodenpy.array_layout

Ways to create the array layout of the telescope, and methods to precess that array to account for the sky model being in J2000 frame.

create_array_layout

Functions to create the array layout for the simulation, precess it, and convert it to the correct format for the C functions.

class create_array_layout.Array_Layout_Python[source]

A class to represent the layout of an array in Python.

ant_X

Antenna X coordinates (metres).

Type:

None

ant_Y

Antenna Y coordinates (metres).

Type:

None

ant_Z

Antenna Z coordinates (metres).

Type:

None

X_diff_metres

The difference in X coordinates (metres).

Type:

None

Y_diff_metres

The difference in Y coordinates (metres).

Type:

None

Z_diff_metres

The difference in Z coordinates (metres).

Type:

None

ant_east

Antenna east coordinates (metres)

Type:

None

ant_north

Antenna north coordinates (metres)

Type:

None

ant_height

Antenna height coordinates (metres)

Type:

None

latitude

The latitude of the array (radians).

Type:

None

num_baselines

The number of baselines.

Type:

None

num_tiles

The number of tiles.

Type:

None

lst_base

The base of the local sidereal time.

Type:

None

create_array_layout.RTS_PrecessXYZtoJ2000(array_layout: Array_Layout_Python, woden_settings: Woden_Settings_Python) Array_Layout_Python[source]

Given the populated array_layout and settings in woden_settings, use RTS functions to precess the array back to J2000, to account for the skymodel being in J2000.

Parameters:
  • array_layout (Array_Layout_Python) – Populated array layout in the simulation epoch

  • woden_settings (Woden_Settings_Python) – Populated settings, where the woden_settings.lsts should have been precessed back to J2000 already.

Returns:

The updated array layout with array_layout.ant_X, array_layout.ant_Y, and array_layout.ant_Z precessed back to J2000.

Return type:

Array_Layout_Ctypes

create_array_layout.RTS_precXYZ(rmat: ndarray, x: float, y: float, z: float, lmst: float, lmst2000: float) Tuple[float, float, float][source]

RTS magic for precessing local X,Y,Z from the current time frame back to J2000

Parameters:
  • rmat (np.ndarray) – 2D rotation matrix as output by palpy.prenut

  • x (float) – Local X coord of antenna (tile)

  • y (float) – Local Y coord of antenna (tile)

  • z (float) – Local X coord of antenna (tile)

  • lmst (float) – LST of the array in the current frame

  • lmst2000 (float) – LST of the array in the J2000 frame

Returns:

The precessed X,Y,Z coords

Return type:

Tuple[float, float, float]

create_array_layout.calc_XYZ_diffs(woden_settings_python: Woden_Settings_Python, args: Namespace, logger: Logger = False) Array_Layout_Python[source]

Populates an Array_Layout_Ctypes class with the instrument layout, given the command line arguments. Calculates the differences in X, Y, and Z coordinates between all pairs of antennas in the array.

Parameters:
  • woden_settings_python (Woden_Settings_Python) – An populated Woden_Settings instance

  • args (argparse.Namespace) – The command line arguments checked by wodenpy.wodenpy_setup.check_args

  • logger (Logger) – A logger instance to log messages

Returns:

  • array_layout

  • - An instance of the Structure class containing the X, Y, and Z differences between all pairs of antennas in the array at each time step.

create_array_layout.convert_array_layout_to_ctypes(array_layout_python: Array_Layout_Python, array_layout_ctypes: Array_Layout_Ctypes) Array_Layout_Ctypes[source]

Just convert things we need for C/GPU functions, not every field

create_array_layout.convert_ecef_to_enh(ecef_X: ndarray, ecef_Y: ndarray, ecef_Z: ndarray, lon: float, lat: float) Tuple[ndarray, ndarray, ndarray][source]

The array coords in a measurement set seem to be Earth Centred Earth Fixed coords

I got the maths to go from ECEF to enh from this site: https://gssc.esa.int/navipedia/index.php/Transformations_between_ECEF_and_ENU_coordinates

Parameters:
  • ecef_X (np.ndarray) – ECEF X coordinates (metres)

  • ecef_Y (np.ndarray) – ECEF Y coordinates (metres)

  • ecef_Z (np.ndarray) – ECEF Z coordinates (metres)

  • lon (float) – Longitude of the array (radians)

  • lat (float) – Latitude of the array (radians

Returns:

The east, north, and height coordinates

Return type:

Tuple[np.ndarray, np.ndarray, np.ndarray]

create_array_layout.convert_enh_to_ecef(east: ndarray, north: ndarray, height: ndarray, lon: float, lat: float) Tuple[ndarray, ndarray, ndarray][source]

Convert from array centred east, north, heigh (ENH) coordinates to Earth Centred, Earth Fixed (ECEF) coordinates.

I got the maths from this site: https://gssc.esa.int/navipedia/index.php/Transformations_between_ECEF_and_ENU_coordinates

Parameters:
  • east (np.ndarray) – Local east (metres)

  • north (np.ndarray) – Local north (metres)

  • height (np.ndarray) – Local height (metres)

  • lon (float) – Longitude of the array centre (radians)

  • lat (float) – Latitude of the array centre (radians)

Returns:

The ECEF X, Y, Z coordinates

Return type:

Tuple[np.ndarray, np.ndarray, np.ndarray]

create_array_layout.enh2xyz(east: float, north: float, height: float, latitude: float) Tuple[float, float, float][source]

Takes local east, north, height coords for a given latitude (radians) and returns local X,Y,Z coords to put in the uvfits antenna table

Parameters:
  • east (float) – Local east coorindate (metres)

  • north (float) – Local north coorindate (metres)

  • height (float) – Local height coorindate (metres)

  • latitude (float) – Latitude of the array - defaults to MWA location (radians)

Returns:

  • X (float) – Local X antenna location

  • Y (float) – Local Y antenna location

  • Z (float) – Local Z antenna location

create_array_layout.setup_array_layout_python(woden_settings_python: Woden_Settings_Python, args: Namespace) Array_Layout_Python[source]

Given the populated Woden_Settings_Python class and the command line arguments, set up the Array_Layout_Python class, and fill it with the correct values, as well as creating the correct size arrays:

  • array_layout.ant_X

  • array_layout.ant_Y

  • array_layout.ant_Z

  • array_layout.X_diff_metres

  • array_layout.Y_diff_metres

  • array_layout.Z_diff_metres

Parameters:
  • woden_settings_python (Woden_Settings_Python) – Populated Woden_Settings_Python class.

  • args (argparse.Namespace) – Input arguments from the command line that have been checked using wodenpy.use_libwoden.check_args.check_args.

Returns:

array_layout – Initialised Array_Layout_Python class.

Return type:

Array_Layout_Python

precession

Contains an old RTS function to precess the LST and latitude from the current time to J2000.

precession.RTS_Precess_LST_Lat_to_J2000(lst_current: float, latitude_current: float, mjd: float) Tuple[float, float][source]

Convert the current local sidereal time and latitude to the J2000 mean system.

Parameters:
  • lst_current (float) – The current local sidereal time in radians.

  • latitude_current (float) – The current latitude in radians.

  • mjd (float) – The current modified Julian date.

Returns:

lst_J2000, latitude_J2000 – A tuple containing the local sidereal time and latitude in the J2000 mean system, both in radians.

Return type:

Tuple[float, float]