Skip to content

Commit

Permalink
Fix bug with file loaded as float (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
nabobalis authored Jul 24, 2024
1 parent bfc051c commit a4ad94d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -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)
==================

Expand Down
3 changes: 2 additions & 1 deletion aiapy/calibrate/spikes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a4ad94d

Please sign in to comment.