Details
-
Type:
Bug
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: afw
-
Labels:None
-
Story Points:1
-
Epic Link:
-
Sprint:DRP F18-4
-
Team:Data Release Production
Description
Writing an uncompressed Image with an unsigned integer type to FITS with our code results in a BZERO value one less than what CFITSIO or astropy write (without our code intervening in the cast of CFITSIO), and this confuses CFITSIO, astropy, and our own code about the type of the pixels when reading the image back in (because the convention is to use BZERO to distinguish between signed and unsigned types). I'm not sure if the same problem appears in compressed images or not.
I think this can be fixed by modifying the Bzero traits class in fitsCompression.cc, and if that's right most of the work here will just be test code.
My thinking was that ZBLANK shouldn't exist when decompressed is floating-point, because BLANK shouldn't exist for floating-point. And ZBLANK shouldn't exist (for us) when decompressed is integer, because our integer images never have missing pixels. But that view considers quantization and compression to be a single step, and I'm not sure how valid that is.
But I certainly agree that tests are probably the only way to resolve this. I'm guessing we just need to demonstrate that we can round-trip a floating-point image with a NaN in it through quantization and compression?