njcuk9999 / apero-drs

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

Errors with CCF apero_ccf_spirou.py (RUNID and PI_NAME would help) (0.7.286) #726

Closed larnoldgithub closed 10 months ago

larnoldgithub commented 11 months ago

I have plenty of errors like this one below. The example below is for a tellurinc / hot star, no absorption lines so I understand the CCF failed, but could the error message be more explicit ?

In general, it would be very helpful to have the RUNID and PI_NAME of the pgm mentioned in the error message returned by Apero.

15:58:33.155- |PROC| 15:58:33.167-@!|PROC|W[40-503-00019]: Error found for ID='143717' 15:58:33.200-@!|PROC| apero_ccf_spirou.py 21AQ08-Mar22 2601144o_pp_e2dsff_tcorr_AB.fits --crunfile=run_EXTALL_FTFIT2_CCF_porducts_only.ini --program=CCF[143717] --recipe_kind=rv-tcorr --shortname=CCF --parallel=True 15:58:33.217- |PROC| 15:58:33.230- |PROC| E[01-010-00001]: Unhandled error has occurred: Error <class 'UnboundLocalError'>

Traceback (most recent call last): File "/apero/apero-drs/apero/core/utils/drs_startup.py", line 432, in run llmain = func(recipe, params) File "/apero/apero-drs/apero/recipes/spirou/apero_ccf_spirou.py", line 218, in main if has_fp: UnboundLocalError: local variable 'has_fp' referenced before assignment

15:58:33.339- |PROC| 15:58:33.351- |PROC| 15:58:33.364- |PROC| ***

larnoldgithub commented 11 months ago

This an error I got after re-running RUN_EXTALL=True
RUN_FTFIT2=True RUN_CCF=True RUN_POLAR=True RUN_POSTALL=True

with corresponding SKIP=True

njcuk9999 commented 11 months ago

Which version are you using? I think this was fixed in the latest version (v0.7.288-live).

For error logging: "Unhandled error has occurred" means it is not a "controlled" error (i.e. I didn't raise an error) its a python crash from something that was not known about (a bug). Therefore I have no control over the error generated and cannot add information.

apero processing tries to catch all errors hence the print out:

15:58:33.167-@!|PROC|W[40-503-00019]: Error found for ID='143717'
15:58:33.200-@!|PROC| apero_ccf_spirou.py 21AQ08-Mar22 2601144o_pp_e2dsff_tcorr_AB.fits --crunfile=run_EXTALL_FTFIT2_CCF_porducts_only.ini --program=CCF[143717] --recipe_kind=rv-tcorr --shortname=CCF --parallel=True

But it does not have access to the file or the header.

From this printout you have the directory and filename so a simple dfits of the RUNID and PI_NAME is the best solution here (otherwise I have to read every file in apero_processing just in case I have an error which could add days to processing).

Let me know which version of APERO you are using and please confirm that you have done a git pull. In v0.7.288-stable-test I cannot see what could cause this problem.

larnoldgithub commented 11 months ago

Thanks Neil I've been using the .286 stable version since the beginning of this full reprocessing.

larnoldgithub commented 11 months ago

if I pull the latest .288 version, would I need to restart everything from the preprocessing ? would DB be ok if created with the .286 and then used under the .288 ?

njcuk9999 commented 11 months ago

Maybe, I'm not 100% sure.

One thing you must add is LBL_PATH to your user_config.ini file (inside the setup)

For example you'll see LBL_PATH added here between DRS_DATA_ASSETS and DRS_DATA_PLOT

# Define the assets directory
#       dtype=file-path
DRS_DATA_ASSETS = /cosmos99/nirps/apero-data/nirps_ha_offline/asset

# Define the lbl directory
#       dtype=file-path
LBL_PATH = /cosmos99/nirps/apero-data/nirps_ha_offline/lbl

# Define the plotting directory
#       dtype=file-path
DRS_DATA_PLOT = /cosmos99/nirps/apero-data/nirps_ha_offline/plot
larnoldgithub commented 11 months ago

The update to 0.7.288 without changing anything to the profile settings made it for the CCF. apparently no issues with the DB.

larnoldgithub commented 11 months ago

The ini files in runs/ I'm using to run the .288 are thus from the .286. Is it OK ?

njcuk9999 commented 11 months ago

Yes unless you want to run lbl then you need to add some lines. I would suggest just creating a new profile (i.e. for a mini data test) and doing a diff between these and your old ones - just to make sure you know the differences!