Settings#

pydantic model skysim.settings.Settings[source]#

Base class to interpret often-used configuration values. The Settings class should never be used or passed directly, but instead should be created only for the purpose of then calling get_image_settings() and get_plot_settings().

Config:
  • arbitrary_types_allowed: bool = True

  • extra: str = forbid

  • frozen: bool = True

Fields:
Validators:
field altitude_angle [Required]#

Angle of observation (measured from horizon).

Constraints:
  • _unit = rad

  • _physical_type = {‘angle’}

  • _physical_type_list = [‘angle’]

Validated by:
field azimuth_angle [Required]#

Angle of observation (Eastwards from North).

Constraints:
  • _unit = rad

  • _physical_type = {‘angle’}

  • _physical_type_list = [‘angle’]

Validated by:
field duration [Required]#

How long the total observation should last - should be given in concert with snapshot_frequency

Validated by:
field field_of_view [Required]#

Diameter of the area being observed at any time.

Constraints:
  • _unit = rad

  • _physical_type = {‘angle’}

  • _physical_type_list = [‘angle’]

Validated by:
field image_pixels [Required]#

Number of pixels (diameter) for the resulting image.

Constraints:
  • gt = 0

Validated by:
field input_location [Required]#

User-input version of the observing location.

Validated by:
field snapshot_frequency [Required]#

How often an observation should be taken - should be given in concert with duration

Validated by:
field start_date [Required]#

Starting (local) date of observation.

Validated by:
field start_time [Required]#

Starting (local) time of observation.

Validated by:
validator convert_to_deg  »  altitude_angle, field_of_view, azimuth_angle[source]#

Convert angular quantities to degrees.

Parameters:
angularastropy.units.Quantity[angle]

Astropy angular quantity.

Returns:
astropy.units.Quantity[degree]

Input angle in degrees.

validator compare_timespans  »  all fields[source]#

Confirm that the time between snapshots is not greater than the observation duration.

Returns:
Self

Settings object.

Raises:
ValueError

Raised if the snapshot frequency is greater than the duration.

get_image_settings(**kwargs)[source]#

Generate an ImageSettings object inheriting this object’s information.

Parameters:
**kwargs

Dictionary of arguments to be passed to ImageSettings.

Returns:
ImageSettings

Object containing all passed configuration values as well as those from the instantiation of this Settings object.

get_plot_settings(**kwargs)[source]#

Generate an PlotSettings object inheriting this object’s information.

Parameters:
**kwargs

Dictionary of arguments to be passed to PlotSettings.

Returns:
PlotSettings

Object containing all passed configuration values as well as those from the instantiation of this Settings object.

property degrees_per_pixel#

Calculates the number of degrees spanned by each pixel in the resulting image.

Returns:
astropy.units.Quantity[angle]

Degrees per pixel (pixel considered unitless).

property earth_location#

Looks up where on Earth the user requested the observation be taken from.

Returns:
astropy.coordinates.EarthLocation

Astropy representation of location on Earth.

Raises:
NotImplementedError

Raised if location lookup fails.

property frames#

Calculates number of frames for movie/observations to take.

Returns:
pydantic.PositiveInt

Number of frames.

property local_datetimes#

Observation snapshot times as timezone-aware python times.

Returns:
list[datetime.time]

List of observation times.

property observation_radec#

Calculates the observed RA/Dec position for each observation snapshot.

Returns:
astropy.coordinates.SkyCoord

Astropy representation of one or more coordinates.

property observation_times#

Calculates the times at which to take a snapshot.

Returns:
astropy.time.Time

Astropy representation of one or more times.

property timezone#

Look up timezone based on Lat/Long.

Returns:
zoneinfo.ZoneInfo

Timezone information.

Raises:
NotImplementedError

Raised in the case that the lookup fails.

property wcs_objects#

WCS objects for each timestep.

Returns:
list[astropy.wcs.WCS]

WCS objects for each timestep.