Skip to content

Commit

Permalink
Make updateHeaders.py idempotent.
Browse files Browse the repository at this point in the history
  • Loading branch information
hugobuddel committed Nov 9, 2024
1 parent edfb833 commit f383864
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ESO/updateHeaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def updateHeaders(inDir,outDir):
# get the tech and filter keywords

tech = hdul[0].header['HIERARCH ESO DPR TECH']
mode = hdul[0].header['HIERARCH ESO INS MODE']
filt = hdul[0].header['HIERARCH ESO DRS FILTER']
print(fName,tech)

Expand All @@ -74,14 +75,14 @@ def updateHeaders(inDir,outDir):
hdul[0].header['HIERARCH ESO INS OPTI13 NAME'] = filt

#IFU
if(tech == "LMS"):
if(tech == "LMS" or mode == "IFU_nominal"):
hdul[0].header['HIERARCH ESO INS MODE'] = "IFU_nominal"
hdul[0].header['HIERARCH ESO INS OPTI6 NAME'] = filt
hdul[0].header['HIERARCH ESO DRS IFU'] = filt
hdul[0].header['HIERARCH ESO DPR TECH'] = "IFU"

#HCI
if(tech == "RAVC,LM"):
if(tech == "RAVC,LM" or mode == "IMG_LM_RAVC"):
hdul[0].header['HIERARCH ESO INS OPTI10 NAME'] = filt
hdul[0].header['HIERARCH ESO INS MODE'] = "IMG_LM_RAVC"
hdul[0].header['HIERARCH ESO DRS MASK'] = "VPM-L,RAP-LM,RLS-LMS"
Expand All @@ -90,7 +91,7 @@ def updateHeaders(inDir,outDir):
hdul[0].header['HIERARCH ESO INS OPTI5 NAME'] = "RLS-LMS"
hdul[0].header['HIERARCH ESO DPR TECH'] = "IMAGE,LM"

if(tech == "APP,LM"):
if(tech == "APP,LM" or mode == "IMG_LM_APP"):
hdul[0].header['HIERARCH ESO INS OPTI10 NAME'] = filt
hdul[0].header['HIERARCH ESO INS MODE'] = "IMG_LM_APP"
hdul[0].header['HIERARCH ESO DPR TECH'] = "IMAGE,LM"
Expand All @@ -99,7 +100,7 @@ def updateHeaders(inDir,outDir):
hdul[0].header['HIERARCH ESO INS OPTI5 NAME'] = "APP-LMS"
hdul[0].header['HIERARCH ESO DRS MASK'] = "VPM-L,RAP-LM,APP-LMS"

if(tech == "RAVC,IFU"):
if(tech == "RAVC,IFU" or mode == "IFU_nominal_RAVC"):
hdul[0].header['HIERARCH ESO INS OPTI6 NAME'] = filt
hdul[0].header['HIERARCH ESO INS MODE'] = "IFU_nominal_RAVC"
hdul[0].header['HIERARCH ESO DRS IFU'] = filt
Expand Down

0 comments on commit f383864

Please sign in to comment.