Camera

class specsim.camera.Camera(name, wavelength, throughput, row_size, fwhm_resolution, neff_spatial, read_noise, dark_current, gain, num_sigmas_clip, output_pixel_size, allow_convolution=True)[source] [edit on github]

Bases: object

Model the response of a single fiber spectrograph camera.

No camera attributes can be changed after an instrument has been created. File a github issue if you would like to change this.

Parameters:
namestr

A brief descriptive name for this camera. Typically a single letter indicating the wavelength band covered by this camera.

wavelengthastropy.units.Quantity

Array of wavelength bin centers where the instrument response is calculated, with units. Must be equally spaced.

throughputnumpy.ndarray

Array of throughput values tabulated at each wavelength bin center.

row_sizeastropy.units.Quantity

Array of row size values tabulated at each wavelength bin center. Units are required, e.g. Angstrom / pixel.

fwhm_resolutionastropy.units.Quantity

Array of wavelength resolution FWHM values tabulated at each wavelength bin center. Units are required, e.g., Angstrom.

neff_spatialastropy.units.Quantity

Array of effective trace sizes in the spatial (fiber) direction tabulated at each wavelength bin center. Units are required, e.g. pixel.

read_noiseastropy.units.Quantity

Camera noise per readout operation. Units are required, e.g. electron.

dark_currentastropy.units.Quantity

Nominal mean dark current from sensor. Units are required, e.g. electron / hour.

gainastropy.units.Quantity

CCD amplifier gain. Units are required, e.g., electron / adu. (This is really 1/gain).

num_sigmas_clipfloat

Number of sigmas where the resolution should be clipped when building a sparse resolution matrix.

output_pixel_sizeastropy.units.Quantity

Size of output pixels for this camera. Units are required, e.g. Angstrom. Must be a multiple of the the spacing of the wavelength input parameter.

allow_convolutionbool

Set True to precompute the sparse resolution matrix needed by get_output_resolution_matrix(), apply_resolution() and downsample().

Attributes Summary

neff_spatial

Array of effective pixel dimensions in the spatial (fiber) direction.

output_pixel_size

Size of output pixels.

output_wavelength

Output pixel central wavelengths.

rms_resolution

Array of RMS resolution values.

row_size

Array of row sizes in the dispersion direction.

wavelength_max

Maximum wavelength covered by this camera's CCD.

wavelength_min

Minimum wavelength covered by this camera's CCD.

Methods Summary

apply_resolution(flux)

Input should be on the simulation wavelength grid.

downsample(data[, method])

Downsample data tabulated on the simulation grid to output pixels.

get_output_resolution_matrix()

Return the output resolution matrix in DIA sparse format.

Attributes Documentation

neff_spatial

Array of effective pixel dimensions in the spatial (fiber) direction.

output_pixel_size

Size of output pixels.

Must be a multiple of the simulation wavelength grid.

output_wavelength

Output pixel central wavelengths.

rms_resolution

Array of RMS resolution values.

row_size

Array of row sizes in the dispersion direction.

wavelength_max

Maximum wavelength covered by this camera’s CCD.

wavelength_min

Minimum wavelength covered by this camera’s CCD.

Methods Documentation

apply_resolution(flux)[source] [edit on github]

Input should be on the simulation wavelength grid.

Any throughput should already be applied.

downsample(data, method=<function sum>)[source] [edit on github]

Downsample data tabulated on the simulation grid to output pixels.

get_output_resolution_matrix()[source] [edit on github]

Return the output resolution matrix in DIA sparse format.

The output resolution is calculated by summing output pixel blocks of the full resolution matrix. This is equivalent to the convolution of our resolution with a boxcar representing an output pixel. Edge effects are not handled very gracefully in order to return a square matrix.

The memory required for this operation scales with the number of non-zero elements in the returned matrix. This matrix is not used internally and is re-calcuated each time this method is called.

Returns:
scipy.sparse.dia_matrix

Square array of resolution matrix elements in the DIA sparse format.