Commit 52058e47 authored by Matthias Weidenthaler's avatar Matthias Weidenthaler
Browse files

Added astropy.io.fits.getval functionality

parent 65a9a16a
......@@ -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
......
......@@ -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)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment