scopesim.effects.apertures.ApertureMask#

class scopesim.effects.apertures.ApertureMask(**kwargs)#

Bases: Effect

Only provides the on-sky window coords of the Aperture.

  • Case: Imaging
    • Covers the whole FOV of the detector

    • Round (with mask), square (without mask)

  • CaseLS Spec
    • Covers the slit FOV

    • Polygonal (with mask), square (without mask)

  • CaseIFU Spec
    • Covers the on-sky FOV of one slice of the IFU

    • Square (without mask)

  • CaseMOS Spec
    • Covers a single MOS fibre FOV

    • Round, Polygonal (with mask), square (without mask)

The geometry of an ApertureMask can be initialised with the standard DataContainer methods (see Parameters below). Regardless of which method is used, the following columns must be present:

x       y
arcsec  arcsec
float   float

Certain keywords need to also be included in the ascii header:

# id: <int>
# conserve_image: <bool>
# x_unit: <str>
# y_unit: <str>

If conserve_image is False, the flux from all sources in the aperture is summed and distributed uniformly over the aperture area.

Parameters:
  • filename (str) – Path to ASCII file containing the columns listed above

  • table (astropy.Table) – An astropy Table containing the columns listed above

  • array_dict (dict) – A dictionary containing the columns listed above: {x: [...], y: [...], id: <int>, conserve_image: <bool>}

  • pixel_scale (float) – [arcsec] Defaults to "!INST.pixel_scale" from the config

  • id (int) – An integer to identify the ApertureMask in a list of apertures

__init__(**kwargs)#

Methods

__init__(**kwargs)

apply_to(obj, **kwargs)

See parent docstring.

fov_grid([which])

Return a header with the sky coordinates.

get_from_meta(item)

get_header()

get_mask()

For placing over FOVs if the Aperture is rotated w.r.t.

info()

Print basic information on the effect, notably the description.

plot([axes])

report([filename, output, rst_title_chars])

For Effect objects, generates a report based on the data and meta-data.

Attributes

data

display_name

hdu

header

include

mask

meta_string

report_plot_include

report_table_include

report_table_rounding

required_keys

table

z_order

apply_to(obj, **kwargs)#

See parent docstring.

fov_grid(which='edges', **kwargs)#

Return a header with the sky coordinates.

get_mask()#

For placing over FOVs if the Aperture is rotated w.r.t. the field.

info() None#

Print basic information on the effect, notably the description.

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:

str

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