ska_sdp_instrumental_calibration.data_managers.sky_model.local_sky_model module

class ska_sdp_instrumental_calibration.data_managers.sky_model.local_sky_model.LocalSkyModel(components, solution_time)[source]

Bases: object

A class representing a local sky model composed of various sky components.

This class manages a collection of sky components and handles the generation of predicted visibilities based on these components for specific observation parameters.

Parameters:
  • components (list[Component]) -- A list of component objects representing the sources in the sky model.

  • solution_time (float) -- The solution time associated with this sky model. This typically represents the timestamp or interval for which the model is valid.

components

The list of sky components managed by this model.

Type:

list[Component]

soln_time

The specific time instance for which this model is valid.

Type:

float

create_vis(uvw, frequency, polarisation, phasecentre, antenna1, antenna2, beams_factory=None, station_rm=None, output_dtype=<class 'numpy.complex64'>)[source]

Calculate predicted visibilities for all components in the sky model.

This method iterates through the model's components, calculates the visibility contribution of each, and sums them to produce the total predicted visibility for the specified baseline configuration and frequency channels. It optionally applies beam attenuation and Faraday rotation if provided.

Parameters:
  • uvw (numpy.ndarray) -- The UVW coordinates of the baselines. Shape is typically (n_times, n_baselines, 3).

  • frequency (numpy.ndarray) -- The frequency channels for the simulation in Hz. Shape: (n_channels,).

  • polarisation (numpy.ndarray) -- The polarisation frames (e.g., Stokes I, Q, U, V or linear XX, XY). Shape: (n_pols,).

  • phasecentre (SkyCoord or object) -- The phase centre of the observation direction.

  • antenna1 (numpy.ndarray) -- Indices of the first antenna in the baseline pairs. Shape matches the baseline dimension of uvw.

  • antenna2 (numpy.ndarray) -- Indices of the second antenna in the baseline pairs. Shape matches the baseline dimension of uvw.

  • beams_factory (BeamsFactory, optional) -- A factory object capable of generating beam models. If provided, get_beams_low will be called to apply beam effects. Default is None.

  • station_rm (numpy.ndarray, optional) -- Rotation measure values for the stations to apply Faraday rotation. If None, no Faraday rotation is applied. Default is None.

  • output_dtype (data-type, optional) -- The data type of the output visibility array. Default is np.complex64.

Returns:

The total predicted visibilities summing contributions from all components. Shape: (n_times, n_baselines, n_channels, n_pols).

Return type:

numpy.ndarray

Notes

The method dynamically creates LocalSkyComponent instances for each component in self.components and aggregates their create_vis outputs.

class ska_sdp_instrumental_calibration.data_managers.sky_model.local_sky_model.GlobalSkyModel(phasecentre, fov=10.0, flux_limit=1.0, alpha0=-0.78, gleamfile=None, lsm_csv_path=None)[source]

Bases: object

A class representing a Global Sky Model (GSM).

This class manages the initialization of sky components from various catalogues (e.g., GLEAM or local CSV files) and provides functionality to generate local sky models for specific observation times and array locations.

Parameters:
  • phasecentre (SkyCoord) -- The phase centre of the observation, used as the reference point for the field of view search

  • fov (float, default: 10.0) -- The field of view diameter in degrees

  • flux_limit (float, default: 1.0) -- The minimum flux density threshold in Jy. Sources below this limit are excluded

  • alpha0 (float, default: -0.78) -- The default spectral index to use if not specified in the catalogue

  • gleamfile (str, default: None) -- Path to the GLEAM catalogue file. If provided, the model is generated from this file

  • lsm_csv_path (str, default: None) -- Path to a CSV file containing sky model components. Used if gleamfile is None

Raises:

RequiredArgumentMissingException -- If neither gleamfile nor lsm_csv_path is provided.

components

The list of sky components loaded into the global model

Type:

list[Component]

export_sky_model_csv(output_csv_path)[source]
get_local_sky_model(solution_time, array_location)[source]

Generate a Local Sky Model for a specific time and location.

Filters the global components to include only those currently visible (above the horizon) for the given array location and time.

Parameters:
  • solution_time (float) -- The time of the observation (e.g., MJD or Unix timestamp) used to calculate source positions.

  • array_location (EarthLocation) -- The geographical location of the telescope array.

Return type:

LocalSkyModel

Returns:

A new object containing only the visible components for the specified parameters.