Skip to content

Commit

Permalink
Merge pull request #397 from LCOGT/read-fits-in-memory
Browse files Browse the repository at this point in the history
Added the ability to read fits files that are pre downloaded and are already in memory
  • Loading branch information
cmccully authored Nov 5, 2024
2 parents 0c331f9 + 96fa396 commit d9f041f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
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

0 comments on commit d9f041f

Please sign in to comment.