scopesim.effects.effects module

Contains base class for effects.

class scopesim.effects.effects.Effect(filename=None, **kwargs)[source]

Bases: DataContainer

Base class for representing the effects (artifacts) in an optical system.

The Effect class is conceived to independently apply the changes that an optical component (or series thereof) has on an incoming 3D description of an on-sky object. In other words, an Effect object should receive a derivative of a ``Source`` object, alter it somehow, and return it.

The interface for the Effect base-class has been kept very general so that it can easily be sub-classed as data for new effects becomes available. Essentially, a sub-classed Effects object must only contain the following attributes:

  • self.meta - a dictionary to contain metadata.

  • self.apply_to(obj, **kwargs) - a method which accepts a Source-derivative and returns an instance of the same class as obj

  • self.fov_grid(which="", **kwargs)

Parameters:
See :class:`DataContainer` for input parameters
apply_to(obj, **kwargs)[source]

TBA.

property display_name
fov_grid(which='', **kwargs)[source]

Return the edges needed to generate FieldOfViews for an observation.

Parameters:
whichstr

[“waveset”, “edges”, “shifts”] where: * waveset - wavelength bin extremes * edges - on sky coordinate edges for each FOV box * shifts - wavelength dependent FOV position offsets

Returns:
wavesetlist

[um] N+1 wavelengths that set edges of N spectral bins

edgeslist of lists

[arcsec] Contains a list of footprint lists

shiftslist of 3 lists

[wave, dx, dy] Contains lists corresponding to the (dx, dy) offset from the optical axis (0, 0) induced for each wavelength in (wave) [um, arcsec, arcsec]

property include
info()[source]

Print basic information on the effect, notably the description.

property meta_string
report(filename=None, output='rst', rst_title_chars='*+', **kwargs)[source]

For Effect objects, generates a report based on the data and meta-data.

This is to aid in the automation of the documentation process of the instrument packages in the IRDB.

Note

If the Effect can generate a plot, this will be saved to disc

Parameters:
filenamestr, optional

Where to save the RST file

outputstr, optional

[“rst”, “latex”] Output file format

rst_title_chars2-str, optional

Two unique characters used to denote rst subsection headings. Options: = - ` : ‘ “ ~ ^ _ * + # < >

Returns:
rst_strstr

The full reStructureText string

Notes

The format of the RST output is as follows:

<ClassType>: <effect name>
**************************
File Description: <description for file meta data>
Class Description: <description from class docstring>
Changes: <list of changes from file meta data>

Data
++++
.. figure:: <Figure_name>.png
    If the <Effect> object contains a ``.plot()`` function, add
    plot and write it to disc
Figure caption

Table caption
Table
    If the <Effect> object contains a ``.table()`` function, add
    a pprint version of the table

Meta-data
+++++++++
::
    A code block print out of the ``.meta`` dictionary
required_keys = {}
update(**kwargs)[source]