API Reference¶
intake_astro.FITSTableSource (url[, ext, …]) |
Read FITS tabular data into dataframes |
intake_astro.FITSArraySource (url[, ext, …]) |
Read one of more local or remote FITS files using Intake |
-
class
intake_astro.
FITSTableSource
(url, ext=0, chunksize=None, storage_options=None, metadata=None)[source]¶ Read FITS tabular data into dataframes
For one or more FITS files, which can be local or remote, with support for partitioning within files.
Parameters: - url: str or list of str
files to load. Can include protocol specifiers and/or glob characters
- ext: str or int
Extension to load. Normally 0 or 1.
- chunksize: int or None
For partitioning within files, use this many rows per partition. This is very inefficient for compressed files, and for remote files, will require at least touching each file to discover the number of rows, before even starting to read the data. Cannot be used with FITS tables with a “heap”, i.e., containing variable- length arrays.
- storage_options: dict or None
Additional keyword arguments to pass to the storage back-end.
- metadata:
Arbitrary information to associate with this source.
- After reading the schema, the source will have attributes:
- ``header`` - the full FITS header of one of the files as a dict,
- ``dtype`` - a numpy-like list of field/dtype string pairs,
- ``shape`` - where the number of rows will only be known if using
- partitioning or for a single file input.
Attributes: - cache_dirs
- datashape
- description
hvplot
Returns a hvPlot object to provide a high-level plotting API.
plot
Returns a hvPlot object to provide a high-level plotting API.
Methods
close
()Close open resources corresponding to this data source. discover
()Open resource and populate the source attributes. read
()Load entire dataset into a container and return it read_chunked
()Return iterator over container fragments of data source read_partition
(i)Return a (offset_tuple, container) corresponding to i-th partition. to_dask
()Return a dask container for this data source yaml
([with_plugin])Return YAML representation of this data-source set_cache_dir
-
class
intake_astro.
FITSArraySource
(url, ext=0, chunks=None, storage_options=None, metadata=None)[source]¶ Read one of more local or remote FITS files using Intake
At initialisation (when something calls
._get_schema()
), the header of the first file will be read and a delayed array constructed. The propertiesheader, dtype, shape, wcs
will be populated from that header, and no check is made to ensure that all files are compatible.Parameters: - url: str or list of str
Location of the data file(s). May include glob characters; may include protocol specifiers.
- ext: int or str or tuple
Extension to probe. By default, is primary extension. Can either be an integer referring to sequence number, or an extension name. If a tuple like (‘SCI’, 2), get the second extension named ‘SCI’.
- chunks: None or tuple of int
size of blocks to use within each file; must specify all axes, if using. If None, each file is one partition. Do not use chunks for compressed data, and only use contiguous chunks for remote data.
- storage_options: dics
Parameters to pass on to storage backend
Attributes: - cache_dirs
- datashape
- description
hvplot
Returns a hvPlot object to provide a high-level plotting API.
plot
Returns a hvPlot object to provide a high-level plotting API.
Methods
close
()Close open resources corresponding to this data source. discover
()Open resource and populate the source attributes. read
()Load entire dataset into a container and return it read_chunked
()Return iterator over container fragments of data source read_partition
(i)Return a (offset_tuple, container) corresponding to i-th partition. to_dask
()Return a dask container for this data source yaml
([with_plugin])Return YAML representation of this data-source set_cache_dir