dkirkby / bossdata

Tools for accessing SDSS BOSS data
MIT License
1 stars 3 forks source link

Inconsistent exposures for 6138-56598 #117

Open dmargala opened 8 years ago

dmargala commented 8 years ago

The exposure list in the header of the spPlate file is incomplete. This is a known issue, see [eboss-pipeline 5123].

spec_name = finder.get_spec_path(6138, 56598, fiber=1, lite=True)
spec_file = bossdata.spec.SpecFile(mirror.get(spec_name))
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-9-e903f72ffc58> in <module>()
----> 1 bossdata.spec.SpecFile(mirror.get(spec_name))

/usr/local/share/anaconda/lib/python2.7/site-packages/bossdata-0.2.9.dev0-py2.7.egg/bossdata/spec.pyc in __init__(self, path)
    332         self.header = self.hdulist[0].read_header()
    333         # Look up the available exposures.
--> 334         self.exposures = Exposures(self.header)
    335         self.num_exposures = len(self.exposures.sequence)
    336         # Look up our row from spAll

/usr/local/share/anaconda/lib/python2.7/site-packages/bossdata-0.2.9.dev0-py2.7.egg/bossdata/spec.pyc in __init__(self, header)
    145             if self.num_by_camera[camera] != num_exposures:
    146                 raise RuntimeError('Found {} {} exposures but expected {}.'.format(
--> 147                     self.num_by_camera[camera], camera, num_exposures))
    148             camera_rows = self.table['camera'] == camera
    149             camera_exposures = set(self.table[camera_rows]['science'])

RuntimeError: Found 31 r1 exposures but expected 34.
dkirkby commented 8 years ago

At least the code throws a sensible exception for what is effectively bad input data. Should we treat this as a special case in the code, or just add a warning to the docs?

dmargala commented 8 years ago

As a user, I would like this to be treated as a special case :smile:. The root cause of the problem in the pipeline is supposedly fixed for future data. What would a special case fix look like, hardcoding the exposure filenames for this observation?