sndata.base_classes¶
The base_classes
module defines parent classes used by the data access
API to define basic data handling and to enforce a consistent user interface.
For an example on how to use these classes to create custom data access module
for a new survey / data release, see the Creating Custom Data Classes section of the
docs.
Base¶
-
class
sndata.base_classes.
Base
[source]¶ Abstract class acting as a base for all data access classes
-
_download_module_data
(force: bool = False, timeout: float = 15)[source]¶ Download data for the current survey / data release
Parameters: - force – Re-Download locally available data
- timeout – Seconds before timeout for individual files/archives
-
_get_available_ids
() → List[str][source]¶ Return a list of target object IDs for the current survey
Returns: A list of object IDs as strings
-
_get_available_tables
() → List[Union[str, int]][source]¶ Get Ids for available vizier tables published by this data release
-
_get_data_for_id
(obj_id: str, format_table: bool = True) → astropy.table.table.Table[source]¶ Returns data for a given object ID
See
get_available_ids()
for a list of available ID values.Parameters: - obj_id – The ID of the desired object
- format_table – Format data into the
sndata
standard format
Returns: An astropy table of data for the given ID
-
SpectroscopicRelease¶
-
class
sndata.base_classes.
SpectroscopicRelease
(survey_abbrev: str = None, release: str = None)[source]¶ Generic representation of a spectroscopic data release
This class is a template designed to enforce a consistent user interface and requires child classes to fill in incomplete functionality.
-
download_module_data
(force: bool = False, timeout: float = 15)[source]¶ Download data for the current survey / data release
Parameters: - force – Re-Download locally available data
- timeout – Seconds before timeout for individual files/archives
-
get_available_ids
() → List[str][source]¶ Return a list of target object IDs for the current survey
Returns: A list of object IDs as strings
-
get_available_tables
() → List[Union[str, int]][source]¶ Get Ids for available vizier tables published by this data release
-
get_data_for_id
(obj_id: str, format_table: bool = True) → astropy.table.table.Table[source]¶ Returns data for a given object ID
See
get_available_ids()
for a list of available ID values.Parameters: - obj_id – The ID of the desired object
- format_table – Format data into the
sndata
standard format
Returns: An astropy table of data for the given ID
-
iter_data
(verbose: bool = False, format_table: bool = True, filter_func: bool = None) → astropy.table.table.Table[source]¶ Iterate through all available targets and yield data tables
An optional progress bar can be formatted by passing a dictionary of
tqdm
arguments. Outputs can be optionally filtered by passing a functionfilter_func
that accepts a data table and returns a boolean.Parameters: - verbose – Optionally display progress bar while iterating
- format_table – Format data for
SNCosmo
(Default: True) - filter_func – An optional function to filter outputs by
Yields: Astropy tables
-
PhotometricRelease¶
-
class
sndata.base_classes.
PhotometricRelease
(survey_abbrev: str = None, release: str = None)[source]¶ Generic representation of a photometric data release
This class is a template designed to enforce a consistent user interface and requires child classes to fill in incomplete functionality.
DefaultParser¶
-
class
sndata.base_classes.
DefaultParser
[source]¶ Prebuilt data parsing tools for Vizier tables and photometric filters
For more information see the Creating Custom Data Classes section of the docs.
-
_get_available_tables
() → List[Union[str, int]][source]¶ Default backend functionality of
get_available_tables
function
-