Skip to content

Commit 3518cae

Browse files
committed
Loose identity test of a HCOMPRESSed image
HCOMPRESSed images are allowed to deviate from the original by about 1/quantize_level of the RMS in each tile. This patch changes the absolute identity test to a comparison with an accuracy up to the mentioned level. This fixes astropy#4647, if the cause I assume is correct. Someone with insight in HCOMPRESS should check this carefully, however.
1 parent 1862f24 commit 3518cae

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎CHANGES.rst‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,8 @@ Bug fixes
450450

451451
- ``astropy.io.fits``
452452

453+
- Fix "HCOMPRESS 1" image test failure with cfitsio-3.380. [#4646]
454+
453455
- ``astropy.io.misc``
454456

455457
- ``astropy.io.votable``

‎astropy/io/fits/tests/test_image.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ def test_comp_image_hcompress_image_stack(self):
10101010
hdu.writeto(self.temp('test.fits'))
10111011

10121012
with fits.open(self.temp('test.fits')) as hdul:
1013-
assert (hdul['SCI'].data == cube).all()
1013+
assert np.abs(hdul['SCI'].data - cube).max() < 1./15.
10141014

10151015
def test_subtractive_dither_seed(self):
10161016
"""

0 commit comments

Comments
 (0)