Telescope Model

class oskar.Telescope(precision=None, settings=None)

This class provides a Python interface to an OSKAR telescope model.

A telescope model contains the parameters and data used to describe a telescope configuration, primarily station and element coordinate data.

Telescope models used by OSKAR are stored in a directory structure, which is fully described in the telescope model documentation. The oskar.Telescope class can be used to load a telescope model (using the load() method) and, to a limited extent, override parts of it once it has been loaded: however, most users will probably wish to simply load a new telescope model.

Note that the oskar.Telescope class does not need to be used if it is sufficient to use only the oskar.SettingsTree to set up the simulations. (If so, this page can be safely ignored!)

If required, element-level data can be overridden (in memory only) once the telescope model has been loaded using the methods:

The phase centre of the telescope should be set using the set_phase_centre() method.

Examples

To load a telescope model stored in the directory telescope.tm:

>>> tel = oskar.Telescope()
>>> tel.load('telescope.tm')

To create a telescope model using parameters from a oskar.SettingsTree:

>>> settings = oskar.SettingsTree('oskar_sim_interferometer')
>>> # Set up all required parameters here...
>>> params = {
        'telescope': {
            'input_directory': 'telescope.tm'
        }
    }
>>> settings.from_dict(params)
>>> tel = oskar.Telescope(settings=settings)
__init__(precision=None, settings=None)

Creates an OSKAR telescope model.

Parameters:
  • precision (Optional[str]) – Either ‘double’ or ‘single’ to specify the numerical precision of the data. Default ‘double’.
  • settings (Optional[oskar.SettingsTree]) – Optional settings to use to set up the telescope model.
load(dir_name)

Loads an OSKAR telescope model directory.

Note that some telescope model meta-data must have been set prior to calling this method, as it affects how data are loaded.

Specifically, the following methods must be called BEFORE this one:

  • set_pol_mode()
  • set_enable_numerical_patterns()
Parameters:dir_name (str) – Path to telescope model directory to load.
override_element_cable_length_errors(std, seed=1, mean=0.0, feed=0)

Overrides element cable length errors for all stations.

Parameters:
  • std (float) – Standard deviation of element cable length error, in metres.
  • seed (Optional[int]) – Random generator seed. Default 1.
  • mean (Optional[float]) – Mean element cable length error, in metres. Default 0.
  • feed (Optional[int]) – Feed index (0 = X, 1 = Y). Default 0.
override_element_gains(mean, std, seed=1, feed=0)

Overrides element gains for all stations in a telescope model.

Parameters:
  • mean (float) – Mean element gain.
  • std (float) – Standard deviation of element gain.
  • seed (Optional[int]) – Random generator seed. Default 1.
  • feed (Optional[int]) – Feed index (0 = X, 1 = Y). Default 0.
override_element_phases(std_deg, seed=1, feed=0)

Overrides element phases for all stations in a telescope model.

Parameters:
  • std_deg (float) – Standard deviation of element phase, in degrees.
  • seed (Optional[int]) – Random generator seed. Default 1.
  • feed (Optional[int]) – Feed index (0 = X, 1 = Y). Default 0.
set_allow_station_beam_duplication(value)

Sets whether station beams will be copied if stations are identical.

Parameters:value (int) – If true, station beams will be copied if stations are identical.
set_enable_noise(value, seed=1)

Sets whether thermal noise is enabled.

Parameters:
  • value (int) – If true, thermal noise will be added to visibilities.
  • seed (int) – Random number generator seed.
set_enable_numerical_patterns(value)

Sets whether numerical element patterns are enabled.

Parameters:value (int) – If true, numerical element patterns will be loaded.
set_gaussian_station_beam_width(fwhm_deg, ref_freq_hz)

Sets the parameters used for stations with Gaussian beams.

Parameters:
  • fwhm_deg (float) – The Gaussian FWHM value, in degrees.
  • ref_freq_hz (float) – The reference frequency at which the FWHM applies, in Hz.
set_noise_freq(start_hz, inc_hz=0.0, num_channels=1)

Sets the frequencies at which noise is defined.

Parameters:
  • start_hz (float) – Start frequency, in Hz.
  • inc_hz (Optional[float]) – Frequency increment, in Hz. Default 0.
  • num_channels (Optional[int]) – Number of channels. Default 1.
set_noise_rms(start, end=None)

Sets the noise RMS range.

Call this only after set_noise_freq().

Parameters:
  • start (float) – Value at first frequency, in Jy.
  • end (Optional[float]) – Value at last frequency, in Jy.
set_phase_centre(ra_deg, dec_deg)

Sets the telescope phase centre coordinates.

Parameters:
  • ra_deg (float) – Right Ascension, in degrees.
  • dec_deg (float) – Declination, in degrees.
set_pol_mode(mode)

Sets the polarisation mode of the telescope.

Parameters:mode (str) – Either ‘Scalar’ or ‘Full’.
set_position(longitude_deg, latitude_deg, altitude_m=0.0)

Sets the reference position of the telescope.

Parameters:
  • longitude_deg (float) – Array centre longitude, in degrees.
  • latitude_deg (float) – Array centre latitude, in degrees.
  • altitude_m (float) – Array centre altitude, in metres.
set_station_coords_enu(longitude_deg, latitude_deg, altitude_m, x, y, z=None, x_err=None, y_err=None, z_err=None)

Sets station coordinates in the East-North-Up (ENU) horizon system.

Parameters:
  • longitude_deg (float) – Array centre longitude, in degrees.
  • latitude_deg (float) – Array centre latitude, in degrees.
  • altitude_m (float) – Array centre altitude, in metres.
  • x (float, array-like) – Station x coordinates, to East, in metres.
  • y (float, array-like) – Station y coordinates, to North, in metres.
  • z (Optional[float, array-like]) – Station z coordinates, to Up, in metres.
  • x_err (Optional[float, array-like]) – Station x coordinate error, in metres.
  • y_err (Optional[float, array-like]) – Station y coordinate error, in metres.
  • z_err (Optional[float, array-like]) – Station z coordinate error, in metres.
set_station_coords_ecef(longitude_deg, latitude_deg, altitude_m, x, y, z, x_err=None, y_err=None, z_err=None)

Sets station coordinates in the Earth-centred-Earth-fixed (ECEF) system.

Parameters:
  • longitude_deg (float) – Array centre longitude, in degrees.
  • latitude_deg (float) – Array centre latitude, in degrees.
  • altitude_m (float) – Array centre altitude, in metres.
  • x (float, array-like) – Station x coordinates, in metres.
  • y (float, array-like) – Station y coordinates, in metres.
  • z (float, array-like) – Station z coordinates, in metres.
  • x_err (Optional[float, array-like]) – Station x coordinate error, in metres.
  • y_err (Optional[float, array-like]) – Station y coordinate error, in metres.
  • z_err (Optional[float, array-like]) – Station z coordinate error, in metres.
set_station_coords_wgs84(longitude_deg, latitude_deg, altitude_m, station_longitudes_deg, station_latitudes_deg, station_altitudes_m=None)

Sets station coordinates in the WGS84 system.

Parameters:
  • longitude_deg (float) – Array centre longitude, in degrees.
  • latitude_deg (float) – Array centre latitude, in degrees.
  • altitude_m (float) – Array centre altitude, in metres.
  • station_longitudes_deg (float, array-like) – Station longitudes, in degrees.
  • station_latitudes_deg (float, array-like) – Station latitudes, in degrees.
  • station_altitudes_m (Optional[float, array-like]) – Station altitudes, in metres.
set_station_type(type_string)

Sets the type of stations within the telescope model.

Parameters:type_string (str) – Station type, either “Array”, “Gaussian” or “Isotropic”. Only the first letter is checked.
identical_stations

Returns true if all stations are identical, false if not.

max_station_depth

Returns the maximum station nesting depth.

max_station_size

Returns the maximum station size.

num_baselines

Returns the number of baselines in the telescope model.

num_stations

Returns the number of stations in the telescope model.