scopesim.effects.detector_list.DetectorWindow#

class scopesim.effects.detector_list.DetectorWindow(pixel_size, x, y, width, height=None, angle=0, gain=1, units='mm', **kwargs)#

Bases: DetectorList

For when a full DetectorList if too cumbersome.

Parameters:
  • pixel_size (float) – [mm pixel-1] Physical pixel size

  • x (float) – [mm] Position of window centre relative to optical axis

  • y (float) – [mm] Position of window centre relative to optical axis

  • width (float) – [mm] Dimensions of window. If height is None, height=width

  • height=None (float) – [mm] Dimensions of window. If height is None, height=width

  • angle (float, optional) – [deg] Rotation of window

  • gain (float, optional) – [ADU/e-]

  • units (str, optional) – [mm, pixel] Default “mm”. Sets the input parameter units. If "pixel", (x, y, width, height) are multiplied by pixel_size

__init__(pixel_size, x, y, width, height=None, angle=0, gain=1, units='mm', **kwargs)#

Methods

__init__(pixel_size, x, y, width[, height, ...])

apply_to(obj, **kwargs)

Apply the effect to the corresponding object.

detector_headers([ids])

Create detector headers from active detectors or given IDs.

fov_grid([which])

Return an ApertureMask object.

get_from_meta(item)

info()

Print basic information on the effect, notably the description.

plot([axes])

Plot the detector layout.

report([filename, output, rst_title_chars])

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

Attributes

active_table

Create and return the active table.

data

dims

display_name

image_plane_header

Create and return the Image Plane Header.

image_plane_id

Get ID of the corresponding image plane.

include

meta_string

pixel_scale_arcsec

Return pixel scale (arcsec / pix) as equivalency.

pixel_scale_mm

Return pixel scale (mm / pix) as equivalency.

pixel_size

Return size of one pixel in mm.

report_plot_include

report_table_include

required_keys

table

z_order

property active_table#

Create and return the active table.

apply_to(obj, **kwargs)#

Apply the effect to the corresponding object.

detector_headers(ids=None)#

Create detector headers from active detectors or given IDs.

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

Return an ApertureMask object. kwargs are “pixel_scale” [arcsec].

property image_plane_header#

Create and return the Image Plane Header.

property image_plane_id: int#

Get ID of the corresponding image plane.

info() None#

Print basic information on the effect, notably the description.

property pixel_scale_arcsec: Equivalency#

Return pixel scale (arcsec / pix) as equivalency.

property pixel_scale_mm: Equivalency#

Return pixel scale (mm / pix) as equivalency.

property pixel_size: Annotated[Quantity, Unit('mm')]#

Return size of one pixel in mm.

plot(axes=None)#

Plot the detector layout.

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