scopesim.optics.optical_element module

class scopesim.optics.optical_element.OpticalElement(yaml_dict=None, cmds=None, **kwargs)[source]

Bases: object

Contains all information to describe a section of an optical system.

There are 5 major section: location, telescope, relay optics instrument, detector.

An OpticalElement describes how a certain section of the optical train changes the incoming photon distribution by specifying a list of Effects along with a set of local properties e.g. temperature, etc which are common to more than one Effect

Parameters:
yaml_dictdict

Description of optical section properties, effects, and meta-data

kwargsdict

Optical Element specific information which has no connection to the effects that are passed. Any global values, e.g. airmass (i.e. bang strings) are passed on to the individual effect which can extract the relevant bang_string from the UserCommands object held in self.cmds

Attributes:
metadict

Contains meta data from the yaml, and is updated with the OBS_DICT key-value pairs

propertiesdict

Contains any properties that is “global” to the optical element, e.g. instrument temperature, atmospheric pressure. Any OBS_DICT keywords are cleaned with from the meta dict during initialisation

effectslist of dicts

Contains the a list of dict descriptions of the effects that the optical element generates. Any OBS_DICT keywords are cleaned with from the meta dict during initialisation.

add_effect(effect)[source]
property display_name
get_all(effect_class)[source]
get_z_order_effects(z_level: int, z_max: int = None)[source]

Yield all effects in the given 100-range of z_level.

E.g., z_level=200 will yield all effect with a z_order between 200 and 299. Optionally, the upper limit can be set manually with the optional argument z_max.

Parameters:
z_levelint

100-range of z_orders.

z_maxint, optional

Optional upper bound. This is currently not used anywhere in ScopeSim, but the functionality is tested. If None (default), this will be set to z_level + 99.

Yields:
effIterator of effects

Iterator containing all effect objects in the given z_order range.

Raises:
TypeError

Raised if either z_level or z_max is not of int type.

ValueError

Raised if z_max (if given) is less than z_level.

list_effects()[source]
property masks_list
pretty_str() str[source]

Return formatted string representation as str.

property properties_str
report(filename=None, output='rst', rst_title_chars='^#*+', **kwargs)[source]
property surfaces_list
write_string(stream: TextIO, list_effects: bool = True) None[source]

Write formatted string representation to I/O stream.