<div dir="ltr">+1 on this topic.  DESI has had the same problem, but we have not succeeded in boiling it down to a simple test case for a bug report.  It seems related to the compressed image HDU, but we have other files using CompImageHDU that do not have this problem and we don't know what the difference is.<div><br></div><div>Stephen</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 16, 2016 at 8:48 PM, John K. Parejko <span dir="ltr"><<a href="mailto:parejkoj@uw.edu" target="_blank">parejkoj@uw.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">cc:ing William Pence, as this may be an odd interaction between astropy.io.fits and cfitsio.<br>
<br>
In an effort to reduce the size of some LSST test data, I converted the three image HDUs in a file to compressed image HDUs like so:<br>
<br>
from <a href="http://astropy.io" rel="noreferrer" target="_blank">astropy.io</a> import fits<br>
data = fits.open('somefile.fits')<br>
for i in [1,2,3]:<br>
    data[i] = fits.CompImageHDU(data=data[i].data,header=data[i].header)<br>
data.writeto(f, clobber=True)<br>
<br>
If I open the new file with pyfits, all of the HDUs seem fine, but now cfitsio doesn't appear to like the files. Erin Sheldon's fitsio only sees the first 2 HDUs. So does the online FITS tester webpage:<br>
<br>
<a href="http://fits.gsfc.nasa.gov/fits_verify.html" rel="noreferrer" target="_blank">http://fits.gsfc.nasa.gov/fits_verify.html</a><br>
<br>
DS9 seems to read it ok: I can specify "-mecube" and see all three image planes.<br>
<br>
Is what I did above not allowed for some reason, or did I do something wrong?<br>
<br>
I've put up the original file, the file with 3 HDUs tile-compressed, and (the original goal of this) a file with the 3 image HDUs zeroed out and then compressed (I wanted a file with the structure of the original, but taking minimal space):<br>
<br>
<a href="http://staff.washington.edu/parejkoj/lsst/" rel="noreferrer" target="_blank">http://staff.washington.edu/parejkoj/lsst/</a><br>
<br>
Ideas and suggestions welcome!<br>
<br>
Thanks in advance,<br>
John<br>
<br>
--<br>
*************************<br>
John Parejko<br>
<a href="mailto:parejkoj@uw.edu">parejkoj@uw.edu</a><br>
<a href="http://staff.washington.edu/parejkoj/" rel="noreferrer" target="_blank">http://staff.washington.edu/parejkoj/</a><br>
Department of Physics and Astronomy<br>
University of Washington<br>
Seattle, WA<br>
**************************<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
AstroPy mailing list<br>
<a href="mailto:AstroPy@scipy.org">AstroPy@scipy.org</a><br>
<a href="https://mail.scipy.org/mailman/listinfo/astropy" rel="noreferrer" target="_blank">https://mail.scipy.org/mailman/listinfo/astropy</a><br>
</blockquote></div><br></div>