scopesim.effects.spectral_trace_list.SpectralTraceListWheel#

class scopesim.effects.spectral_trace_list.SpectralTraceListWheel(**kwargs)#

Bases: Effect

A Wheel-Effect object for selecting between multiple gratings/grisms.

See SpectralTraceList for the trace file format description.

Parameters:
  • trace_list_names (list) – The list of unique identifiers in the trace filenames

  • filename_format (str) – f-string that directs scopesim to the folder containing the trace files. This can be a !-string if the trace names are shared with other *Wheel effect objects (e.g. a FilterWheel). See examples.

  • current_trace_list (str) – default trace file to use

  • kwargs (key-value pairs) – Addition keywords that are passed to the SpectralTraceList objects See SpectralTraceList docstring

Examples

A simplified YAML file example taken from the OSIRIS instrument package:

alias: INST
name: OSIRIS_LSS

properties:
  decouple_detector_from_sky_headers: True
  grism_names:
    - R300B
    - R500B
    - R1000B
    - R2500V

effects:
  - name: spectral_trace_wheel
    description: grism wheel contining spectral trace geometries
    class: SpectralTraceListWheel
    kwargs:
      current_trace_list: "!OBS.grating_name"
      filename_format: "traces/LSS_{}_TRACE.fits"
      trace_list_names: "!INST.grism_names"

  - name: grating_efficiency
    description: OSIRIS grating efficiency curves, piggybacking on FilterWheel
    class: FilterWheel
    kwargs:
      minimum_throughput: !!float 0.
      filename_format: "gratings/{}.txt"
      current_filter: "!OBS.grating_name"
      filter_names: "!INST.grism_names"
__init__(**kwargs)#

Methods

__init__(**kwargs)

apply_to(obj, **kwargs)

Use apply_to of current trace list.

get_from_meta(item)

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

current_trace_list

data

display_name

include

meta_string

report_plot_include

report_table_include

report_table_rounding

required_keys

table

z_order

apply_to(obj, **kwargs)#

Use apply_to of current trace list.

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