Keck-DataReductionPipelines / KPF-Pipeline

KPF-Pipeline
https://kpf-pipeline.readthedocs.io/en/latest/
Other
11 stars 2 forks source link

Measure Counts and SNR and put in L1 header #514

Closed awhoward closed 9 months ago

awhoward commented 1 year ago

Measure the SCI1 + SCI2 + SCI3 counts at a set of approximate wavelengths (I propose approximately 450, 550, 650, 750, 850 nm). Also, measure the SNR = counts / sqrt(variance) for the same wavelengths.

The measurements should be at peak-of-blaze for the nearest orders to the round number wavelengths. For stellar spectra and flats, I suggest using the 99th percentile of SCI1 + SCI2 + SCI3 in the identified orders in the attached file below. (99th percential will probably work, but whoever implements this should also check if 98th, etc. performs more reliably.) For comb spectra, the 99ths percentil will probably work. I'm not sure what to do for ThAr and UNe frames. I suggest starting with 99th percentile and we can see if the numbers are interpretable.

These will be really helpful to identify low-flux exposures and make good decisions in the pipeline and on Jump (after ingesting these).

Some possible names for the keywords are:

CTS450NM
CTS550NM
CTS650NM
CTS750NM
CTS850NM
SNR450NM
SNR550NM
SNR650NM
SNR750NM
SNR850NM

jump caltech-43

@shalverson, @bjfultn -- if there is some NEID standard for this that I'm unaware of, we might adopt it.

awhoward commented 1 year ago

I think we'd also like these keywords to be read into Jump

awhoward commented 1 year ago

Based on the discussion in a DRP meeting, we decided to record these header keywords for four orders.

In the second order on the green chip (to avoid edge effects in the first order)" SNRSC452 = 123.4 / SNR (95th percentile) in SCI=SCI1+SCI2+SCI3 near 415 nm SNRSK452 = 123.4 / SNR (95th percentile) in SKY near 415 nm SNRCL452 = 123.4 / SNR (95th percentile) in CAL near 415 nm

Near 550 nm (V-band) on the green chip): SNRSC548 = 123.4 / SNR (95th percentile) in SCI=SCI1+SCI2+SCI3 near 548 nm SNRSK548 = 123.4 / SNR (95th percentile) in SKY near 548 nm SNRCL548 = 123.4 / SNR (95th percentile) in CAL near 548 nm

Middle of the red chip and not near major telluric bands: SNRSC747 = 123.4 / SNR (95th percentile) in SCI=SCI1+SCI2+SCI3 near 747 nm SNRSK747 = 123.4 / SNR (95th percentile) in SKY near 747 nm SNRCL747 = 123.4 / SNR (95th percentile) in CAL near 747 nm

In the reddest order on the red chip: SNRSC865 = 123.4 / SNR (95th percentile) in SCI=SCI1+SCI2+SCI3 near 865 nm SNRSK865 = 123.4 / SNR (95th percentile) in SKY near 865 nm SNRCL865 = 123.4 / SNR (95th percentile) in CAL near 865 nm

The attached file shows the orders sampled (which are slightly different from above). jump caltech-99

fdai-planet commented 1 year ago

implemented

awhoward commented 1 year ago

Checking in on this, @fdai-planet. I don't see the keywords above in the headers. Maybe I missed them? Or maybe you implemented something a little different?

fdai-planet commented 12 months ago

I wrote a util function modules/Utils/L1_SNR_prim.py

Looks like it has been merged.

Maybe it is not being called in the recipe we are regularly running.

awhoward commented 10 months ago

Thanks, @fdai-planet ! For consistency with similar methods that write header keywords, I moved the code to modules/quickook/src/diagnostics.py, which is in this PR (https://github.com/Keck-DataReductionPipelines/KPF-Pipeline/issues/733) and will be part of the DRP once merged.