hipspy / hips

Python library to handle HiPS
https://hips.readthedocs.io
13 stars 16 forks source link

HIPS FITS tiles truncated? #42

Closed cdeil closed 7 years ago

cdeil commented 7 years ago

When running the tests, at the end warnings like these appear:

WARNING: File may have been truncated: actual file length (527168) is smaller than the expected size (529920) [astropy.io.fits.file]

This has nothing to do with our hips package, I think the FITS tiles in hips-extra might simply have some issue:

In [1]: from astropy.io import fits

In [2]: fits.open('datasets/samples/IRAC4/Norder3/Dir0/Npix307.fits')
WARNING: File may have been truncated: actual file length (1051456) is smaller than the expected size (1054080) [astropy.io.fits.file]
Out[2]: [<astropy.io.fits.hdu.image.PrimaryHDU object at 0x109d6aef0>]
$ ftverify datasets/samples/IRAC4/Norder3/Dir0/Npix307.fits

               ftverify 4.17 (CFITSIO V3.370)               
               ------------------------------               

HEASARC conventions are being checked.

File: datasets/samples/IRAC4/Norder3/Dir0/Npix307.fits

1 Header-Data Units in this file.

=================== HDU 1: Primary Array ===================

*** Error:   checking data fill: error reading from FITS file

 8 header keywords

 32-bit floating point pixels,  2 axes (512 x 512), 

++++++++++++++++++++++ Error Summary  ++++++++++++++++++++++

 HDU#  Name (version)       Type             Warnings  Errors
 1                          Primary Array    0         1     

**** Verification found 0 warning(s) and 1 error(s). ****

@tboch - Can you please have a look?

tboch commented 7 years ago

Yes indeed, FITS tiles we (CDS) generated some time ago are not FITS-valid as they are missing the final bytes (the total size is not a multiple of 2880). At the time, we thought that was a good idea as to save a couple of bytes times the number of tiles. We have changed our mind since :)

This generates some warnings when reading them, but actual data is fine.

Unless you disagree, I think we can close this one

cdeil commented 7 years ago

I would suggest this: #46

cdeil commented 7 years ago

Resolved in #46 by suppressing the warnings on FITS tile read.