Keck-DataReductionPipelines / KPF-Pipeline

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

New BIASDONE, DARKDONE, and FLATDONE header keywords, etc. #845

Closed RussLaher closed 2 months ago

RussLaher commented 3 months ago

Please merge the feature/new_done_keywords_20240405 branch into the develop branch.

Modified to write header kewords BIASFILE, DARKFILE, and FLATFILE regardless of whether they were applied, and to write new header kewords BIASDONE, DARKDONE, and FLATDONE, =1 if applied or =0 otherwise.

awhoward commented 3 months ago

A reminder that we were hoping for FLATFILE to be split into FLATDIR and FLATFILE since there were truncation issues with other files listed in the headers.

RussLaher commented 3 months ago

A reminder that we were hoping for FLATFILE to be split into FLATDIR and FLATFILE since there were truncation issues with other files listed in the headers.

Sorry, I forgot. I will work on it tomorrow.

awhoward commented 3 months ago

Many thanks, Russ.

RussLaher commented 3 months ago

Here is what is outputted in my test:

BIASFILE= 'kpf_20231230_master_bias_autocal-bias.fits' BIASDONE= 1 DARKFILE= 'kpf_20231230_master_dark_autocal-dark.fits' DARKDONE= 1 FLATFILE= 'kpf_20231230_master_flat.fits' FLATDONE= 1

There is no directory path, so there is no truncation (i.e., wrap-around header lines).

Andrew, 1) Do you want the directory path (written to FLATDIR, etc.) or simply 2) Do you just want the directory path removed? The latter is already the case in base_model.py currently because self.filename = os.path.basename(fn).

awhoward commented 3 months ago

Ah, I see. I think we want to add FLATDIR, etc. so that someone (or a recipe/script) can completely reconstruct the full path with FLATDIR + FLATFILE. At the moment, FLATDIR is implied, and we can probably guess correctly. But I think future us will thank current us for being specific here.

RussLaher commented 2 months ago

You got it. I will added changes to this branch if BJ holds off merging it until I've finished.

bjfultn commented 2 months ago

@RussLaher please remove the don't merge label when this is ready.

RussLaher commented 2 months ago

Okay, fully implemented now:

BIASFILE= 'kpf_20231230_master_bias_autocal-bias.fits' BIASDIR = '/masters/20231230' BIASDONE= 1 DARKFILE= 'kpf_20231230_master_dark_autocal-dark.fits' DARKDIR = '/masters/20231230' DARKDONE= 1 FLATFILE= 'kpf_20231230_master_flat.fits' FLATDIR = '/masters/20231230' FLATDONE= 1