njcuk9999 / apero-drs

A PipelinE to Reduce Observations - The DRS for SPIRou (CFHT)
MIT License
12 stars 0 forks source link

lbl 0.63.006 in Apero: errors missing FP_neg, GJ411 and GJ905 instead of GL411 and GL905 previously ? #756

Open larnoldgithub opened 5 months ago

larnoldgithub commented 5 months ago

I have done a apero_reset.py no issues.

When I relaunch lbl_run.ini, I have errors I didn't have before.

2024-03-23 21:38:50.581|E| File /data/spirou3/apero-data/temptest/lbl/masks/FP_neg.fits cannot be found
07:38:50.585-@$|LBLCOMPUTE_FP[00021]| No DTEMP files found. Skipping.

and also

2024-03-23 21:44:11.692|E| File /data/spirou3/apero-data/temptest/lbl/templates/Template_s1dv_GJ411_sc1d_v_file_AB.fits cannot be found
07:44:11.700-!!|LBLMASK_SCI[00025]| LBL Mask Exception [GJ411_GJ411] <class 'lbl.core.base_classes.LblException'>:
07:44:11.700-!!|LBLMASK_SCI[00025]|     File
07:44:11.700-!!|LBLMASK_SCI[00025]|     /data/spirou3/apero-data/temptest/lbl/templates/Template_s1dv_GJ411_sc1d_v_file_AB.fits
07:44:11.700-!!|LBLMASK_SCI[00025]|     cannot be found
2024-03-23 21:44:11.707|G|LBLMASK_SCI[00024]| Skipped Mdwarf Temperature Gradient Table file. Missing from server.
2024-03-23 21:44:11.715|E| File /data/spirou3/apero-data/temptest/lbl/templates/Template_s1dv_GJ905_sc1d_v_file_AB.fits cannot be found
07:44:11.723-!!|LBLMASK_SCI[00024]| LBL Mask Exception [GJ905_GJ905] <class 'lbl.core.base_classes.LblException'>:
07:44:11.723-!!|LBLMASK_SCI[00024]|     File
07:44:11.723-!!|LBLMASK_SCI[00024]|     /data/spirou3/apero-data/temptest/lbl/templates/Template_s1dv_GJ905_sc1d_v_file_AB.fits
07:44:11.723-!!|LBLMASK_SCI[00024]|     cannot be found

I checked what I had in January: I have templates for GL411 and GL905. But it seems now Apero doesn't want to built templates for GJ411 and GJ905. My ini file still mentions the science targets GL411 and GL905. That should work. I don't understand what's going on. Something has changed in the apero_objdb ?

njcuk9999 commented 5 months ago

I did have to do a big merge of the pending list and main list. There were quite a few duplicates

I see GL411 under GJ411 with the comment: "Merged from multiple entries [GJ411|GL411] on 2024-02-29 16:31:11.391" and same with GL905 under GJ411 "Merged from multiple entries [GJ905|GL905] on 2024-02-29 16:32:34.571"

But you are correct that GL411 or GJ411 should work in the run.ini file. But if you updated the object database before/after this date (which is not recommended for a consistent run) you may have some DRSOBJN with GL411 and some with GJ411 (and similarly for GL905)

Could you check on disk what the DRSOBJN is for all the tcorr files associated with GL411/GJ411 you'll soon see if there is a problem is the DRSOBJN is different.

The solution is pretty straightforward if you have differing DRSOBJN for the same object do a science_run.ini (pp_seq_opt + science_seq) making sure SKIP_XXXX = False for SCIENCE_TARGETS=GL411.

FYI: From the astrometric database these objects were also merged:

DX_CNC      Merged from multiple entries [DX_CNC|GJ1111] on 2024-02-29 16:30:58.816
EE_LEO      Merged from multiple entries [EE_LEO|GJ402] on 2024-02-29 16:31:02.480
GJ411      Merged from multiple entries [GJ411|GL411] on 2024-02-29 16:31:11.391
GJ4247      Merged from multiple entries [GJ4247|V374PEG] on 2024-02-29 16:31:21.760
GJ555      Merged from multiple entries [GJ555|HN_LIB] on 2024-02-29 16:31:27.839
GJ617B      Merged from multiple entries [GJ617B|GL617B] on 2024-02-29 16:31:39.231
GJ628      Merged from multiple entries [GJ628|V2306_OPH] on 2024-02-29 16:31:47.503
GJ752A      Merged from multiple entries [GJ752A|GL752A] on 2024-02-29 16:32:00.005
GJ87      Merged from multiple entries [GJ87|GL87] on 2024-02-29 16:32:04.446
GJ876A      Merged from multiple entries [GJ876A|GL876] on 2024-02-29 16:32:18.940
GJ905      Merged from multiple entries [GJ905|GL905] on 2024-02-29 16:32:34.571
GJ9520      Merged from multiple entries [GJ9520|OTSER] on 2024-02-29 16:32:44.675
GL15A      Merged from multiple entries [GL15A|GX_AND] on 2024-02-29 16:32:55.154
GL15B      Merged from multiple entries [GL15B|GQ_AND] on 2024-02-29 16:33:39.192
GL176      Merged from multiple entries [GL176|HD_285968] on 2024-02-29 16:33:49.096
TZ_ARI      Merged from multiple entries [GL83_1|TZ_ARI] on 2024-02-29 16:34:07.200
HD18978      Merged from multiple entries [HD18978|TAU3_ERI] on 2024-02-29 16:34:27.006
larnoldgithub commented 5 months ago

Thanks Neil. I have GL411 as DRSOBJN in my tmp/ files (from Mar 4) and in my red/ files from Mar 23.

I had checked yesterday before opening this ticket that GL411 and GL905 were already existing with apero_astrometrics.py

larnoldgithub commented 5 months ago

I didn't update GL411 and GL905 in the objdb, but I have added a fee new targets from last Feb run (24AQ03)

larnoldgithub commented 5 months ago

Any idea for the missing FP_neg.fits mask ?

larnoldgithub commented 5 months ago

(no worries if you answer monday - I'm posting things as they arrive)

njcuk9999 commented 5 months ago

I didn't update GL411 and GL905 in the objdb, but I have added a fee new targets from last Feb run (24AQ03)

Unfortunately, if you update a single object you update the whole database. It shouldn't be common that I merge the pending into the main and fix duplicates but it does need to be done from time to time (I had over 500 objects to merge this time) and the duplicates were causing problems so I had to deal with it.

I have GL411 as DRSOBJN in my tmp/ files (from Mar 4) and in my red/ files from Mar 23.

If you have any DRSOBJN = GL411 or GL905 I suggest re-running using the science_run.ini (pp_seq_opt + science_seq with all the SKIP_XXXX = False) to redo them, you should only have DRSOBJN = GJ411 and DRSOBJN=GJ905. Again this is due to the merging I mentioned above and is not your fault but now you have an up-to-date database you have to do this.

I had checked yesterday before opening this ticket that GL411 and GL905 were already existing with apero_astrometrics.py

So this wont tell you that you have objects with the wrong DRSOBJN, currently it will just tell you if you have an object that is in the alias list - maybe I should add a way for you to check if the "DRSOBJN" is correct.

Any idea for the missing FP_neg.fits mask ?

I'm not sure, FP_neg should be created by running the LBLMASK_FP step in lbl_run.ini

Can you make sure you had the following set:

RUN_LBLREF = True
RUN_LBLMASK_FP = True
RUN_LBLCOMPUTE_FP = True
RUN_LBLCOMPILE_FP = True

Or just run the command for the LBLMASK_FP separately (you can get the command by using apero processing in test mode and just have RUN_LBLMASK_FP = True and all other False).

njcuk9999 commented 5 months ago

Right I've added a check in apero_astrometrics (for v0.7.289-stable-test)

Basically now if you enter GL411 (or GJ411) you should get a warning that DRSOBJN are inconsistent.

I can't test this as all my GL411 are GL411 and I have no GJ411 but I've also added a warning that works for me that will warn me that future observations will be under the new name and to avoid this you should re-reduce this object.

@CharlesCadieux this may be useful for you when adding new targets / running an update after the astrometric database has been updated (this will be the case with GL411 for example, as @larnoldgithub has found)

Currently there is no way to do this in bulk (for all objects) but if you both think this would be useful I could figure out a way to do it.

larnoldgithub commented 5 months ago

@njcuk9999 @CharlesCadieux @andrescarmona @clairem789 Would'nt be simpler to stay with GL411 and GL905 instead of GJ411 and GJ905 for DRSOBJN, by modifying the objdb ?

larnoldgithub commented 5 months ago

Same comment for GJ1111 that we used to have and is now DX_CNC, or GL617A becoming GJ617A ... I have to rerun the full offline from the preprocessing for the stars of your list above ?

njcuk9999 commented 5 months ago

I had to go through 1500 targets and search for duplicates, I took the row with the proper motion from the most recent source. If there were two rows it mean someone from NIRPS or SPIRou has that name. So someone is going to have to reprocess. In fact its not just the name its the other details of that row as well (i.e. proper motion).

I could change these names as you suggest but I wouldn't know what to do about the proper motion (I've now removed the old information) also anyone else who has processed since February would also have to reprocess to I'm inclined not to unless there is an extremely good reason. It is a very short list of stars you have in possible conflict, so it wouldn't take long to reprocess to have a uniform set of data.

larnoldgithub commented 5 months ago

I have reprocessed the stars that needed the right DRSOBJN (I have now GJ411 instead of GL411 etc), reset the lbl using the apero_reset tool but this morning the lbl_run.ini again failed due to a missing FP_neg mask. I had no errors for the previous extractions, but will look at the _C.fits.

njcuk9999 commented 5 months ago

Can you use lbl_run.ini in test mode and print out the command that it is running (with just the FP steps on).

You can even just run the apero_lbl_mask step for the FP once you have this command. Lets see if it is giving an error.

larnoldgithub commented 5 months ago

here is what I get with the --test=True mode, and only LBLMASK_FP set to True in the ini file. No errors.

20:31:39.666-  |PROC|   Adding recipe LBLREF to sequence
20:31:39.693-  |PROC|   Adding recipe LBLMASK_FP to sequence
20:31:39.818-  |PROC|   Adding recipe LBLCOMPUTE_FP to sequence
20:31:39.942-  |PROC|   Adding recipe LBLCOMPILE_FP to sequence
20:31:40.067-  |PROC|   Adding recipe LBLMASK_SCI to sequence
20:31:42.758-  |PROC|   Adding recipe LBLCOMPUTE_SCI to sequence
20:31:42.882-  |PROC|   Adding recipe LBLCOMPILE_SCI to sequence
20:31:45.400-**|PROC| processing recipes for 6569 raw data entries
20:31:45.407-  |PROC|    skipping recipe 'apero_lbl_ref_spirou.py' (RUN_LBLREF=False)
20:31:45.414-  |PROC|    processing recipe 'apero_lbl_mask_spirou.py' (LBLMASK_FP)
20:31:55.290-  |PROC|           Added 1 runs
20:31:55.298-  |PROC|    skipping recipe 'apero_lbl_compute_spirou.py' (RUN_LBLCOMPUTE_FP=False)
20:31:55.305-  |PROC|    skipping recipe 'apero_lbl_compile_spirou.py' (RUN_LBLCOMPILE_FP=False)
20:31:55.312-  |PROC|    skipping recipe 'apero_lbl_mask_spirou.py' (RUN_LBLMASK_SCI=False)
20:31:55.319-  |PROC|    skipping recipe 'apero_lbl_compute_spirou.py' (RUN_LBLCOMPUTE_SCI=False)
20:31:55.325-  |PROC|    skipping recipe 'apero_lbl_compile_spirou.py' (RUN_LBLCOMPILE_SCI=False)
20:31:55.613-**|PROC| Validating all runs (1 run ids found)
20:31:55.620-  |PROC| ***************************************************************************
20:31:55.627-  |PROC| 
20:31:55.627-  |PROC| Validating run ID00000 (1 of 1)
20:31:55.634-  |PROC| ***************************************************************************
20:31:55.641-  |PROC|    apero_lbl_mask_spirou.py FP
20:31:55.649-  |PROC|    run ID00000 validated
20:31:55.656-**|PROC| Analyzed 1 runs. Validated 1 runs. Skipped 0 runs.
20:31:55.669-**|PROC| Running with 20 cores
20:31:55.698-**|PROC| 
20:31:55.707-**|PROC| ***************************************************************************
20:31:55.714-**|PROC| *  GROUP 1/1 (LBLMASK_FP)
20:31:55.721-**|PROC| ***************************************************************************
20:31:55.728-**|PROC| 
20:31:55.746-**|PROC| TID00000|C01/20| apero_lbl_mask_spirou.py FP --crunfile=lbl_run_test.ini --program=LBLMASK_FP[00000] --recipe_kind=lbl-mask-fp --shortname=LBLMASK_FP --parallel=True
20:31:55.778-  |PROC| 
20:31:55.786-  |PROC| ***************************************************************************
20:31:55.793-  |PROC| Timings:
20:31:55.800-  |PROC| ***************************************************************************
20:31:55.806-  |PROC| 
20:31:55.813-  |PROC| ***************************************************************************
20:31:55.820-**|PROC| Cumulative time taken = 0.000
20:31:55.826-**|PROC| Actual time taken = 0.109
20:31:55.833-**|PROC| Speed up: 0.000   (Number of cores = 20)
20:31:55.839-  |PROC| ***************************************************************************
20:31:55.846-  |PROC| 
20:31:55.974-**|PROC| ***************************************************************************
20:31:55.981-**|PROC| Recipe apero_processing has been successfully completed
20:31:55.987-**|PROC| ***************************************************************************
larnoldgithub commented 5 months ago

I'm doing the same with all FP steps on now. no errors.

[...]
20:37:46.432-  |PROC| ***************************************************************************
20:37:46.439-  |PROC| 
20:37:46.439-  |PROC| Validating run ID00021 (22 of 22)
20:37:46.446-  |PROC| ***************************************************************************
20:37:46.453-  |PROC|    apero_lbl_compile_spirou.py FP
20:37:46.461-  |PROC|    run ID00021 validated
20:37:46.467-**|PROC| Analyzed 22 runs. Validated 22 runs. Skipped 0 runs.
20:37:46.478-**|PROC| Running with 20 cores
20:37:46.508-**|PROC| 
20:37:46.516-**|PROC| ***************************************************************************
20:37:46.523-**|PROC| *  GROUP 1/3 (LBLMASK_FP)
20:37:46.530-**|PROC| ***************************************************************************
20:37:46.536-**|PROC| 
20:37:46.554-**|PROC| TID00000|C01/20| apero_lbl_mask_spirou.py FP --crunfile=lbl_run_test.ini --program=LBLMASK_FP[00000] --recipe_kind=lbl-mask-fp --shortname=LBLMASK_FP --parallel=True
20:37:46.573-**|PROC| 
20:37:46.581-**|PROC| ***************************************************************************
20:37:46.587-**|PROC| *  GROUP 2/3 (LBLCOMPUTE_FP)
20:37:46.594-**|PROC| ***************************************************************************
20:37:46.601-**|PROC| 
20:37:46.619-**|PROC| TID00001|C01/20| apero_lbl_compute_spirou.py FP --iteration 0 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00001] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.626-**|PROC| TID00002|C02/20| apero_lbl_compute_spirou.py FP --iteration 1 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00002] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.633-**|PROC| TID00003|C03/20| apero_lbl_compute_spirou.py FP --iteration 2 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00003] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.640-**|PROC| TID00004|C04/20| apero_lbl_compute_spirou.py FP --iteration 3 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00004] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.647-**|PROC| TID00005|C05/20| apero_lbl_compute_spirou.py FP --iteration 4 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00005] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.654-**|PROC| TID00006|C06/20| apero_lbl_compute_spirou.py FP --iteration 5 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00006] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.661-**|PROC| TID00007|C07/20| apero_lbl_compute_spirou.py FP --iteration 6 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00007] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.668-**|PROC| TID00008|C08/20| apero_lbl_compute_spirou.py FP --iteration 7 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00008] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.676-**|PROC| TID00009|C09/20| apero_lbl_compute_spirou.py FP --iteration 8 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00009] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.683-**|PROC| TID00010|C10/20| apero_lbl_compute_spirou.py FP --iteration 9 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00010] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.691-**|PROC| TID00011|C11/20| apero_lbl_compute_spirou.py FP --iteration 10 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00011] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.702-**|PROC| TID00012|C12/20| apero_lbl_compute_spirou.py FP --iteration 11 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00012] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.705-**|PROC| TID00013|C13/20| apero_lbl_compute_spirou.py FP --iteration 12 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00013] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.711-**|PROC| TID00014|C14/20| apero_lbl_compute_spirou.py FP --iteration 13 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00014] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.719-**|PROC| TID00015|C15/20| apero_lbl_compute_spirou.py FP --iteration 14 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00015] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.726-**|PROC| TID00016|C16/20| apero_lbl_compute_spirou.py FP --iteration 15 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00016] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.738-**|PROC| TID00017|C17/20| apero_lbl_compute_spirou.py FP --iteration 16 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00017] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.743-**|PROC| TID00018|C18/20| apero_lbl_compute_spirou.py FP --iteration 17 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00018] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.752-**|PROC| TID00019|C19/20| apero_lbl_compute_spirou.py FP --iteration 18 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00019] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.761-**|PROC| TID00020|C20/20| apero_lbl_compute_spirou.py FP --iteration 19 --total 20 --crunfile=lbl_run_test.ini --program=LBLCOMPUTE_FP[00020] --recipe_kind=lbl-compute-fp --shortname=LBLCOMPUTE_FP --parallel=True
20:37:46.780-**|PROC| 
20:37:46.787-**|PROC| ***************************************************************************
20:37:46.794-**|PROC| *  GROUP 3/3 (LBLCOMPILE_FP)
20:37:46.800-**|PROC| ***************************************************************************
20:37:46.807-**|PROC| 
20:37:46.825-**|PROC| TID00021|C01/20| apero_lbl_compile_spirou.py FP --crunfile=lbl_run_test.ini --program=LBLCOMPILE_FP[00021] --recipe_kind=lbl-compile-fp --shortname=LBLCOMPILE_FP --parallel=True
20:37:46.859-  |PROC| 
20:37:46.866-  |PROC| ***************************************************************************
20:37:46.873-  |PROC| Timings:
20:37:46.880-  |PROC| ***************************************************************************
20:37:46.887-  |PROC| 
20:37:46.894-  |PROC| ***************************************************************************
20:37:46.901-**|PROC| Cumulative time taken = 0.000
20:37:46.908-**|PROC| Actual time taken = 0.380
20:37:46.916-**|PROC| Speed up: 0.000   (Number of cores = 20)
20:37:46.923-  |PROC| ***************************************************************************
20:37:46.930-  |PROC| 
20:37:47.224-**|PROC| ***************************************************************************
20:37:47.231-**|PROC| Recipe apero_processing has been successfully completed
20:37:47.238-**|PROC| ***************************************************************************
larnoldgithub commented 5 months ago

the first error in LBLMASK_FP is a missing blaze file

2024-03-27 10:57:23.511|G|LBLMASK_FP[00000]| Processing E2DS->S1D for file 13 of 596
2024-03-27 10:57:23.898|G|LBLMASK_FP[00000]| Processing E2DS->S1D for file 14 of 596
2024-03-27 10:57:24.393|G|LBLMASK_FP[00000]| Processing E2DS->S1D for file 15 of 596
2024-03-27 10:57:24.777|G|LBLMASK_FP[00000]| Processing E2DS->S1D for file 16 of 596
2024-03-27 10:57:24.819|E| File /data/spirou3/apero-data/temptest/lbl/calib/F1F2AD08BD_pp_blaze_C.fits cannot be found
20:57:24.825-!!|LBLMASK_FP[00000]| LBL Template Exception [FP_FP] <class 'lbl.core.base_classes.LblException'>:
20:57:24.825-!!|LBLMASK_FP[00000]|      File /data/spirou3/apero-data/temptest/lbl/calib/F1F2AD08BD_pp_blaze_C.fits
20:57:24.825-!!|LBLMASK_FP[00000]|      cannot be found
20:57:25.070-**|LBLMASK_FP[00000]| ***************************************************************************
20:57:25.078-@!|LBLMASK_FP[00000]| W[40-003-00005]: Recipe apero_lbl_mask_spirou has NOT been successfully
20:57:25.078-@!|LBLMASK_FP[00000]|      completed
20:57:25.085-**|LBLMASK_FP[00000]| ***************************************************************************

I don't understand why it's missing, I had no error when I ran the calibrations processing. Apparently this missing blaze is preventing lbl to build the FP mask, right ?

larnoldgithub commented 5 months ago

Actually the file does exist in the main calibDB /data/spirou3/apero-data/temptest/calib but has not been copied in /data/spirou3/apero-data/temptest/lbl/calib/

QC are all good for the missing blaze.

larnoldgithub commented 5 months ago

I've copied (no symbolic links) over all _pp_blaze_C.fits from the calibDB to the lbl/calib/ folder. This added about 20% more blaze_C.fits files in lnl/calib/. And now the processing E2DS->S1D of the 596 files seems to work.

I don't know why lbl missed them at the beginning of the mask procedure. Is this a bug ?

larnoldgithub commented 5 months ago

So now I'm going to restart the lbl: do a apero_reset for the lbl, then manually copy the blaze_C to lbl/calib, and only then run apero_processing.py lbl_run.ini

njcuk9999 commented 4 months ago

Hmm okay so that is weird, the apero_lbl_ref_spirou.py should have made links to all the blaze files. So something must have gone wrong in making the links... we will have to look at the log file for apero_lbl_ref_spirou.py to see what happened (and why that file or set of files was not linked). Note you should also run apero_lbl_ref_spirou.py when you have any new observations for lbl as it will add the new files (including blaze) but maybe something went wrong in that process. It might be worth running the apero_lbl_ref_spirou.py to see if any errors are generated (and check before/after how many files are in the lbl directory to see if it added anything else you were missing!)

But this does explain why you have no FP masks!

larnoldgithub commented 4 months ago

The lblrun.ini still ended with errors this morning (all RUN to true and all SKIP to False). All errors are about more missing blazes ! really unexpected, as I did a cp of *_pp_blaze_AB.fits from the regular calib/ to the specific lbl/calb/ directory.

Maybe something is wrong with the calib db ?? I have reset the calib db, and apero is rebuilding the db. It should be done by the afternoon and I will run lbl_run.ini again, after resetting lbl too.

I'll look to the msg/ errors and post anything I find here.

njcuk9999 commented 4 months ago

It may be an lbl_ref thing as well not copying the correct calibrations - I'll have to check where apero_lbl_ref.py even gets the blaze files from, maybe its the reduced directory and not the calibration directory at all? Did you say you deleted stuff in the reduced directory? That could be it if that is the case?

larnoldgithub commented 4 months ago

I've run lbl_run.ini with only the apero_lbl_ref.py (RUN_LBLREF = True, all others to False)

Ends with no error. Is there a way to verify everything is here in lbl/calib/ or lbl/science ?

I'm going to continue with RUN_LBLMASK_FP=True, all others to false. if it makes sense.

larnoldgithub commented 4 months ago

RUN_LBLMASK_FP=True fails rapidly:

Screenshot 2024-03-28 at 14 46 34

Note that I have reset and rebuilt the calib db this morning (it took about 2h to rebuild). also I didn't cp manually all blazes from calib/ to lbl/calib/ for this test.

njcuk9999 commented 4 months ago

Sorry you are still having problems.

Could you send me the log for apero_lbl_ref.py

Could you verify that

  1. the blaze file that cannot be found is in the path (it should be a symlink so it may be there but the link may be dead you can use ls -ltr /path/to/blaze/file to see if the link is there at all or whether this file is missing completely.

  2. the blaze file it mentions is in the calib directory

  3. the blaze file is in one of the night directories (if you open the header of the file -- assuming you find it in the calibration database, you should be able to look at the DATE-OBS and work out which red directory it should be in

  4. That the AB version of this blaze file exists on disk if the AB exists and the C doesn't it could mean that the blaze code crashed in between the AB and C (I recall one of the calibration is looking for AB and C files)

If there is no AB or C file with this blaze name then I'm not sure why it is asking for it -- at this point I'll look in the code to see why it is asking for that file and then saying its not on disk.

larnoldgithub commented 4 months ago

I'm going to redo a PP + EXTRACT for the 17 objects that have a new DRSOBJN (actully only 15, as GL15A and GL15B are ok - I didn't check for the other) for all nights from 18B. This processing will set the correct DRSOBJN in their fits header.

Once EXTRACT will be done, I will continue with the Fittellu etc.

larnoldgithub commented 4 months ago

This finally worked: no missing blaze anymore, and FP mask has been built.

apero_reset.py   (lbl only)
apero_processing.py lbl_run_LBLREF_only.ini

cd /data/spirou3/apero-data/temptest/lbl/calib
cp -sv ../../calib/*_blaze_AB.fits .
cp -sv ../../calib/*_blaze_C.fits .
cp -sv ../../calib/*_C_wave_night_C.fits .
cp -sv ../../calib/*_AB_wave_night_AB.fits .

apero_processing.py lbl_run_LBLMASK_FP_etc.ini