castor_etc.grism

Grism tool

Classes and methods for grism calculations.

.. caution:: There is another existing grism tool <https://github.com/gnoir0t/ETC_grism>_ for the CASTOR grism. Please refer to that for the latest updates.

Module Contents

Classes

Grism

Grism class.

API

class castor_etc.grism.Grism(TelescopeObj, SourceObj, BackgroundObj)

Grism class.

Initialization

Initialize class for Grism calculations.

_create_segmentation_map()

Internal function.

disperse(grism_channel='u', check=True)

Grism disperser function

source_image 2D array of fluxes. Relative of absolute. Pixel scale needs to be CASTOR pixel scale (no oversampling).

source_disperse_region Boolean 2D array, same size as source_image. Pixels with False will be masked. Pixels with True will be dispersed.

source_spectrum Source spectrum, in flux densities. Source spectrum should be normalized (through spectrum.normalize_spectrum or equivalent), and have same wavelength grid as filter_transmission.

grism_channel Which grism? “uv” or “u”

expose(exposure_time=1000)

Function to simulate a noiseless grism observation for a given integration time.

exposure_time Exposure time in seconds.

_calc_sky_background_erate()

Noise associated with the sky background. This calculation is copy and pasted from calc_snr_or_t function in the photometry class.

Attributes

sky_background_noise :: dict of float
    Sky background noise (electron/s/pixel) associated with each passband name

Returns

None
_calculate_tot_unif_noise(Nreads=1, Nbin=1)

Nreads: total number of read-outs Nbin: the number of detector pixels binned to one read-out pixel when on-chip binning is used. add_bkgrd_noise: additionnal noise, eg, HST: the background added using the post-flash option in e− pixel-1 total_unif_noise is per pixel

total_noise(Nreads=1, Nbin=1)

Function to generate the total noise of a grism observation for a given integration time.

Nreads: total number of read-outs (int).

Nbin: the number of detector pixels binned to one read-out pixel when on-chip binning is used (int).

show_2d_snr_per_resolution()
show_1d_snr_per_resolution()