scopesim.effects.apertures.SlitWheel#
- class scopesim.effects.apertures.SlitWheel(**kwargs)#
Bases:
EffectSelection of predefined spectroscopic slits and possibly other field masks.
It should contain an open position. A user can define a non-standard slit by directly using the Aperture effect.
- Parameters:
Examples
This Effect assumes a folder full of ASCII files containing the edges of each slit. Each file should be names the same except for the slit’s name or identifier.
This example assumes a folder
maskscontaining the slit ASCII files with the naming convention:slit_A.dat,slit_B.dat, etc.name: slit_wheel class: SlitWheel kwargs: slit_names: - A - B - C filename_format: "masks/slit_{}.dat current_slit: "C"
- __init__(**kwargs)#
Methods
__init__(**kwargs)add_slit(newslit[, name])Add a slit to the SlitWheel.
apply_to(obj, **kwargs)Use apply_to of current_slit.
change_slit([slitname])Change the current slit.
fov_grid([which])See parent docstring.
get_from_meta(item)Create a table of slits with centre position, width and length.
info()Print basic information on the effect, notably the description.
report([filename, output, rst_title_chars])For Effect objects, generates a report based on the data and meta-data.
Attributes
Return the currently used slit.
datadisplay_nameincludemeta_stringreport_plot_includereport_table_includereport_table_roundingrequired_keystablez_order- add_slit(newslit, name=None)#
Add a slit to the SlitWheel.
- Parameters:
newslit (Slit)
name (string) – Name to be used for the new slit. If
None, a name from the newslit object is used.
- apply_to(obj, **kwargs)#
Use apply_to of current_slit.
- change_slit(slitname=None)#
Change the current slit.
- property current_slit#
Return the currently used slit.
- fov_grid(which='edges', **kwargs)#
See parent docstring.
- get_table()#
Create a table of slits with centre position, width and length.
Width is defined as the extension in the y-direction, length in the x-direction. All values are in milliarcsec.
- 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