scopesim.optics.optics_manager module

class scopesim.optics.optics_manager.OpticsManager(yaml_dicts=[], **kwargs)[source]

Bases: object

The workhorse class for dealing with all externally defined Effect objects

Parameters:
yaml_dictslist of dict

The nested dicts describing the Effects from the relevant YAML files, which include effects and properties sub-dictionaries

kwargsexpanded dict

Any extra information not directly related to the optical elements

add_effect(effect, ext=0)[source]

Add an Effect object to an OpticalElement at index ext

Parameters:
effectEffect

Effect object to be added

extint

Index number of the desired OpticalElement, contained in the list self.optical_elements

property all_effects
property area
property detector_array_effects
property detector_effects
property detector_setup_effects
property fov_effects
property fov_setup_effects
get_all(class_type)[source]

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

Parameters:
class_typeclass object

The class to be searched for. Must be an class object with base-class Effect

Returns:
effectslist of Effect objects
get_z_order_effects(z_level)[source]

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

Parameters:
z_levelint, tuple

[0, 100, 200, 300, 400, 500]

Returns:
effectslist of Effect objects
property image_plane_effects
property image_plane_headers
property image_plane_setup_effects
property is_spectroscope
list_effects()[source]
load_effects(yaml_dicts, **kwargs)[source]

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: ``

``.

Parameters:
yaml_dictslist of dicts

Each YAML dict should contain the descriptions of the Effects needed by each OpticalElement

report(filename=None, output='rst', rst_title_chars='_^#*+', **kwargs)[source]
set_derived_parameters()[source]
property source_effects
property surfaces_table
property system_transmission
update(**obs_dict)[source]

Update the meta dictionary with keyword-value pairs

Parameters:
obs_dictexpanded dict

Keyword-Value pairs to be added to self.meta