Skip to content

Commit

Permalink
add "NEARCHARGETRAPFIBERS","VARIABLETHRUFIBERS" to the list of possib…
Browse files Browse the repository at this point in the history
…le keys for routine badfibers(keys)
  • Loading branch information
julienguy committed Aug 8, 2024
1 parent edc6f41 commit 920cb2b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions py/desispec/calibfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def findfile(self,key) :
"""
return os.path.join(self.directory,self.data[key])

def badfibers(self,keys=["BROKENFIBERS","BADCOLUMNFIBERS","LOWTRANSMISSIONFIBERS","BADAMPFIBERS","EXCLUDEFIBERS"]) :
def badfibers(self,keys=["BROKENFIBERS","BADCOLUMNFIBERS","LOWTRANSMISSIONFIBERS","BADAMPFIBERS","EXCLUDEFIBERS","NEARCHARGETRAPFIBERS", "VARIABLETHRUFIBERS"]) :
"""
Args:
keys: optional, list of keywords, among BROKENFIBERS,BADCOLUMNFIBERS,LOWTRANSMISSIONFIBERS,BADAMPFIBERS,EXCLUDEFIBERS. Default is all of them.
Expand All @@ -396,7 +396,7 @@ def badfibers(self,keys=["BROKENFIBERS","BADCOLUMNFIBERS","LOWTRANSMISSIONFIBERS
"""
log = get_logger()
fibers=[]
badfiber_keywords=["BROKENFIBERS","BADCOLUMNFIBERS","LOWTRANSMISSIONFIBERS","BADAMPFIBERS","EXCLUDEFIBERS"]
badfiber_keywords=["BROKENFIBERS","BADCOLUMNFIBERS","LOWTRANSMISSIONFIBERS","BADAMPFIBERS","EXCLUDEFIBERS","NEARCHARGETRAPFIBERS","VARIABLETHRUFIBERS"]
for key in keys :
if key not in badfiber_keywords :
log.error(f"key '{key}' not in the list of valid keys for bad fibers: {validkeys}")
Expand Down Expand Up @@ -512,7 +512,7 @@ def find_darks_in_desi_spectro_dark(self, header):
continue
else:
log.debug(f'Temperature difference to selected dark is {np.abs(dark_entry["CCDTEMP"] - header["CCDTEMP"]):.5f}')

#same for bias
if bias_entry["DETECTOR"].strip() != self.data["DETECTOR"].strip() :
log.debug("Skip file %s with DETECTOR=%s != %s"%(bias_entry["FILENAME"],bias_entry["DETECTOR"],self.data["DETECTOR"]))
Expand All @@ -531,7 +531,7 @@ def find_darks_in_desi_spectro_dark(self, header):
continue
else:
log.debug(f'Temperature difference to selected bias is {np.abs(bias_entry["CCDTEMP"] - header["CCDTEMP"]):.5f}')

found=True
log.debug(f"Found matching dark frames for camera {cameraid} created on {date_used}")
break
Expand Down Expand Up @@ -562,4 +562,3 @@ def find_darks_in_desi_spectro_dark(self, header):
#this would prevent nightwatch failures in case of not-yet-existing files
log.error(f"Didn't find matching {camera} calibration darks in $DESI_SPECTRO_DARK, "
"falling back to $DESI_SPECTRO_CALIB")

0 comments on commit 920cb2b

Please sign in to comment.