Keck-DataReductionPipelines / KCWI_DRP

KCWI python DRP
BSD 3-Clause "New" or "Revised" License
8 stars 12 forks source link

wavemap error when using archival filename convention #77

Closed rcooke-ast closed 3 years ago

rcooke-ast commented 3 years ago

Hi - On line 89 of MakeMasterSky.py the code appears to be reading in the original file name (but it's possible that I'm missing something):

groot = tab['OFNAME'][0].split('.fits')[0]

Is there a workaround for dealing with data downloaded from the archive (that have a different filename convention)? Here is the full traceback:

2021-06-11 11:23:35:KCWI:INFO: Looking for ARCLAMP frames
2021-06-11 11:23:35:KCWI:INFO: Reading image: kb191219_00036_wavemap.fits
[Errno 2] No such file or directory: 'redux/kb191219_00036_wavemap.fits'
2021-06-11 11:23:35:DRPF:ERROR: Exception [Errno 2] No such file or directory: 'redux/kb191219_00036_wavemap.fits' while invoking MakeMasterSky
Traceback (most recent call last):
  File "/Users/rcooke/anaconda3/lib/python3.7/site-packages/keckdrpframework/core/framework.py", line 229, in execute
    action_output = pipeline.get_action(action_name)(action, context)
  File "/Users/rcooke/anaconda3/lib/python3.7/site-packages/keckdrpframework/pipelines/base_pipeline.py", line 84, in f
    return obj.apply()
  File "/Users/rcooke/anaconda3/lib/python3.7/site-packages/keckdrpframework/primitives/base_primitive.py", line 57, in apply
    self.output = self._perform()
  File "/Users/rcooke/anaconda3/lib/python3.7/site-packages/kcwidrp/primitives/MakeMasterSky.py", line 96, in _perform
    wmf))[0]
  File "/Users/rcooke/anaconda3/lib/python3.7/site-packages/kcwidrp/primitives/kcwi_file_primitives.py", line 559, in kcwi_fits_reader
    raise e
  File "/Users/rcooke/anaconda3/lib/python3.7/site-packages/kcwidrp/primitives/kcwi_file_primitives.py", line 556, in kcwi_fits_reader
    hdul = fits.open(file)
  File "/Users/rcooke/anaconda3/lib/python3.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 164, in fitsopen
    lazy_load_hdus, **kwargs)
  File "/Users/rcooke/anaconda3/lib/python3.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 402, in fromfile
    lazy_load_hdus=lazy_load_hdus, **kwargs)
  File "/Users/rcooke/anaconda3/lib/python3.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 1051, in _readfrom
    fileobj = _File(fileobj, mode=mode, memmap=memmap, cache=cache)
  File "/Users/rcooke/anaconda3/lib/python3.7/site-packages/astropy/utils/decorators.py", line 535, in wrapper
    return function(*args, **kwargs)
  File "/Users/rcooke/anaconda3/lib/python3.7/site-packages/astropy/io/fits/file.py", line 175, in __init__
    self._open_filename(fileobj, mode, overwrite)
  File "/Users/rcooke/anaconda3/lib/python3.7/site-packages/astropy/io/fits/file.py", line 564, in _open_filename
    self._file = fileobj_open(self.name, IO_FITS_MODES[mode])
  File "/Users/rcooke/anaconda3/lib/python3.7/site-packages/astropy/io/fits/util.py", line 397, in fileobj_open
    return open(filename, mode, buffering=0)
FileNotFoundError: [Errno 2] No such file or directory: 'redux/kb191219_00036_wavemap.fits'
2021-06-11 11:23:35:DRPF:INFO: Event failed: name object_make_sky, action MakeMasterSky, arg name KB.20191219.40218.fits.gz, recurr False
MNBrod commented 3 years ago

This bug has been identified and fixed, and should no longer be an issue after our next release, which (coincidentally) is scheduled for later today. Sorry about that!

rcooke-ast commented 3 years ago

Great - thanks very much for the quick response! I'll grab the new release tomorrow.