scopesim.optics.optics_manager.OpticsManager#

class scopesim.optics.optics_manager.OpticsManager(yaml_dicts=None, cmds=None, **kwargs)#

Bases: object

The workhorse class for dealing with all externally defined Effect objects.

Parameters:
  • yaml_dicts (list of dict) – The nested dicts describing the Effects from the relevant YAML files, which include effects and properties sub-dictionaries

  • kwargs (expanded dict) – Any extra information not directly related to the optical elements

__init__(yaml_dicts=None, cmds=None, **kwargs)#

Methods

__init__([yaml_dicts, cmds])

add_effect(effect[, ext])

Add an Effect object to an OpticalElement at index ext.

get_all(class_type)

Return list of all effects from all optical elements with class_type.

get_z_order_effects(z_level)

Return a list of all effects with a z_order keywords within z_level.

list_effects()

load_effects(yaml_dicts, **kwargs)

Generate an OpticalElement for each section of the Optical System.

pretty_str()

Return formatted string representation as str.

report([filename, output, rst_title_chars])

set_derived_parameters()

system_transmission([plot])

Compute system transmission

update(**obs_dict)

Update the meta dictionary with keyword-value pairs.

write_string(stream)

Write formatted string representation to I/O stream.

Attributes

all_effects

Get all effects in all optical elements.

area

detector_array_effects

Get effects with z_order = 900...999.

detector_effects

Get effects with z_order = 800...899.

detector_setup_effects

Get effects with z_order = 400...499 (DetectorLists only!).

display_name

Return name or filename or placeholder.

fits_header_effects

Get effects with z_order = 1000...1099.

fov_effects

Get effects with z_order = 600...699.

fov_setup_effects

Get effects with z_order = 200...299.

image_plane_effects

Get effects with z_order = 700...799.

image_plane_headers

Get headers from detector setup effects.

image_plane_setup_effects

Get effects with z_order = 300...399.

is_spectroscope

Return True if any of the effects is a spectroscope.

source_effects

Get effects with z_order = 500...599.

add_effect(effect, ext=0) None#

Add an Effect object to an OpticalElement at index ext.

Parameters:
  • effect (Effect) – Effect object to be added

  • ext (int) – Index number of the desired OpticalElement, contained in the list self.optical_elements

property all_effects: list[Effect]#

Get all effects in all optical elements.

property detector_array_effects: list[Effect]#

Get effects with z_order = 900…999.

property detector_effects: list[Effect]#

Get effects with z_order = 800…899.

property detector_setup_effects: list[Effect]#

Get effects with z_order = 400…499 (DetectorLists only!).

property display_name: str#

Return name or filename or placeholder.

property fits_header_effects: list[Effect]#

Get effects with z_order = 1000…1099.

property fov_effects: list[Effect]#

Get effects with z_order = 600…699.

property fov_setup_effects: list[Effect]#

Get effects with z_order = 200…299.

get_all(class_type) list[Effect]#

Return list of all effects from all optical elements with class_type.

Parameters:

class_type (class object) – The class to be searched for. Must be an class object with base-class Effect

Returns:

effects

Return type:

list of Effect objects

get_z_order_effects(z_level: int) list[Effect]#

Return a list of all effects with a z_order keywords within z_level.

Effect z_order values are classified according to the following:

  • Make a FOV list - z_order = 0..99

  • Make a image plane - z_order = 100..199

  • Apply Source altering effects - z_order = 200..299

  • Apply FOV specific (3D) effects - z_order = 300..399

  • Apply FOV-independent (2D) effects - z_order = 400..499

  • Apply XXX effects - z_order = 500..599

  • Apply XXX effects - z_order = 600..699

  • Apply lambda-independent 2D image plane effects - z_order = 700..799

  • Apply detector effects - z_order = 800..899

  • Apply detector array effects - z_order = 900..999

  • Apply FITS header effects - z_order = 1000…1100

Parameters:

z_level ({0, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000}) – 100-range of z_orders.

Returns:

effects

Return type:

list of Effect objects

property image_plane_effects: list[Effect]#

Get effects with z_order = 700…799.

property image_plane_headers#

Get headers from detector setup effects.

property image_plane_setup_effects: list[Effect]#

Get effects with z_order = 300…399.

property is_spectroscope: bool#

Return True if any of the effects is a spectroscope.

load_effects(yaml_dicts, **kwargs) None#

Generate an OpticalElement for each section of the Optical System.

Make an OpticalElement for each YAML document in the system. For example there should be a YAML document for each of the following:

  • Atmosphere

  • Telescope

  • Relay optics

  • Instrument

  • Detector

The YAML files can each be separate .yaml files, or be contained in a single .yaml file separated by a yaml-document-separator: `` n — n ``.

Parameters:

yaml_dicts (list of dicts) – Each YAML dict should contain the descriptions of the Effects needed by each OpticalElement.

pretty_str() str#

Return formatted string representation as str.

property source_effects: list[Effect]#

Get effects with z_order = 500…599.

system_transmission(plot=False)#

Compute system transmission

The method computes the total system transmission and returns it as a synphot.spectrum.SpectralElement.

When plot is True, it creates a plot of the transmission curves of the indivdual elements in the system as well as the system transmission.

update(**obs_dict) None#

Update the meta dictionary with keyword-value pairs.

Parameters:

obs_dict (expanded dict) – Keyword-Value pairs to be added to self.meta

write_string(stream: TextIO) None#

Write formatted string representation to I/O stream.