synospec.etc.optical module

Module with the optical model interpolation class.


License

Copyright © 2020, Kyle B. Westfall


class synospec.etc.optical.OpticalModelInterpolator(xf, yf, wave, xc, yc, vignette)[source]

Bases: object

Class used to interpolate between the focal plane and the detector positions based on an archived result from a run of an optical model (e.g., using Zemax).

The arguments of the instantiation should be the known values from the optical model used to setup the interpolation object.

Parameters
  • xf (numpy.ndarray) – On-sky focal-plane position in arcseconds, along the spatial axis, of the incoming rays relative to the field center.

  • yf (numpy.ndarray) – On-sky focal-plane position in arcseconds, along the dispersive axis, of the incoming rays relative to the field center.

  • wave (numpy.ndarray) – Wavelength of the incoming rays in angstroms.

  • xc (numpy.ndarray) – The camera field position in mm along the spatial axis relative to the field center where the incoming rays land.

  • yc (numpy.ndarray) – The camera field position in mm along the dispersive axis relative to the field center where the incoming rays land.

  • vignette (numpy.ndarray) – The vignetting of the incoming rays as a fraction of the rays that make it to the designated position. The vignetting is important because it sets if the interpolation should be masked in specific regions of the grid space. If the vignetting is 0., the output is masked.

field

Field information of the input grid: the x and y positions and wavelengths.

Type

numpy.ndarray

camera

Camera information of the input grid: the x and y positions and vignetting.

Type

numpy.ndarray

field2camera(x, y, wave)[source]

Use the interpolator to propagate field points to the camera focal plane.

Parameters
  • x (numpy.ndarray) – On-sky focal-plane position in arcseconds, along the spatial axis, of the incoming rays relative to the field center.

  • y (numpy.ndarray) – On-sky focal-plane position in arcseconds, along the dispersive axis, of the incoming rays relative to the field center.

  • wave (numpy.ndarray) – Wavelength of the incoming rays in angstroms.

Returns

Returns four numpy.ndarray objects with the camera focal-plane coordinates, vignetting, and a bad-calculation mask.

Return type

tuple

project_2d_spectrum(spec, platescale, linear_dispersion, pixelsize, wave0, field_coo=None)[source]

Project a 2D spectrum from the field onto the detector.

shape of spec should be (nspec,nspat)

TODO: Allow field_coo to be a 2D array for multiple field positions?

Parameters
  • pixelsize (float) – Pixel size in mm.

  • field_coo (array-like) – Field coordinates for the center of the entrance aperture in arcseconds relative to the field center.

Returns

Returns the 2D spectrum projected from the field to the detector, the first pixel for the first axis of the image (spectral) and the first pixel for the second axis of the image (spatial)

Return type

tuple