Uploaded image for project: 'DRP 2-D Pipeline'
  1. DRP 2-D Pipeline
  2. PIPE2D-704

Header missing END card in pfsObject fits

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Won't Fix (View Workflow)
    • Priority: Normal
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Testing the new master branch `w.2021.04`, I got the following error when I read `pfsObject` by using `astropy`, which does not exist in the previous version. This seems to affect 1D DRP as well because they also use `astropy`. I could read the data themselves correctly, so we can ignore this message, but ...

       

      --------------------------------------------------------------------------- OSError Traceback (most recent call last) <ipython-input-26-2f2f0d5421bb> in <module> 13 14 for pfsObject in pfsObjects: ---> 15 with fits.open(pfsObject) as hdul: 16 flx = hdul['FLUX'].data 17 var = hdul['COVAR'].data[0] /usr/local/lib/python3.7/site-packages/astropy/io/fits/hdu/hdulist.py in fitsopen(name, mode, memmap, save_backup, cache, lazy_load_hdus, **kwargs) 149 150 return HDUList.fromfile(name, mode, memmap, save_backup, cache, --> 151 lazy_load_hdus, **kwargs) 152 153 /usr/local/lib/python3.7/site-packages/astropy/io/fits/hdu/hdulist.py in fromfile(cls, fileobj, mode, memmap, save_backup, cache, lazy_load_hdus, **kwargs) 388 return cls._readfrom(fileobj=fileobj, mode=mode, memmap=memmap, 389 save_backup=save_backup, cache=cache, --> 390 lazy_load_hdus=lazy_load_hdus, **kwargs) 391 392 @classmethod /usr/local/lib/python3.7/site-packages/astropy/io/fits/hdu/hdulist.py in _readfrom(cls, fileobj, data, mode, memmap, save_backup, cache, lazy_load_hdus, **kwargs) 1062 1063 # Make sure at least the PRIMARY HDU can be read -> 1064 read_one = hdulist._read_next_hdu() 1065 1066 # If we're trying to read only and no header units were found, /usr/local/lib/python3.7/site-packages/astropy/io/fits/hdu/hdulist.py in _read_next_hdu(self) 1137 fileobj.seek(offset, os.SEEK_SET) 1138 -> 1139 hdu = _BaseHDU.readfrom(fileobj, **kwargs) 1140 except EOFError: 1141 self._read_all = True /usr/local/lib/python3.7/site-packages/astropy/io/fits/hdu/base.py in readfrom(cls, fileobj, checksum, ignore_missing_end, **kwargs) 326 hdu = cls._readfrom_internal(fileobj, checksum=checksum, 327 ignore_missing_end=ignore_missing_end, --> 328 **kwargs) 329 330 # If the checksum had to be checked the data may have already been read /usr/local/lib/python3.7/site-packages/astropy/io/fits/hdu/base.py in _readfrom_internal(cls, data, header, checksum, ignore_missing_end, **kwargs) 391 if header is None: 392 header_offset = data.tell() --> 393 header = Header.fromfile(data, endcard=not ignore_missing_end) 394 hdu_fileobj = data 395 data_offset = data.tell() # *after* reading the header /usr/local/lib/python3.7/site-packages/astropy/io/fits/header.py in fromfile(cls, fileobj, sep, endcard, padding) 445 446 return cls._from_blocks(block_iter, is_binary, sep, endcard, --> 447 padding)[1] 448 finally: 449 if close_file: /usr/local/lib/python3.7/site-packages/astropy/io/fits/header.py in _from_blocks(cls, block_iter, is_binary, sep, endcard, padding) 514 # TODO: Pass this error to validation framework as an ERROR, 515 # rather than raising an exception --> 516 raise OSError('Header missing END card.') 517 518 header_str = ''.join(read_blocks) OSError: Header missing END card.
      
      

        Attachments

          Activity

            People

            • Assignee:
              price price
              Reporter:
              kiyoto.yabe Kiyoto Yabe
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: