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
fdf621ed
Commit
fdf621ed
authored
Feb 02, 2026
by
BO ZHANG
🏀
Browse files
add *args
parent
8630bd81
Pipeline
#12154
passed with stage
in 0 seconds
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
csst_common/fits.py
View file @
fdf621ed
...
...
@@ -47,12 +47,12 @@ def prepare_fits_files_for_ingestion(files: list[str]) -> list[dict]:
return
ingestion_files
def
open
(
filename
,
**
kwargs
)
->
HDUList
:
def
open
(
filename
,
*
args
,
**
kwargs
)
->
HDUList
:
if
filename
.
startswith
(
s3_prefix
):
# read FITS file from s3
return
HDUList
(
astropy_fits
.
open
(
filename
,
use_fsspec
=
True
,
fsspec_kwargs
=
s3_options
,
**
kwargs
filename
,
*
args
,
use_fsspec
=
True
,
fsspec_kwargs
=
s3_options
,
**
kwargs
)
)
else
:
...
...
@@ -60,33 +60,33 @@ def open(filename, **kwargs) -> HDUList:
return
HDUList
(
astropy_fits
.
open
(
filename
,
**
kwargs
))
def
getheader
(
filename
,
**
kwargs
)
->
astropy_fits
.
Header
:
def
getheader
(
filename
,
*
args
,
**
kwargs
)
->
astropy_fits
.
Header
:
if
filename
.
startswith
(
s3_prefix
):
# read FITS file from s3
return
astropy_fits
.
getheader
(
filename
,
use_fsspec
=
True
,
fsspec_kwargs
=
s3_options
,
**
kwargs
filename
,
*
args
,
use_fsspec
=
True
,
fsspec_kwargs
=
s3_options
,
**
kwargs
)
else
:
# read FITS file from local
return
astropy_fits
.
getheader
(
filename
,
**
kwargs
)
def
getval
(
filename
,
**
kwargs
)
->
Any
:
def
getval
(
filename
,
*
args
,
**
kwargs
)
->
Any
:
if
filename
.
startswith
(
s3_prefix
):
# read FITS file from s3
return
astropy_fits
.
getval
(
filename
,
use_fsspec
=
True
,
fsspec_kwargs
=
s3_options
,
**
kwargs
filename
,
*
args
,
use_fsspec
=
True
,
fsspec_kwargs
=
s3_options
,
**
kwargs
)
else
:
# read FITS file from local
return
astropy_fits
.
getval
(
filename
,
**
kwargs
)
def
getdata
(
filename
,
**
kwargs
)
->
Any
:
def
getdata
(
filename
,
*
args
,
**
kwargs
)
->
Any
:
if
filename
.
startswith
(
s3_prefix
):
# read FITS file from s3
return
astropy_fits
.
getdata
(
filename
,
use_fsspec
=
True
,
fsspec_kwargs
=
s3_options
,
**
kwargs
filename
,
*
args
,
use_fsspec
=
True
,
fsspec_kwargs
=
s3_options
,
**
kwargs
)
else
:
# read FITS file from local
...
...
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