njcuk9999 / lbl

Line by line code for radial velocity
MIT License
15 stars 3 forks source link

Blaze file keyword for NIRPS - ESO #37

Open j-faria opened 9 months ago

j-faria commented 9 months ago

For NIRPS spectra reduced with the ESO DRS, the header keyword for the blaze file is currently HIERARCH ESO PRO REC1 CAL24 NAME (in lbl/instruments/nirps.py)

but sometimes it is actually found in HIERARCH ESO PRO REC1 CAL25 NAME

Is there a way currently implemented to try both keywords?

njcuk9999 commented 9 months ago

Yes so the ESPRESSO pipeline is annoying like this, we do allow a list of header keys to be set and I think it cycle through them but only if the other key (in this case HIERARCH ESO PRO REC1 CAL24 NAME is set to None|"None"|""

Do you know what the value of HIERARCH ESO PRO REC1 CAL24 NAME is when you want to use HIERARCH ESO PRO REC1 CAL25 NAME?

Also are we 100% certain that HIERARCH ESO PRO REC1 CAL25 NAME will always be a blaze filename (if HIERARCH ESO PRO REC1 CAL24 NAME is None|"None"|""?

If so I'll push the change straight away and it should work.

j-faria commented 9 months ago

Indeed it's annoying.

Do you know what the value of HIERARCH ESO PRO REC1 CAL24 NAME is when you want to use HIERARCH ESO PRO REC1 CAL25 NAME?

I think it's set to another calibration file, the ... FSPECTRUMB if I remember correctly.

The best way to fix this would be to check the associated HIERARCH ESO PRO REC1 CAL24/25 CATG which should be BLAZE_A. Maybe this would be easy to check within the function that cycles through a list of keys.

njcuk9999 commented 9 months ago

Can you give me an example of both possible types:

i..e HIERARCH ESO PRO REC1 CAL24 NAME AND HIERARCH ESO PRO REC1 CAL25 NAME

For two files, one where CAL24 should be used and one where CAL25 should be used.

The "function that cycles through a list of keys" is generic for all instruments and all keys so I don't want to add a specific case. The reason I'm asking for an example with both keys is that maybe I can check CAL25 first then CAL24 otherwise I have to have a way to know which key to have (in a generic way) otherwise I need to write a whole separate function or make some functionality for the generic function to "know" what to expect both of which I'd rather avoid.

j-faria commented 9 months ago

Sorry just got the time now to get back to this.

For a file where CAL24 should be used: HIERARCH ESO PRO REC1 CAL24 NAME = 'r.NIRPS.2023-07-30T13:31:31.594_BLAZE_A.fits' HIERARCH ESO PRO REC1 CAL25 NAME = 'r.NIRPS.2023-07-30T13:31:31.594_BLAZE_B.fits'

while for a file where CAL25 should be used: HIERARCH ESO PRO REC1 CAL24 NAME = 'r.NIRPS.2023-08-13T12:12:30.954_FSPECTRUM_B.' HIERARCH ESO PRO REC1 CAL25 NAME = 'r.NIRPS.2023-08-13T12:12:30.954_BLAZE_A.fits'