argosim.antenna_utils module#
Antenna utils.
This module contains functions to generate antenna arrays, compute its baselines, perform aperture synthesis, obtain uv-coverage and get observations from sky models.
- Authors:
Ezequiel Centofanti <ezequiel.centofanti@cea.fr> Samuel Gullin <gullin@ia.forth.gr>
- argosim.antenna_utils.ENU_to_XYZ(b_ENU, lat=0.6108652381980153)[source]#
ENU to XYZ.
Function to convert the baselines from East-North-Up (ENU) to XYZ coordinates.
- Parameters:
b_ENU (np.ndarray) – The baselines in ENU coordinates.
lat (float) – The latitude of the antenna array in radians.
- Returns:
X (np.ndarray) – The X coordinate of the baselines in XYZ coordinates.
Y (np.ndarray) – The Y coordinate of the baselines in XYZ coordinates.
Z (np.ndarray) – The Z coordinate of the baselines in XYZ coordinates.
- argosim.antenna_utils.XYZ_to_uvw(X, Y, Z, dec=0.5235987755982988, ha=0.0, f=1420000000.0)[source]#
XYZ to uvw.
Get the uvw sampling points from the XYZ coordinates given a source declination, hour angle and frequency.
- Parameters:
X (np.ndarray) – The X coordinate of the baselines in XYZ coordinates.
Y (np.ndarray) – The Y coordinate of the baselines in XYZ coordinates.
Z (np.ndarray) – The Z coordinate of the baselines in XYZ coordinates.
dec (float) – The declination of the source in radians.
ha (float) – The hour angle of the source in radians.
f (float) – The frequency of the observation in Hz.
- Returns:
u (np.ndarray) – The u coordinate of the baselines in uvw coordinates.
v (np.ndarray) – The v coordinate of the baselines in uvw coordinates.
w (np.ndarray) – The w coordinate of the baselines in uvw coordinates.
- argosim.antenna_utils.circular_antenna_arr(n_antenna=3, r=300.0)[source]#
Circular antenna arr.
Function to generate a circular antenna array. Antennas lie in a circumference of radius ‘r’ from the center [0,0] and are equally spaced.
- Parameters:
n_antenna (int) – The number of antennas in the array.
r (float) – The radius of the antenna array in meters.
- Returns:
antenna_arr – The antenna array positions in ENU coordinates.
- Return type:
np.ndarray
- argosim.antenna_utils.combine_antenna_arr(arr1, arr2)[source]#
Combine antenna arr.
Function to combine two antenna arrays.
- Parameters:
arr1 (np.ndarray) – The first antenna array positions.
arr2 (np.ndarray) – The second antenna array positions.
- Returns:
arr – The combined antenna array positions.
- Return type:
np.ndarray
- argosim.antenna_utils.get_baselines(array)[source]#
Get baselines.
Function to compute the baselines of an antenna array.
- Parameters:
array (np.ndarray) – The antenna array positions.
- Returns:
baselines – The baselines of the antenna array.
- Return type:
np.ndarray
- argosim.antenna_utils.load_antenna_enu_txt(path, noise=False)[source]#
Load antenna txt.
Function to load antenna name, ENU positions and noise from a txt file.
- Parameters:
path (str) – The path to the txt file.
noise (bool) – Specify if the file contain the noise level of each antenna.
- Returns:
antenna_arr (np.ndarray) – The antenna array positions.
noise_level (np.ndarray) – If noise==True, return antenna noise level.
- argosim.antenna_utils.load_antenna_latlon_txt(path, noise=False)[source]#
(lat,long,altitude) to ENU.
Function to load the antenna name, latitude (degree), longitude (degree), altitude (metre) and noise from a txt file, and return the information with ENU positions. The reference is taken as the middle of all the antennas. Waring: the computation of the upp coordinate is valid for antennas that are close enough.
- Parameters:
path (str) – The path to the txt file.
noise (bool) – Specify if the file contain the noise level of each antenna.
- Returns:
antenna_arr (np.ndarray) – The antenna array positions.
noise_level (np.ndarray) – If noise==True, return antenna noise level.
- argosim.antenna_utils.random_antenna_arr(n_antenna=3, E_lim=1000.0, N_lim=1000.0, U_lim=0.0, seed=None)[source]#
Random antenna arr.
Function to generate a random antenna array. Antennas lie randomly distributed in the range: [-E_lims/2, E_lims/2]x[-N_lims/2, N_lims/2]x[0, U_lims].
- Parameters:
n_antenna (int) – The number of antennas in the array.
E_lim (float) – The east coordinate span width of the antenna positions in meters.
N_lim (float) – The north coordinate span width of the antenna positions in meters.
U_lim (float) – The up coordinate span width of the antenna positions in meters.
seed (int) – Optional seed to set.
- Returns:
antenna_arr – The antenna array positions in ENU coordinates.
- Return type:
np.ndarray
- argosim.antenna_utils.random_antenna_pos(E_lim=1000.0, N_lim=1000.0, U_lim=0.0, seed=None)[source]#
Random antenna pos.
Function to generate a random antenna location in ENU coordinates. Antenna lies in the range: [-E_lims/2, E_lims/2]x[-N_lims/2, N_lims/2]x[0, U_lims].
- Parameters:
E_lim (float) – The east coordinate span width of the antenna position in meters.
N_lim (float) – The north coordinate span width of the antenna position in meters.
U_lim (float) – The up coordinate span width of the antenna position in meters.
seed (int) – Optional seed to set.
- Returns:
antenna_pos – The antenna position in ENU coordinates.
- Return type:
np.ndarray
- argosim.antenna_utils.save_antenna_enu_txt(antenna, path, noise=None)[source]#
Save the antenna information into a txt file.
Function to save the antenna name, ENU positions and optionally noise into a txt file.
- Parameters:
antenna (np.ndarray) – The numpy array which contain the antenna information.
path (str) – The path to the txt file.
np.ndarray (noise) – The numpy array which contain the noise information, if available.
- Returns:
The function only saves the file.
- Return type:
None
- argosim.antenna_utils.uni_antenna_array(n_antenna_E=32, n_antenna_N=32, E_lim=800.0, N_lim=800.0, U_lim=0.0)[source]#
Uniform (grid) antenna arr.
Function to generate a uniform antenna array. Antennas lie uniformely distributed in the range, and center on [0,0,U_lim]: [-E_lim/2, E_lim/2]x[-N_lim/2, N_lim/2]x[U_lim]. Only allow to generate a grid at a fixed height U_lim (fixed Up component).
- Parameters:
n_antenna_E (int) – The number of antennas in the North direction (vertical).
n_antenna_N (int) – The number of antennas in the East direction (horizontal).
E_lim (float) – The east coordinate span width of the antenna positions in meters.
N_lim (float) – The north coordinate span width of the antenna positions in meters.
U_lim (float) – The up coordinate span width of the antenna positions in meters.
- Returns:
antenna_arr – The antenna array positions in ENU coordinates.
- Return type:
np.ndarray
- argosim.antenna_utils.uv_track_multiband(b_ENU, lat=0.6108652381980153, dec=0.6108652381980153, track_time=0.0, t_0=0.0, n_times=1, f=1420000000.0, df=0.0, n_freqs=1, multi_band=False)[source]#
Uv track multiband.
Function to compute the uv sampling baselines for a given observation time and frequency range.
- Parameters:
b_ENU (np.ndarray) – The baselines in ENU coordinates.
lat (float) – The latitude of the antenna array in radians.
dec (float) – The declination of the source in radians.
track_time (float) – The duration of the tracking in hours.
t_0 (float) – The initial tracking time in hours.
n_times (int) – The number of time steps.
f (float) – The central frequency of the observation in Hz.
df (float) – The frequency range of the observation in Hz.
n_freqs (int) – The number of frequency samples.
multi_band (bool) – If True separate the uv samples per frequency bands.
- Returns:
track (np.ndarray) – The uv sampling baselines listed for each time step and frequency.
f_range (np.ndarray) – The list of frequency bands used in the simulation.
- argosim.antenna_utils.y_antenna_arr(n_antenna=5, r=500.0, alpha=0.0)[source]#
Y antenna arr.
Function to generate a Y-shaped antenna array. Antennas lie equispaced in three radial arms of 120 degrees each.
- Parameters:
n_antenna (int) – The number of antennas per arm.
r (float) – The radius of the antenna array in meters.
alpha (float) – The angle of the first arm.
- Returns:
antenna_arr – The antenna array positions in ENU coordinates.
- Return type:
np.ndarray