-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Martin Durant
committed
Sep 18, 2018
1 parent
c8e935b
commit fcb8a26
Showing
3 changed files
with
122 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,72 @@ | ||
Quickstart | ||
========== | ||
|
||
``intake-astro`` provides quick and easy access to tabular or array data stored | ||
in the astronomical FITS_ binary format. | ||
|
||
.. _FITS: https://fits.gsfc.nasa.gov/fits_documentation.html | ||
|
||
Although the plugin uses astropy_ under the hood, it provides extra facility for remote | ||
files and partitioned access. | ||
|
||
.. _astropy: http://docs.astropy.org/ | ||
|
||
Installation | ||
------------ | ||
|
||
To use this plugin for `intake`_, install with the following command:: | ||
|
||
conda install -c intake intake-astro | ||
|
||
.. _intake: https://github.com/ContinuumIO/intake | ||
|
||
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 | ||
|
||
.. code-block:: python | ||
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. | ||
|
||
.. code-block:: yaml | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters