Skip to content

Commit

Permalink
add tests and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaehne committed Dec 16, 2024
1 parent 73d6b54 commit a3d2f8b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
Binary file modified rsciio/tests/data/tiff/tiff_hamamatsu.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion rsciio/tests/registry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@
'tiff/test_rgba16.zip' 2a261b2618e7556ea733cd82d2f9954d414391ff46b4099ea24dc6b8c5930b4f
'tiff/tiff_FEI_Helios.zip' eb9e82342152ffd55024356cefdfeffc6c37159172e99e320132e9228f8c5e82
'tiff/tiff_Zeiss_SEM.zip' a4b4532fef22e9222682429dbe4723fff62e82bcaf17ad5142122c9999217950
'tiff/tiff_hamamatsu.zip' e977af339eeeff7158c6268a7e90da1f7a03a575031f70c0549297279df8ef89
'tiff/tiff_hamamatsu.zip' 7a01042e6b9c3b8f48822dfc543b1dde663d38de2259c53f8a80574c32908d37
'trivista/linescan.tvf' ff6b9d648901e11bd79b5964c49f7e0e6f6bff38dba061dc347baddcaa0a1f6f
'trivista/map.tvf' 1c734dcb6548236d68b8d90ea4d930c0ff2c0dd13bd58506df0a6bfd94790ab6
'trivista/spec_1s_1acc_1frame_average.tvf' b1b1ae0de7acbe53376ccdfde20159a687b18e663cc5127c569ebe0bebae5dd6
Expand Down
17 changes: 17 additions & 0 deletions rsciio/tests/test_tiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,23 @@ def test_hamamatsu_streak_focusfile(self):
np.testing.assert_allclose(s.axes_manager[0].scale, 0.01714, rtol=1e-3)
np.testing.assert_allclose(s.axes_manager[0].offset, 231.0909, rtol=1e-3)

def test_hamamatsu_streak_otherfile(self):
# Test case where ScalingXScalingFile="Other"
file = "test_hamamatsu_streak_OTHER.tif"
fname = os.path.join(self.path, file)

with pytest.warns(UserWarning):
s = hs.load(fname)

assert s.axes_manager.signal_shape == (672, 508)
assert s.axes_manager.navigation_shape == ()
assert s.data.shape == (508, 672)
assert s.axes_manager[1].units == ""
np.testing.assert_allclose(s.axes_manager[1].scale, 1.0, rtol=1e-3)
np.testing.assert_allclose(s.axes_manager[1].offset, 0.0, rtol=1e-3, atol=1e-5)
np.testing.assert_allclose(s.axes_manager[0].scale, 1.0, rtol=1e-3)
np.testing.assert_allclose(s.axes_manager[0].offset, 0.0, rtol=1e-3, atol=1e-5)

def test_hamamatsu_streak_non_uniform_load(self):
file = "test_hamamatsu_streak_SCAN.tif"
fname = os.path.join(self.path, file)
Expand Down
1 change: 1 addition & 0 deletions upcoming_changes/347.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow reading of Hamamatsu tiff file with ``ScalingXScalingFile="Other"``.

0 comments on commit a3d2f8b

Please sign in to comment.