OttoStruve / muler

A Python package for working with pipeline-produced spectra from IGRINS, HPF, and Keck NIRSPEC
https://muler.readthedocs.io
MIT License
15 stars 9 forks source link

HPF deblazing by twilight flat field calibration spectra #20

Closed gully closed 3 years ago

gully commented 3 years ago

Currently our deblaze method defaults to spline fitting. Spline fitting may require tuning for spectra with certain genuine large scale features and may introduce signal self-subtraction and bias comparable to target signals in some high precision applications, and so spline debazing should be considered for quick-look purposes only.

Instead, HPF observes twilight flat field spectra that should exhibit smooth continua ideal for deblazing. We should make this strategy the default. @jessicaluna already added support for deblazing by flats blaze_divide_flats, that method makes the following assumption for the input:

Ideally we would like to derive this (possibly pre-processed) flat array from the original FITS file, using muler. So we would want a new series of functions: pre_process_flat(flat_FITS_file_name) that creates that (3 x N_orders x N_wavelength) array.

The returned object should follow the new pattern for preserving metadata--- see examples of how other methods use return ________. The docstrings should house information on what the inputs and outputs of these functions are.

gully commented 3 years ago

Correction--- the twlight flats contain conspicuous sharp solar spectral lines. In our pending Pull Request we employ the quartz lamp calibration files. Ideally we would use the twilight flats if we had a good enough model for the true twilight spectrum.