SkyModel

class erwans3.Astro_tools.SkyModel(skymodel=None)

Bases: object

Container for managing a list of SourceModel objects representing a sky model.

Parameters:

skymodel (SkyModel or None, optional) – Another SkyModel object to initialize from.

Source_list

Dictionary to store SourceModel objects keyed by source name.

Type:

dict

Usage
-----

Attributes Summary

nsource

Methods Summary

add_source(sourcemodel)

Add a SourceModel object to the sky model.

clear_model()

Clear all sources from the sky model.

make_simu(freq, time[, observer])

Generates simulation Skymaps of the SkyModel at a given time and frequency.

plot_simu(freq, time, nside[, intensive])

Plot simulations of the SkyModel.

pre_comp([freqs, times, res_max])

Pre-computes values for all sources in the SkyModel.

remove_source(source_name)

Remove a source from the sky model.

sort_priority()

Sorts the sources in the SkyModel based on their priority attribute.

Attributes Documentation

nsource

Methods Documentation

add_source(sourcemodel: SourceModel) None

Add a SourceModel object to the sky model.

Parameters:

sourcemodel (SourceModel) – The SourceModel object to add.

clear_model() None

Clear all sources from the sky model.

make_simu(freq: Quantity, time: Time, observer: Optional[Union[BaseCoordinateFrame, SkyCoord]] = None) tuple['Skymap', 'Skymap']

Generates simulation Skymaps of the SkyModel at a given time and frequency.

Returns two skymaps. The first one has a PixMap map and the second one a SHCoeff map

Parameters:
  • freq (Quantity [Hz]) – Frequency for simulation.

  • time (Time) – Time for simulation.

  • observer (BaseCoordinateFrame or SkyCoord or :obj:`~None, optional) – Observer frame for simulation.

Returns:

A tuple of Skymap objects for pixel and spherical harmonic simulations. The first one has a PixMap map and the second one a SHCoeff map

Return type:

tuple [Skymap, Skymap]

plot_simu(freq: Quantity, time: Time, nside: int, intensive: bool = True, **kwargs)

Plot simulations of the SkyModel.

Runs make_simu() to generate a skymap at a given time and frequency.

Parameters:
  • freq (Quantity [Hz]) – Frequency for simulation.

  • time (Time) – Time for simulation.

  • nside (int) – HEALPix nside parameter for the plots.

  • intensive (bool, optional) – Whether to plot the intensive version (True) or extensive (False).

  • **kwargs – Additional keyword arguments for the plot.

pre_comp(freqs: Optional[Quantity] = None, times: Optional[Time] = None, res_max: Optional[Quantity] = None) None

Pre-computes values for all sources in the SkyModel.

Parameters:
  • freqs (Quantity [Hz] or None, optional) – Frequencies for pre-computation.

  • times (Time or None, optional) – Times for pre-computation.

  • res_max (Quantity [rad] or None, optional) – Maximum resolution for pre-computation.

remove_source(source_name: str) None

Remove a source from the sky model.

Parameters:

source_name (str) – The name of the source to remove.

sort_priority()

Sorts the sources in the SkyModel based on their priority attribute.