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_fs
Commits
3f4284d5
Commit
3f4284d5
authored
Jul 25, 2024
by
WeidenthalerMatthias
Browse files
Merge pull request !7 from WeidenthalerMatthias/fix.function_arguments
parents
22dd7754
b3fb43a5
Changes
3
Hide whitespace changes
Inline
Side-by-side
csst_fs/fits/fsspec_fits.py
View file @
3f4284d5
...
...
@@ -2,13 +2,13 @@ from astropy.io import fits
from
..fsspec_fileobj
import
open_fileobj
from
..s3_config
import
load_s3_options
def
open
(
filename
,
s3_options
=
load_s3_options
(),
*
args
,
**
kwargs
):
return
fits
.
open
(
filename
,
fsspec_kwargs
=
s3_options
,
*
args
,
**
kwargs
)
def
open
(
filename
,
*
args
,
s3_options
=
load_s3_options
(),
**
kwargs
):
return
fits
.
open
(
filename
,
*
args
,
fsspec_kwargs
=
s3_options
,
**
kwargs
)
def
getdata
(
filename
,
s3_options
=
load_s3_options
(),
*
args
,
**
kwargs
):
def
getdata
(
filename
,
*
args
,
s3_options
=
load_s3_options
(),
**
kwargs
):
fileobj
=
open_fileobj
(
filename
,
s3_options
,
mode
=
'rb'
)
return
fits
.
getdata
(
fileobj
,
*
args
,
**
kwargs
)
def
getheader
(
filename
,
s3_options
=
load_s3_options
(),
*
args
,
**
kwargs
):
def
getheader
(
filename
,
*
args
,
s3_options
=
load_s3_options
(),
**
kwargs
):
fileobj
=
open_fileobj
(
filename
,
s3_options
,
mode
=
'rb'
)
return
fits
.
getheader
(
fileobj
,
*
args
,
**
kwargs
)
\ No newline at end of file
csst_fs/fits/fsspec_header.py
View file @
3f4284d5
...
...
@@ -3,12 +3,12 @@ from astropy.io import fits
from
..fsspec_fileobj
import
open_fileobj
from
..s3_config
import
load_s3_options
def
tofile
(
fits_header
,
out_path
,
s3_options
=
load_s3_options
(),
*
args
,
**
kwargs
):
def
tofile
(
fits_header
,
out_path
,
*
args
,
s3_options
=
load_s3_options
(),
**
kwargs
):
fileobj
=
open_fileobj
(
out_path
,
s3_options
,
mode
=
'wb'
)
fits_header
.
tofile
(
fileobj
,
*
args
,
**
kwargs
)
if
hasattr
(
fileobj
,
'close'
):
fileobj
.
close
()
def
fromfile
(
filename
,
s3_options
=
load_s3_options
(),
*
args
,
**
kwargs
):
def
fromfile
(
filename
,
*
args
,
s3_options
=
load_s3_options
(),
**
kwargs
):
fileobj
=
open_fileobj
(
filename
,
s3_options
,
mode
=
'rb'
)
return
fits
.
Header
.
fromfile
(
fileobj
,
*
args
,
**
kwargs
)
\ No newline at end of file
csst_fs/table/fsspec_table.py
View file @
3f4284d5
...
...
@@ -3,10 +3,10 @@ from astropy import table
from
..fsspec_fileobj
import
open_fileobj
from
..s3_config
import
load_s3_options
def
read
(
filename
,
s3_options
=
load_s3_options
(),
*
args
,
**
kwargs
):
def
read
(
filename
,
*
args
,
s3_options
=
load_s3_options
(),
**
kwargs
):
fileobj
=
open_fileobj
(
filename
,
s3_options
,
mode
=
'rb'
)
return
table
.
Table
.
read
(
fileobj
,
*
args
,
**
kwargs
)
def
write
(
table_to_write
:
table
.
Table
,
filename
,
s3_options
=
load_s3_options
(),
*
args
,
**
kwargs
):
def
write
(
table_to_write
:
table
.
Table
,
filename
,
*
args
,
s3_options
=
load_s3_options
(),
**
kwargs
):
fileobj
=
open_fileobj
(
filename
,
s3_options
,
mode
=
'wb'
)
return
table_to_write
.
write
(
fileobj
,
*
args
,
**
kwargs
)
\ No newline at end of file
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