Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-pipeline
csst_common
Commits
e5a99a1c
Commit
e5a99a1c
authored
Oct 25, 2025
by
BO ZHANG
🏀
Browse files
add prepare_fits_files_for_ingestion()
parent
36ed8333
Pipeline
#10961
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
csst_common/fits.py
View file @
e5a99a1c
...
...
@@ -9,6 +9,8 @@ Modified-History:
"""
import
io
import
os.path
from
astropy.io.fits
import
*
from
astropy.io
import
fits
as
astropy_fits
from
csst_fs.s3_config
import
load_s3_options
...
...
@@ -71,3 +73,18 @@ class HDUList(astropy_fits.HDUList):
self
.
writeto
(
memory_buffer
)
fits_bytes
=
memory_buffer
.
getvalue
()
return
fits_bytes
def
prepare_fits_files_for_ingestion
(
files
:
list
[
str
])
->
list
[
dict
]:
"""Prepare FITS files for ingestion."""
ingestion_files
=
[]
for
file
in
files
:
with
open
(
file
)
as
hl
:
fits_bytes
=
hl
.
to_bytes
()
ingestion_files
.
append
(
{
"file_name"
:
os
.
path
.
basename
(
file
),
"file_content"
:
fits_bytes
,
}
)
return
ingestion_files
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment