scopesim.effects.ter_curves.TopHatFilterWheel#
- class scopesim.effects.ter_curves.TopHatFilterWheel(**kwargs)#
Bases:
FilterWheelBaseA selection of top-hat filter curves as defined in the input lists.
- Parameters:
filter_names (list of string)
transmissions (list of floats) – [0..1] Peak transmissions inside the cutoff limits
wing_transmissions (list of floats) – [0..1] Wing transmissions outside the cutoff limits
blue_cutoffs (list of floats) – [um]
red_cutoffs (list of floats) – [um]
current_filter (str, optional) – Name of current filter at initialisation. If no name is given, the first entry in filter_names is used by default.
Examples
name: top_hat_filter_wheel class: TopHatFilterWheel kwargs: filter_names: ["J", "H", "K"] transmissions: [0.9, 0.95, 0.85] wing_transmissions: [0., 0., 0.001] blue_cutoffs: [1.15, 1.45, 1.9] red_cutoffs: [1.35, 1.8, 2.4] current_filter: "K"
- __init__(**kwargs)#
Methods
__init__(**kwargs)add_filter(newfilter[, name])Add a filter to the FilterWheel.
apply_to(obj, **kwargs)Use apply_to of current filter.
change_filter([filtername])Change the current filter.
fov_grid([which])get_from_meta(item)get_table()info()Print basic information on the effect, notably the description.
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.
Attributes
current_filterdatadisplay_nameincludemeta_stringreport_plot_includereport_table_includereport_table_roundingrequired_keyssurfacetablethroughputz_order- add_filter(newfilter, name=None)#
Add a filter to the FilterWheel.
- Parameters:
newfilter (FilterCurve)
name (string) – Name to be used for the new filter. If None a name from the newfilter object is used.
- apply_to(obj, **kwargs)#
Use apply_to of current filter.
- change_filter(filtername=None)#
Change the current filter.
- 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) – DESCRIPTION. The default is None.
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