3. Calibration

pcassie.calibration.gaussian(x, amp, mu, sigma, offset)[source]

A simple gaussian function.

pcassie.calibration.fit_gaussian_to_peaks(x, y, peaks, window=5)[source]

Fit peak absoption features to gaussians.

pcassie.calibration.fit_segments_to_wavelengths(segment_centroids, tel_centroid_dict, telluric_wavelength, deg=3)[source]

Fits individual detectors to a new wavelength grid.

pcassie.calibration.precision(residuals, wave_arr)[source]

A function to calculate the precision of the wavelength fit in terms of velocity. Refernce https://discovery.ucl.ac.uk/id/eprint/10066066/7/Mario_Damiano_Thesis.pdf pg. 117 for more info.

pcassie.calibration.split_and_stack(arr, gaps)[source]

Rearranges your spectrum into a 3d array with (detector, spectra, flux); i.e. a shape of (n detector x n spectra x wavelength range)

pcassie.calibration.calibrate_cr2res(data_wave, data_flux, telluric_wave, telluric_flux, gap_size_px=5, poly_order=5)[source]

Runs a full calibration of your spectrum.

Args: data_flux is an array of n spectra x wavelength array data_wave is a 1d wavelength array telluric_flux is a 1d telluric flux array telluric_wave is a 1d telluric wavelength array

Ensure the wavelegnth units match :)