scopesim.effects.spectral_efficiency.SpectralEfficiency#
- class scopesim.effects.spectral_efficiency.SpectralEfficiency(**kwargs)#
Bases:
EffectApplies the grating efficiency (blaze function) for a SpectralTraceList.
Input Data Format#
The efficiency curves are taken from a fits file filename`with a structure similar to the trace definition file (see `SpectralTraceList). The required extensions are: - 0 : PrimaryHDU [header] - 1 : BinTableHDU or TableHDU[header, data] : Overview table of all traces - 2..N : BinTableHDU or TableHDU : Efficiency curves, one per trace. The
tables must have the two columns wavelength and efficiency
Note that there must be one extension for each trace defined in the SpectralTraceList. Extensions for other traces are ignored.
EXT 0 : PrimaryHDU#
Required header keywords:
ECAT : int : Extension number of overview table, normally 1
EDATA : int : Extension number of first Trace table, normally 2
No data is required in this extension
EXT 1 : (Bin)TableHDU : Overview of traces#
No special header keywords are required in this extension.
Required Table columns: - description : str : identifier for each trace - extension_id : int : which extension is each trace in
EXT 2 : (Bin)TableHDU : Efficiencies for individual traces#
Required header keywords: - EXTNAME : must be identical to the description in EXT 1
Required Table columns: - wavelength : float : [um] - efficiency : float : number [0..1]
- __init__(**kwargs)#
Methods
__init__(**kwargs)apply_to(obj, **kwargs)Interface between FieldOfView and SpectralEfficiency.
Read effciencies from file, returns a dictionary.
get_from_meta(item)info()Print basic information on the effect, notably the description.
plot()Plot the grating efficiencies.
report([filename, output, rst_title_chars])For Effect objects, generates a report based on the data and meta-data.
Attributes
datadisplay_nameincludemeta_stringrequired_keystablez_order- apply_to(obj, **kwargs)#
Interface between FieldOfView and SpectralEfficiency.
- get_efficiencies()#
Read effciencies from file, returns a dictionary.
- plot()#
Plot the grating efficiencies.
- 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