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
ffdd0a96
Commit
ffdd0a96
authored
Aug 13, 2024
by
WeidenthalerMatthias
Browse files
Merge pull request !9 from WeidenthalerMatthias/feature.getval
parents
65a9a16a
52058e47
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
ffdd0a96
...
...
@@ -111,6 +111,24 @@ fsspec_fits.getdata( in_ref_shutter, ext=1)
fsspec_fits
.
getdata
(
in_ref_shutter
,
s3_options
=
s3_options
,
ext
=
1
)
```
### fits.getval
#### 老写法
```
python
fits
.
getval
(
filename
,
keyword
)
fits
.
getval
(
filename
,
keyword
,
ext
=
1
)
``
`
usage
reference
:
[
https
:
//
docs
.
astropy
.
org
/
en
/
stable
/
io
/
fits
/
api
/
files
.
html
#getdata](https://docs.astropy.org/en/stable/io/fits/api/files.html#getval)
#### 新写法
``
`
python
from
csst_fs
import
fsspec_fits
fsspec_fits
.
getval
(
filename
,
keyword
)
fsspec_fits
.
getval
(
filename
,
keyword
,
s3_options
=
s3_options
)
fsspec_fits
.
getval
(
filename
,
keyword
,
ext
=
1
)
fsspec_fits
.
getval
(
filename
,
keyword
,
s3_options
=
s3_options
,
ext
=
1
)
``
`
### header.tofile
#### 老写法
``
`
python
...
...
csst_fs/fits/fsspec_fits.py
View file @
ffdd0a96
...
...
@@ -9,6 +9,10 @@ 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
getval
(
filename
,
keyword
,
*
args
,
s3_options
=
load_s3_options
(),
**
kwargs
):
fileobj
=
open_fileobj
(
filename
,
s3_options
,
mode
=
'rb'
)
return
fits
.
getval
(
fileobj
,
keyword
,
*
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
return
fits
.
getheader
(
fileobj
,
*
args
,
**
kwargs
)
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