Skip to content

CTE Corr not working with new darknight cutoff date #2587

@jbanovetz

Description

@jbanovetz

I am trying to implement a cutoff date of 20240509 in which before that day the pipeline uses a non-linear dark model and afterwards, it uses a linear dark model using darknight (see desispec-#2571). The lines of code I changed were in

dodarks = 'dark' in proc_obstypes and len(dark_expid_to_process) > 0 # 'darknight' not in files_to_link and

Which now reads:

` # Only submit pdark if it is after 30 days before 20240509 (see desispec issue #2571)

dark_date=night>20240408

dodarks = 'dark' in proc_obstypes and len(dark_expid_to_process) > 0 and dark_date # 'darknight' not in files_to_link and`

And in

do_darknight = not calibjobs['accounted_for']['darknight']
, which now reads:

`# Only do darknight if date is past 20240509 (see desispec issue #2571)

dark_date = np.median(cal_etable['NIGHT']) > 20240509

do_darknight = not calibjobs['accounted_for']['darknight'] and dark_date` 

in my local desispec. When doing dry runs of desi_proc_night, the changes have the intended effect, before the cutoff date no jobs for preprocessing the darks and darknight are made, and afterwards vice versa. However when trying to test it without a dry-run, there is an error in the ccdcalib job with correct_cte. The date used was 20231218 and the traceback is:

""" Traceback (most recent call last): File "/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/multiprocessing/pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/multiprocessing/pool.py", line 48, in mapstar return list(map(*args)) File "/global/cfs/cdirs/desi/users/banovetz/desispec/py/desispec/scripts/fit_cte_night.py", line 56, in _fit_cte_night_kwargs_wrapper out = desispec.correct_cte.fit_cte_night(night=opts["night"],camera=opts["camera"],expids=opts["expids"]) File "/global/cfs/cdirs/desi/users/banovetz/desispec/py/desispec/correct_cte.py", line 805, in fit_cte_night return fit_cte(images) File "/global/cfs/cdirs/desi/users/banovetz/desispec/py/desispec/correct_cte.py", line 598, in fit_cte assert image.meta['OBSTYPE'] == obstype AssertionError """

But I also see this which might be a hint:

`INFO:correct_cte.py:776:get_cte_images: Wrote /global/cfs/cdirs/desi/spectro/redux/banovetz/preproc/20231218/00210511/ctepreproc-r6-00210511.fits.gz

WARNING:correct_cte.py:593:fit_cte: Really should not use this function with a non-flat?!`

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions