scopesim.effects.apertures.ApertureList#
- class scopesim.effects.apertures.ApertureList(**kwargs)#
Bases:
EffectA list of apertures, useful for IFU or MOS instruments.
Examples
File format#
Much like an ApertureMask, an ApertureList can be initialised by either of the three standard DataContainer methods. The easiest is however to make an ASCII file with the following columns:
id left right top bottom angle conserve_image shape arcsec arcsec arcsec arcsec deg int float float float float float bool str/int
Acceptable
shapeentries are:round,rect,hex,oct, or an integer describing the number of corners the polygon should have.A polygonal mask is generated for a given
shapeand will be scaled to fit inside the edges of each aperture list row. The corners of each aperture defined by shape are found by finding equidistant positions around an ellipse constrained by the edges (left, …, etc). An additional optional columnoffsetmay be added. This column describes the offset from 0 deg to the angle where the first corner is set.Additionally, the filename of an
ApertureMaskpolygon file can be given. The geometry of the polygon defined in the file will be scaled to fit inside the edges of the row.Note
shapevalues"rect"and4do not produce equal resultsBoth use 4 equidistant points around an ellipse constrained by [
left, …, etc]. However"rect"aims to fill the contraining area, while4simply uses 4 points on the ellipse. Consequently,4results in a diamond shaped mask covering only half of the constraining area filled by"rect".- __init__(**kwargs)#
Methods
__init__(**kwargs)apply_to(obj, **kwargs)See parent docstring.
get_apertures(row_ids)get_from_meta(item)info()Print basic information on the effect, notably the description.
plot()plot_masks()report([filename, output, rst_title_chars])For Effect objects, generates a report based on the data and meta-data.
Attributes
aperturesdatadisplay_nameincludemeta_stringreport_plot_includereport_table_includereport_table_roundingrequired_keystablez_order- apply_to(obj, **kwargs)#
See parent docstring.
- 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