scopesim.effects.mosaic_trace_list.MosaicSpectralTraceList#

class scopesim.effects.mosaic_trace_list.MosaicSpectralTraceList(**kwargs)#

Bases: SpectralTraceList

SpectralTraceList for MOSAIC.

Added in version 0.11.0.

__init__(**kwargs)#

Methods

__init__(**kwargs)

apply_to(obj, **kwargs)

See parent docstring.

get_from_meta(item)

info()

Print basic information on the effect, notably the description.

make_spectral_traces()

Return a dictionary of spectral traces read in from a file.

plot([wave_min, wave_max, axes])

Plot every spectral trace in the spectral trace list.

rectify_cube(hdulist)

Rectify traces and combine into a cube.

rectify_traces(hdulist[, xi_min, xi_max, ...])

Create rectified 2D spectra for all traces in the list.

report([filename, output, rst_title_chars])

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

update_meta()

Update fov related meta values.

Attributes

data

display_name

footprint

Return the footprint of the entire SpectralTraceList.

image_plane_header

Create and return header for the ImagePlane.

include

meta_string

report_plot_include

report_table_include

required_keys

table

z_order

apply_to(obj, **kwargs)#

See parent docstring.

property footprint#

Return the footprint of the entire SpectralTraceList.

property image_plane_header#

Create and return header for the ImagePlane.

info() None#

Print basic information on the effect, notably the description.

make_spectral_traces()#

Return a dictionary of spectral traces read in from a file.

plot(wave_min=None, wave_max=None, axes=None, **kwargs)#

Plot every spectral trace in the spectral trace list.

Parameters:
  • wave_min (float, optional) – Minimum wavelength, if any. If None, value from_currsys is used.

  • wave_max (float, optional) – Maximum wavelength, if any. If None, value from_currsys is used.

  • axes (matplotlib axes, optional) – The axes object to use for the plot. If None (default), a new figure with one axes will be created.

  • **kwargs (dict) – Any other parameters passed along to the plot method of the individual spectral traces.

Returns:

fig – DESCRIPTION.

Return type:

matplotlib figure

rectify_cube(hdulist)#

Rectify traces and combine into a cube.

rectify_traces(hdulist, xi_min=None, xi_max=None, interps=None, **kwargs)#

Create rectified 2D spectra for all traces in the list.

This method creates an HDU list with one extension per spectral trace, i.e. it essentially treats all traces independently. For the case of an IFU where the traces correspond to spatial slices for the same wavelength range, use method rectify_cube (not yet implemented).

Parameters:
  • hdulist (str or fits.HDUList) – The result of scopesim readout()

  • xi_min (float [arcsec]) – Spatial limits of the slit on the sky. This should be taken from the header of the hdulist, but this is not yet provided by scopesim. For the time being, these limits must be provided by the user.

  • xi_max (float [arcsec]) – Spatial limits of the slit on the sky. This should be taken from the header of the hdulist, but this is not yet provided by scopesim. For the time being, these limits must be provided by the user.

  • interps (list of interpolation functions) – If provided, there must be one for each image extension in hdulist. The functions go from pixels to the images and can be created with, e.g. RectBivariateSpline.

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
update_meta()#

Update fov related meta values.

The values describe the full extent of the spectral trace volume in wavelength and space