scopesim.effects.detector_list.DetectorList#
- class scopesim.effects.detector_list.DetectorList(**kwargs)#
Bases:
EffectA description of detector positions and properties.
The list of detectors must have the following table columns
id x_cen y_cen x_size y_size pixel_size angle gain
where:
“id” is a reference id for the chip (fits header EXTNAME)
“x_cen” and “y_cen” [mm] are the physical coordinates of centre of the chip on the detector plane
“x_size”, “y_size” [mm, pixel] are the width/height of the chip
“pixel_size” [mm] is the physical size of pixels in the detector
“angle” [deg] is the rotation of the detector relative to the x-axis
“gain” [e-/ADU] is the conversion factor for electrons (photons) to ADUs
The units for each column (except
id) must be given in the meta data using the format<colname>_unit. E.g.x_size_unit. See examples below.Note
Currently only the units specified below are accepted.
For
x(y)_size_unit, acceptable units aremm,pixel- Parameters:
Examples
With the
array_dictfeature- name: single_detector class: DetectorList kwargs: image_plane_id : 0 array_dict: id: [1] x_cen: [0.] y_cen: [0.] x_size: [5.12] y_size: [5.12] pixel_size: [0.01] angle: [0.] gain: [1.0] x_cen_unit: mm y_cen_unit: mm x_size_unit: mm y_size_unit: mm pixel_size_unit: mm angle_unit: deg gain_unit: electron/adu
Or referring to a table contained in a seperate ASCII file
- name : full_detector_array class : DetectorList kwargs : filename : "detector_list.dat" active_detectors : [1, 3] image_plane_id : 0where the file detector_list.dat contains the following information
# x_cen_unit : mm # y_cen_unit : mm # x_size_unit : pix # y_size_unit : pix # pixel_size_unit : mm # angle_unit : deg # gain_unit : electron/adu # id x_cen y_cen x_size y_size pixel_size angle gain 1 -63.94 0.00 4096 4096 0.015 0.0 1.0 2 0.00 0.00 4096 4096 0.015 90.0 1.0 3 63.94 0.00 4096 4096 0.015 180.0 1.0
- __init__(**kwargs)#
Methods
__init__(**kwargs)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
Create and return the active table.
datadimsdisplay_nameCreate and return the Image Plane Header.
Get ID of the corresponding image plane.
includemeta_stringReturn pixel scale (arcsec / pix) as equivalency.
Return pixel scale (mm / pix) as equivalency.
Return size of one pixel in mm.
report_plot_includereport_table_includerequired_keystablez_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 pixel_scale_arcsec: Equivalency#
Return pixel scale (arcsec / pix) as equivalency.
- property pixel_scale_mm: Equivalency#
Return pixel scale (mm / pix) as equivalency.
- 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:
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