Skip to content

Commit

Permalink
Merge pull request #2405 from desihub/fix_require_unset_for_calibs
Browse files Browse the repository at this point in the history
allow fallback to darks/biases in DESI_SPECTRO_CALIB if running ccdcalib
  • Loading branch information
sbailey authored Dec 3, 2024
2 parents 5314f92 + cba4685 commit 2b0b667
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions py/desispec/ccdcalib.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def compute_dark_file(rawfiles, outfile, camera, bias=None, nocosmic=False,

# read raw data and preprocess them
img = io.read_raw(filename, camera, bias=thisbias, nocosmic=nocosmic,
mask=False, dark=False, pixflat=False)
mask=False, dark=False, pixflat=False, fallback_on_dark_not_found=True)

# propagate gains to first_image_header
for a in get_amp_ids(img.meta) :
Expand Down Expand Up @@ -276,7 +276,7 @@ def compute_bias_file(rawfiles, outfile, camera, explistfile=None,
raise ValueError(message)

# subtract overscan region
cfinder=CalibFinder([image_header,primary_header])
cfinder=CalibFinder([image_header,primary_header],fallback_on_dark_not_found=True)

image=fitsfile[camera].data.astype("float64")

Expand Down Expand Up @@ -674,7 +674,7 @@ def compute_nightly_bias(night, cameras, outdir=None, nzeros=25, minzeros=15,
rawhdr = fx['SPEC'].read_header()
camhdr = fx[camera].read_header()

cf = CalibFinder([rawhdr, camhdr])
cf = CalibFinder([rawhdr, camhdr],fallback_on_dark_not_found=True)
defaultbias = cf.findfile('BIAS')

log.info(f'Comparing {night} {camera} nightly bias to {defaultbias} using {os.path.basename(rawtestfile)}')
Expand Down

0 comments on commit 2b0b667

Please sign in to comment.