sky_simulate module

This module contains functions to simulate the sky and make predictions for various tests.

aiv_utils.sky_simulate.get_beam_map(sky_elevation, sky_azimuth, sel_elevation_deg, sel_azimuth_deg, freq_array, antenna_x_locations_m, antenna_y_locations_m, station_rotation, beam_pattern_healpix_xh, beam_pattern_healpix_yh, beam_pattern_healpix_xv, beam_pattern_healpix_yv)

Compute station beams as healpix arrays for pixels above horizon

Parameters:
  • sky_elevation (float) – The elevation of the beam on the sky in degrees.

  • sky_azimuth (float) – The azimuth of the beam on the sky in degrees.

  • sel_elevation_deg (ndarray) – The elevation of the healpix sky positions in degrees.

  • sel_azimuth_deg (ndarray) – The azimuth of the healpix sky positions in degrees.

  • freq_array (ndarray) – The frequency array to get the beam map for in MHz.

  • antenna_x_locations_m (ndarray) – The x locations of the antennas in metres.

  • antenna_y_locations_m (ndarray) – The y locations of the antennas in metres.

  • station_rotation (float) – The rotation of the station in degrees.

  • beam_pattern_healpix_xh (ndarray) – The X horizontal beam pattern.

  • beam_pattern_healpix_yh (ndarray) – The Y horizontal beam pattern.

  • beam_pattern_healpix_xv (ndarray) – The X vertical beam pattern.

  • beam_pattern_healpix_yv (ndarray) – The Y vertical beam pattern.

Return type:

tuple[ndarray, ndarray]

Returns:

The X and Y beam maps.

aiv_utils.sky_simulate.get_eep_patterns_map(freq_array, index_array, eep_path=None, file_name_part_1=None)

Get the EEP patterns for selected frequencies.

Parameters:
  • freq_array (ndarray) – The frequency array to get the EEP patterns for in MHz.

  • index_array (ndarray) – The index array to select beam values closest to healpix centres.

  • eep_path (str) – The path to the EEPs.

  • file_name_part_1 (str) – The start of the EEP file name.

Returns:

The X and Y beam patterns of the horizontal and vertical beam.

aiv_utils.sky_simulate.get_map_parameters(map_nside)

Get the IDs and celestial coordinates of each pixel in a healpix map.

Parameters:

map_nside – The nside of the healpix map

aiv_utils.sky_simulate.get_scan_parameters(time, scan_type, freq, station_coord, ra_prev=None, dec_prev=None, max_duration=None, on_off_dist=2.0, sun_dist=4.0, bright_srcs=array(['Cas A', 'CygA', 'TauA', 'VirA', 'HerA', 'SagA', 'CenA', 'HydA', 'Vela Pulsar', 'ForA', 'PicA', 'Orion', 'LMC'], dtype='<U11'), bright_srcs_l=None, bright_srcs_b=None, plot_results=False, t_rec=40.0)

Get the scan parameters for a given time and frequency.

Parameters:
  • time (datetime) – The datetime of the scan start time in UTC.

  • scan_type (str) – ‘on’ or ‘off’. For the ‘on’ scan type, the function will select the hottest observable sky position. For the ‘off’ scan type, the coldest sky position will be selected.

  • freq (float) – Mean frequency of the scan (in MHz).

  • station_coord (EarthLocation) – The EarthLocation of the station.

  • ra_prev (float) – If this is an off scan, supply RA of previous on-scan to avoid choosing an off scan location within on_off_dist beam widths.

  • dec_prev (float) – If this is an off scan, supply dec of previous on-scan to avoid choosing an off scan location within on_off_dist beam widths.

  • max_duration (int) – The maximum duration of the scan in minutes.

  • on_off_dist (float) – The distance in beam widths to avoid selecting an off scan location close to the on scan location.

  • sun_dist (float) – The distance in beam widths to avoid selecting an on or off scan location close to the Sun.

  • bright_srcs (ndarray) – The list of bright sources to plot on the sky map.

  • bright_srcs_l – The galactic longitudes of the bright sources.

  • bright_srcs_b – The galactic latitudes of the bright sources.

  • plot_results (bool) – Whether to plot the results.

  • t_rec (float) – The receiver temperature in K.

aiv_utils.sky_simulate.get_sel_gsmap(freq_array, time_utc, station_site, station_rotation)

Get expected sky model based on diffused sky and the sun

Parameters:
  • freq_array (ndarray) – The frequency array to get the sky model for in MHz.

  • time_utc (Time) – The time of the observation in UTC.

  • station_site (EarthLocation) – The EarthLocation of the station.

  • station_rotation (float) – The rotation of the station in degrees.

Return type:

tuple[ndarray, ndarray, ndarray, ndarray, ndarray, int]

Returns:

The selected sky model, azimuth, elevation, indices, index array, and npix.

aiv_utils.sky_simulate.get_source_coordinates(src_list)

Get the galactic coordinates of a list of source names.

Parameters:

src_list (ndarray) – List of source names

Return type:

tuple[list, list]

aiv_utils.sky_simulate.gsmodel(frequency_megahertz)

Get the GSM 2016 Global Sky Model for a given frequency.

Parameters:

frequency_megahertz (ndarray) – The frequency to get the sky model for in MHz.

Return type:

ndarray

Returns:

The Global Sky Model.

aiv_utils.sky_simulate.plot_observation_spectrum(freq_array, sky_elevation, sky_azimuth, spectrum_x, spectrum_y, beam_x_array, beam_y_array, sel_indices, elevation_deg, npix, antenna_spectrum_x, antenna_spectrum_y, predicted_spectrum_x, predicted_spectrum_y, t_rec, bandpass_analog_norm, time_utc, station_site)

Plot the observation spectrum.

Parameters:
  • freq_array – The frequencies of the observation in MHz.

  • sky_elevation (float) – The elevation of the beam on the sky in degrees.

  • sky_azimuth (float) – The azimuth of the beam on the sky in degrees.

  • spectrum_x – The X spectrum.

  • spectrum_y – The Y spectrum.

  • beam_x_array – The X beam array.

  • beam_y_array – The Y beam array.

  • sel_indices – The selected indices.

  • elevation_deg – The elevation in degrees.

  • npix – The number of pixels.

  • antenna_spectrum_x – The X spectrum at the antenna.

  • antenna_spectrum_y – The Y spectrum at the antenna.

  • predicted_spectrum_x – The predicted X spectrum.

  • predicted_spectrum_y – The predicted Y spectrum.

  • t_rec – The receiver temperature in Kelvin.

  • bandpass_analog_norm – The normalised bandpass.

  • time_utc – The time of the observation in UTC.

  • station_site – The EarthLocation of the station.

aiv_utils.sky_simulate.plot_on_off_sources(nside_dg, freq, temp_map_dg, nside, pixel_src, time, scan_type, sun_altaz, bright_srcs=None, bright_srcs_l=None, bright_srcs_b=None)

Plot the on and off sources on the sky map.

Parameters:
  • nside_dg (int) – The nside of the downgraded healpix map.

  • freq (float) – The frequency of the observation.

  • temp_map_dg (ndarray) – The downgraded healpix map.

  • nside (int) – The nside of the healpix map.

  • pixel_src (int) – The pixel of the source.

  • time (datetime) – The time of the observation.

  • scan_type (str) – The type of the scan.

  • sun_altaz (SkyCoord) – The altitude and azimuth of the Sun.

  • bright_srcs (ndarray) – The list of bright sources to plot on the sky map.

  • bright_srcs_l (ndarray) – The galactic longitudes of the bright sources.

  • bright_srcs_b (ndarray) – The galactic latitudes of the bright sources.

aiv_utils.sky_simulate.predict_observation_spectrum(freq_array, time_utc, station_site, sky_elevation, sky_azimuth, antenna_x_locations_m, antenna_y_locations_m, station_rotation, t_rec=40.0, eep_path=None, file_name_part_1=None, plot_results=False)

Predict the observation spectrum for a given station and frequency.

Parameters:
  • freq_array (ndarray) – The frequencies of the observation in MHz.

  • time_utc (Time) – The time of the observation in UTC.

  • station_site (EarthLocation) – The EarthLocation of the station.

  • sky_elevation (float) – The elevation of the beam on the sky in degrees.

  • sky_azimuth (float) – The azimuth of the beam on the sky in degrees.

  • antenna_x_locations_m (ndarray) – The x locations of the antennas in metres.

  • antenna_y_locations_m (ndarray) – The y locations of the antennas in metres.

  • station_rotation (float) – The rotation of the station in degrees.

  • t_rec (float) – The receiver temperature in Kelvin.

  • eep_path (str) – The path to the EEPs.

  • file_name_part_1 (str) – The beginning of the filename of the EEPs.

  • plot_results (bool) – Whether to plot the results.

Return type:

tuple[ndarray, ndarray]

Returns:

The predicted X and Y spectra.

aiv_utils.sky_simulate.predict_on_off_sources(station_name, scan_freqs, bright_srcs=array(['Cas A', 'CygA', 'TauA', 'VirA', 'HerA', 'SagA', 'CenA', 'HydA', 'Vela Pulsar', 'ForA', 'PicA', 'Orion', 'LMC'], dtype='<U11'), test_utc=None, buffer_min=2.0, max_duration=None, on_off_dist=2.0, sun_dist=4.0, plot_results=False, t_rec=40.0)

Predict the on and off source locations for a given station and frequency.

Parameters:
  • station_name (str) – The name of the station (e.g. ‘s8-1’, ‘s8-6’).

  • scan_freqs (list[list[float]]) – A list of frequency ranges to scan where each list is a list of the min and max frequency in MHz.

  • bright_srcs (ndarray) – A list of bright sources to plot on the sky map.

  • test_utc (datetime) – The time of the scan in UTC.

  • buffer_min (float) – The buffer time between scans in minutes.

  • max_duration (float) – The maximum duration of the scan in minutes.

  • on_off_dist (float) – The distance in beam widths to avoid selecting an off scan location close to the on scan location.

  • sun_dist (float) – The distance in beam widths to avoid selecting an on or off scan location close to the Sun.

  • t_rec (float) – The receiver temperature in K.

aiv_utils.sky_simulate.sun_side_lobe_exclusion(freq_megahertz)

Estimate the inner and outer radius of where the majority of the station side lobes will be.

Parameters:

freq_megahertz – Frequency of the observation in megahertz.

Return lower, upper:

The inner and outer radius in degrees or None if the freq_megahertz is low enough to not have significant side lobes.