scopesim.effects.ter_curves.AtmoLibraryTERCurve#
- class scopesim.effects.ter_curves.AtmoLibraryTERCurve(cmds=None, **kwargs)#
Bases:
AtmosphericTERCurveRetrieve an atmospheric spectrum from a library file.
A local file is used if the kwargs include the parameter filename. To use a remote file, a url and a hash (to ensure that the file is the correct one) need to be specified.
The library file is a multi-extension FITS file with the following structure:
- extension 1
Catalogue - a table listing all extensions and parameters to identify the one to use.
- extension 2
Wavelength - the common wavelength grid on which all atmospheric spectra are sampled.
- extension 3 etc.
Tables with columns transmission and emission.
Currently the curves are distinguished by a single parameter (pwv).
Added in version 0.11.1.
Examples
- name: atmosphere class: AtmoLibraryTERCurve kwargs: filename: "!ATMO.spectrum.filename pwv: 10. - name: atmosphere class: AtmoLibraryTERCurve kwargs: pwv: 25. remote_filename: "!ATMO.spectrum.filename"
The location of a downloaded file is provided by .meta[‘filename’].
- __init__(cmds=None, **kwargs)#
Methods
__init__([cmds])apply_to(obj, **kwargs)Apply the effect to the corresponding object.
get_from_meta(item)info()Print basic information on the effect, notably the description.
Load the appropriate library extension based on parameter value.
plot([which, wavelength, axes])Plot TER curves.
report([filename, output, rst_title_chars])For Effect objects, generates a report based on the data and meta-data.
update(**kwargs)Update the atmo library.
Attributes
background_sourcedatadisplay_nameemissionincludemeta_stringreport_plot_includereport_table_includerequired_keystablethroughputz_order- apply_to(obj, **kwargs)#
Apply the effect to the corresponding object.
- load_table_from_library()#
Load the appropriate library extension based on parameter value.
- plot(which='x', wavelength=None, *, axes=None, **kwargs)#
Plot TER curves.
- Parameters:
which ({"x", "t", "e", "r"}, optional) – “x” plots throughput. “t”,”e”,”r” plot trans/emission/refl. Can be a combination, e.g. “tr” or “tex” to plot each.
wavelength (array_like, optional) – Wavelength on x-axis, taken from currsys if None (default).
axes (matplotlib axes, optional) – If given, plot into existing axes. The default is None.
- Returns:
fig – Figure containing plots.
- Return type:
matplotlib figure
- report(filename=None, output='rst', rst_title_chars='*+', **kwargs)#
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:
filename (str, optional) – Where to save the RST file
output (str, optional) – [“rst”, “latex”] Output file format
rst_title_chars (2-str, optional) – Two unique characters used to denote rst subsection headings. Options: = - ` : ‘ “ ~ ^ _ * + # < >
parameters (Additional)
---------------------
**kwargs (Either from the self.meta["report"] dictionary or via)
"report_table_include" (False)
"report_table_caption"
"report_plot_caption"
"report_plot_include" (False)
"report_plot_file_formats" (["png"]) – Multiple formats can be saved. The last entry is used for the RST.
"report_plot_filename" (None) – If None, uses self.meta[“name”] as the filename
"file_description" (str) – Taken from the header of a file, if available
"class_description" (str) – Taken from the docstring of the subclass
"changes_str" (list of str) – Take from the header of a file, if available
- Returns:
rst_str – The full reStructureText string
- Return type:
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
- update(**kwargs)#
Update the atmo library.