GratingSpectrum#

class pygrating.pygrating.GratingSpectrum(image, YPIX, YPIX_bkg, xpix=None, cross_disp_buffer=25)#

Class to get spectrum from UVIT Grating image

calculate_xpix(plot=False)#

Calculate the x pixel of the 0th order

Returns

xpix – Moffat fitted x value of the 0th order [pix]

Return type

float

get_calibrated_spectrum(dict_cal, plot=False)#

Flux and waveength calibration

Parameters

dict_cal (dict) – Calibration parameters of the grating and the order

Returns

  • spectrum (Spectrum1D) – Flux calibrated spectrum in erg/s/cm2/A. Wavelength is in Angstrom

  • spectrum_cps (Spectrum1D) – Spectrum in counts/s/A. Wavelength is in Angstrom

  • spectrum_ct (Spectrum1D) – Spectrum in counts/pix. Wavelength is in pixels

plot()#

Plot flux calibrated spectra (order -1 and -2)

plot_all(save=False, folder_path='')#

Plot the 2d spectrum, 1d spectrum, wavelength calibrated count spectra and flux calibrated spectra.

Returns

  • fig (Figure) – matplotlib.figure.Figure

  • ax (ndarray) – Array of matplotlib.axes._subplots.AxesSubplot

save_all(folder_path='', overwrite=False)#

Save spectra if available.

Parameters

folder_path (str) – Folder in which to save the files. Default is working directory.