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

Added the ability to read fits files that are pre downloaded and are already in memory #397

Merged
merged 3 commits into from
Nov 5, 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
10 changes: 5 additions & 5 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ jobs:
python-version: 3.9
toxenv: build_docs

- name: Python 3.8 with minimal dependencies
os: ubuntu-latest
python-version: '3.8'
toxenv: py38-test

- name: Python 3.9 with minimal dependencies
os: ubuntu-latest
python-version: '3.9'
Expand All @@ -33,6 +28,11 @@ jobs:
python-version: '3.10'
toxenv: py310-test

- name: Python 3.11 with minimal dependencies
os: ubuntu-latest
python-version: '3.11'
toxenv: py311-test

- name: Code style checks
os: ubuntu-latest
python-version: 3.9
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.19.0 (2024-10-16)
-------------------
- Added the ability to read fits files that are pre downloaded and are already in memory

1.18.4 (2024-10-18)
-------------------
- Fix to the url of the observation portal in the deployment.
Expand Down
6 changes: 5 additions & 1 deletion banzai/utils/fits_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ def basename_search_in_archive(filename, dateobs, context, is_raw_frame=False):


def open_fits_file(file_info, context, is_raw_frame=False):
if file_info.get('path') is not None and os.path.exists(file_info.get('path')):
if file_info.get('data_buffer') is not None:
filename = file_info.get('filename')
frame_id = None
buffer = file_info.get('data_buffer')
elif file_info.get('path') is not None and os.path.exists(file_info.get('path')):
buffer = open(file_info.get('path'), 'rb')
filename = os.path.basename(file_info.get('path'))
frame_id = None
Expand Down
Loading