Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ion Pump diagnostic measurements to FITS headers #493

Closed
awhoward opened this issue Mar 21, 2023 · 1 comment
Closed

Add Ion Pump diagnostic measurements to FITS headers #493

awhoward opened this issue Mar 21, 2023 · 1 comment

Comments

@awhoward
Copy link
Collaborator

I just uploaded a Jupyter Notebook that creates plots of the ion pump current and posted an Issue for the plots to be added to the QLP. I will submit a separate Issue for the task of taking the measurements (electrons per hour, etc.) and putting them into the 2D FITS headers.

The purpose of this Issue is to use the same code in the Jupyter Notebook put measurements of the 2D images into their FITS headers. This module will take a 2D file as input and have the same 2D file as output, but with twenty new FITS headers added. I'm not sure if this means that the data model needs to be modified.

I suggest that this module be run only on dark images (Texp != 0 and no source) or bias images (Texp=0 and any source since the shutters won't open with Texp=0) to avoid confusion. This could be accomplished in the recipe not the module though.

Do we have other modules that only make measurements and add information to the FITS headers, while leaving the input file unchanged? We will have many more modules of this type.

The Jupyter Notebook is part of a pull request that I expect will be approved soon. I'm attaching a copy of it here. Note that this version is slightly updated from the version that I submitted last week.

KPF_Data_Tutorial_2D_and_Ion_Pumps.ipynb.zip

Here are the measurements and their associated variables in the Notebook code. There are ten regions in each CCD where an average flux per pixel is measured. For dark images, the units are electrons per hour. For bias images, the units are electrons.

FITS Keyword FITS Comment Variable name
FLXCOLLG Flux (e- [bias] or e-/hr [dark]) in Ion Pump reg., coll. side [3700:4000,700:1000], Green CCD reg['ref1'][''med_elec'']
FLXECHG Flux (e- [bias] or e-/hr [dark]) in Ion Pump reg., coll. side [3700:4000,3080:3380], Green CCD reg['ref1'][''med_elec'']
FLXREG1G Flux (e- [bias] or e-/hr [dark]) in Region 1 [1690:1990,1690:1990], Green CCD reg['ref1'][''med_elec'']
FLXREG2G Flux (e- [bias] or e-/hr [dark]) in Region 2 [1690:1990,2090:2390], Green CCD reg['ref2'][''med_elec'']
FLXREG3G Flux (e- [bias] or e-/hr [dark]) in Region 3 [2090:2390,1690:1990], Green CCD reg['ref3'][''med_elec'']
FLXREG4G Flux (e- [bias] or e-/hr [dark]) in Region 4 [2090:2390,2090:2390], Green CCD reg['ref4'][''med_elec'']
FLXREG5G Flux (e- [bias] or e-/hr [dark]) in Region 5 [80:380,700:1000], Green CCD reg['ref5'][''med_elec'']
FLXREG6G Flux (e- [bias] or e-/hr [dark]) in Region 6 [80:380,3080:3380], Green CCD reg['ref6'][''med_elec'']
FLXAMP1G Flux (e- [bias] or e-/hr [dark]) in Amp Region 1 [3700:4000,700:1000], Green CCD reg['amp1'][''med_elec'']
FLXAMP2G Flux (e- [bias] or e-/hr [dark]) in Amp Region 2 [3700:4000,3080:3380], Green CCD reg['amp2'][''med_elec'']
FLXCOLLR Flux (e- [bias] or e-/hr [dark]) in Ion Pump reg., coll. side [3700:4000,700:1000], Red CCD reg['ref1'][''med_elec'']
FLXECHR Flux (e- [bias] or e-/hr [dark]) in Ion Pump reg., coll. side [3700:4000,3080:3380], Red CCD reg['ref1'][''med_elec'']
FLXREG1R Flux (e- [bias] or e-/hr [dark]) in Region 1 [1690:1990,1690:1990], Red CCD reg['ref1'][''med_elec'']
FLXREG2R Flux (e- [bias] or e-/hr [dark]) in Region 2 [1690:1990,2090:2390], Red CCD reg['ref2'][''med_elec'']
FLXREG3R Flux (e- [bias] or e-/hr [dark]) in Region 3 [2090:2390,1690:1990], Red CCD reg['ref3'][''med_elec'']
FLXREG4R Flux (e- [bias] or e-/hr [dark]) in Region 4 [2090:2390,2090:2390], Red CCD reg['ref4'][''med_elec'']
FLXREG5R Flux (e- [bias] or e-/hr [dark]) in Region 5 [80:380,700:1000], Red CCD reg['ref5'][''med_elec'']
FLXREG6R Flux (e- [bias] or e-/hr [dark]) in Region 6 [80:380,3080:3380], Red CCD reg['ref6'][''med_elec'']
FLXAMP1R Flux (e- [bias] or e-/hr [dark]) in Amp Region 1 [3700:4000,700:1000], Red CCD reg['amp1'][''med_elec'']
FLXAMP2R Flux (e- [bias] or e-/hr [dark]) in Amp Region 2 [3700:4000,3080:3380], Red CCD reg['amp2'][''med_elec'']

I'm not sure if the FITS Comments exceed some standard length specification.

Tagging @bjfultn for coordination.

@awhoward awhoward changed the title Adding Ion Pump diagnostic measurements to FITS headers Add Ion Pump diagnostic measurements to FITS headers Mar 27, 2023
@awhoward awhoward self-assigned this Aug 18, 2023
@awhoward
Copy link
Collaborator Author

The code for this is in the measure_2D_dark_current() method in this part of the DRP: https://github.com/Keck-DataReductionPipelines/KPF-Pipeline/blob/develop/modules/Utils/analyze_2d.py

The next step is to run this analysis on 2D files as they are created and put the measured dark currents into the headers. It will be very helpful to analyze the time series of these from the 20-minute dark frames that we take every day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant