Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with file loaded as float #341

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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)

Check warning on line 151 in aiapy/calibrate/spikes.py

View check run for this annotation

Codecov / codecov/patch

aiapy/calibrate/spikes.py#L151

Added line #L151 was not covered by tests
shape_full_frame = (4096, 4096)
values = spikes[1, :]
y_coords, x_coords = np.unravel_index(spikes[0, :], shape=shape_full_frame)
Expand Down
Loading