Observation#
- class pyvisgen.simulation.observation.Observation(src_ra: float, src_dec: float, start_time: datetime, scan_duration: int, num_scans: int, scan_separation: int, integration_time: int, ref_frequency: float, frequency_offsets: list, bandwidths: list, fov: float, image_size: int, array_layout: str, corrupted: bool, device: str, dense: bool = False, sensitivity_cut: float = 1e-06, polarization: str = None, pol_kwargs: dict = {'amp_ratio': 0.5, 'delta': 0, 'random_state': 42}, field_kwargs: dict = {'order': [1, 1], 'random_state': 42, 'scale': [0, 1], 'threshold': None}, show_progress: bool = False)[source]#
Bases:
objectMain observation simulation class. The
Observationclass simulates the baselines and time steps during the observation.- Parameters:
- src_rafloat
Source right ascension coordinate.
- src_decfloat
Source declination coordinate.
- start_timedatetime
Observation start time.
- scan_durationint
Scan duration.
- num_scansint
Number of scans.
- scan_separationint
Scan separation.
- integration_timeint
Integration time.
- ref_frequencyfloat
Reference frequency.
- frequency_offsetslist
Frequency offsets.
- bandwidthslist
Frequency bandwidth.
- fovfloat
Field of view.
- image_sizeint
Image size of the sky distribution.
- array_layoutstr
Name of an existing array layout. See
layouts.- corruptedbool
If
True, apply corruption during the vis loop.- devicestr
Torch device to select for computation.
- densebool, optional
If
True, apply dense baseline calculation of a perfect interferometer. Default:False- sensitivity_cutfloat, optional
Sensitivity threshold, where only pixels above the value are kept. Default:
1e-6- polarizationstr, optional
Choose between
'linear'or'circular'orNoneto simulate different types of polarizations or disable the simulation of polarization. Default:None- pol_kwargsdict, optional
Additional keyword arguments for the simulation of polarization. Default:
{'delta': 0,'amp_ratio': 0.5,'random_state': 42}- field_kwargsdict, optional
Additional keyword arguments for the random polarization field that is applied when simulating polarization. Default:
{'order': [1, 1],'scale': [0, 1],'threshold': None,'random_state': 42}- show_progressbool, optional
If
True, show a progress bar during the iteration over the scans. Default:False
Notes
See
polarizationandrand_polarization_fieldfor more information on the keyword arguments inpol_kwargsandfield_kwargs, respectively.Methods Summary
Initializes
Baselinesdataclass object and callsget_baselines()to compute the contents of theBaselinesdataclass.Calculates the baselines of a densely-built antenna array, which would provide full coverage of the uv space.
calc_direction_cosines(ha, el_st, delta_x, ...)Calculates direction cosines u, v, and w for given hour angles and relative antenna positions.
Calculates feed rotation for every antenna at every time step.
calc_ref_elev([time])Calculates the station elevations for given time steps.
Computes the time steps of the observation.
Calculates sine projection for fov
Calculates RA and Dec values for a given fov around a source position
get_baselines(times)Calculates baselines from source coordinates and time of observation for every antenna station in array_layout.
Methods Documentation
- calc_baselines()[source]#
Initializes
Baselinesdataclass object and callsget_baselines()to compute the contents of theBaselinesdataclass.
- calc_dense_baselines()[source]#
Calculates the baselines of a densely-built antenna array, which would provide full coverage of the uv space.
- calc_direction_cosines(ha: tensor, el_st: tensor, delta_x: tensor, delta_y: tensor, delta_z: tensor)[source]#
Calculates direction cosines u, v, and w for given hour angles and relative antenna positions.
- Parameters:
- ha
torch.tensor() Tensor containing hour angles for each time step.
- el_st
torch.tensor() Tensor containing station elevations.
- delta_x
torch.tensor() Tensor containing relative antenna x-postions.
- delta_y
torch.tensor() Tensor containing relative antenna y-postions.
- delta_z
torch.tensor() Tensor containing relative antenna z-postions.
- ha
- Returns:
- u
torch.tensor() Tensor containing direction cosines in u-axis direction.
- v
torch.tensor() Tensor containing direction cosines in v-axis direction.
- w
torch.tensor() Tensor containing direction cosines in w-axis direction.
- u
- calc_feed_rotation(ha: Angle) Angle[source]#
Calculates feed rotation for every antenna at every time step.
Notes
The calculation is based on Equation (13.1) of Meeus’ Astronomical Algorithms:
\[q = \atan\left(\frac{\sin h}{\cos\delta \tan\varphi - \sin\delta \cos h\right),\]where $h$ is the local hour angle, $varphi$ the geographical latitude of the observer, and $delta$ the declination of the source.
- calc_ref_elev(time=None) tuple[source]#
Calculates the station elevations for given time steps.
- Parameters:
- timearray_like or None, optional
Array containing observation time steps. Default:
None
- Returns:
- tuple
Tuple containing tensors of the Greenwich hour angle, antenna-local hour angles, and the elevations.
- calc_time_steps()[source]#
Computes the time steps of the observation.
- Returns:
- timearray_like
Array of time steps.
- time.mjdarray_like
Time steps in mjd format.
- create_lm_grid()[source]#
Calculates sine projection for fov
- Parameters:
- rd_grid3d array
array containing a RA and Dec value in every pixel
- src_crdastropy SkyCoord
source position
- Returns:
- lm_grid3d array
Returns a 3d array with every pixel containing an l and m value
- create_rd_grid()[source]#
Calculates RA and Dec values for a given fov around a source position
- Parameters:
- fovfloat
FOV size
- samplesint
number of pixels
- src_ra
right ascensio of the source in deg
- src_dec
dec of the source in deg
- Returns:
- rd_grid3d array
Returns a 3d array with every pixel containing a RA and Dec value