Skip to content

Commit f476436

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 f476436

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,9 @@ 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+
# HCOMPRESSed images are allowed to deviate from the original by
1014+
# about 1/quantize_level of the RMS in each tile.
1015+
assert np.abs(hdul['SCI'].data - cube).max() < 1./15.
10141016

10151017
def test_subtractive_dither_seed(self):
10161018
"""

0 commit comments

Comments
 (0)