From a4ad94d6ad60a6a4dfc061e98f1b52c559942c3c Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Tue, 23 Jul 2024 18:04:07 -0700 Subject: [PATCH] Fix bug with file loaded as float (#341) --- CHANGELOG.rst | 8 ++++++++ aiapy/calibrate/spikes.py | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a37bd12..d137729 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,11 @@ +0.9.1 (2024-07-23) +================== + +Bug Fixes +--------- + +- Fixed Spike issue with data being loaded as floats. + 0.9.0 (2024-07-22) ================== diff --git a/aiapy/calibrate/spikes.py b/aiapy/calibrate/spikes.py index b63c07d..c4e8f3d 100644 --- a/aiapy/calibrate/spikes.py +++ b/aiapy/calibrate/spikes.py @@ -147,7 +147,8 @@ def fetch_spikes(smap, *, as_coords=False): seg="spikes", ) _, spikes = fits.open(f'http://jsoc.stanford.edu{file["spikes"][0]}') - spikes = spikes.data + # Loaded as floats, but they are actually integers + spikes = spikes.data.astype(np.int32) shape_full_frame = (4096, 4096) values = spikes[1, :] y_coords, x_coords = np.unravel_index(spikes[0, :], shape=shape_full_frame)