Quickstart¶
intake-astro
provides quick and easy access to tabular or array data stored
in the astronomical FITS binary format.
Although the plugin uses astropy under the hood, it provides extra facility for remote files and partitioned access.
Installation¶
To use this plugin for intake, install with the following command:
conda install -c intake intake-astro
Usage¶
Ad-hoc¶
After installation, the functions intake.open_fits_array
and intake.open_fits_table
will become available. They can be used to load data from local or remote data
import intake
source = intake.open_fits_array('/data/fits/set*.fits', ext=1)
darr = source.to_dask() # for parallel access,
arr = source.read() # to read into memory
wcs = source.wcs # WCS will be set from first file, if possible
In this case, “parallel access” will mean one partition per input file, but partitioning within files is also possible (only recommended for uncompressed input).
Creating Catalog Entries¶
To use, catalog entries must specify driver: `` with one of the two plugins
available here, ``fits_table
, fits_array
. The data source specs will have the
same parameters as the equivalent open functions. In the following example, the files might
happen to be stored on amazon S3, to be accesses anonymously.
sources:
some_astro_arr:
driver: fits_array
args:
url: s3://mybucket/fits/*.fits
ext: 0
storage_options:
anon: true
Using a Catalog¶
Assuming the existence of catalogs with blocks such as that above, the data-sets can be
accessed with the usual intake pattern, i.e., the methods discover()
, read()
, etc.
As with other array-type plugins, the input to read_partition()
for the fits_array plugin
is generally a tuple of int.