astra.utils.data_models

Module Contents

Functions

parse_descriptors(path, strict=True) Parse the data model descriptors from the given path. For example, the path
parse_data_model(path, strict=True) Return the SDSS data model that describes the given path.
astra.utils.data_models.__dsi_path_descriptors
astra.utils.data_models.parse_descriptors(path, strict=True)

Parse the data model descriptors from the given path. For example, the path

$APOGEE_REDUX/{apred}/stars/{telescope}/{field}/{prefix}Star-{apred}-{obj}.fits

describes an apStar data model file of an observation of an object, taken with a particular telescope, towards some field, etc. This will parse a given path and return those data model descriptors.

Parameters:
  • path – A local path to a SDSS data product that has a data model registered with the SDSS Data Specification Index.
  • strict – [optional] Require that the given path follows the full path description given by the data model, instead of just matching on the path basename (default: True).
Returns:

A two-length tuple containing the name of the matched data model, and a dictionary that contains the matched descriptors.

Raises:

ValueError – If no data model could be found that describes the given path, or multiple data models were matched.

astra.utils.data_models.parse_data_model(path, strict=True)

Return the SDSS data model that describes the given path.

Parameters:
  • path – A local path to a SDSS data product that has a data model registered with the SDSS Data Specification Index.
  • strict – [optional] Require that the given path follows the full path description given by the data model, instead of just matching on the path basename (default: True).
Returns:

The name of the matched data model.

Raises:

ValueError – If no data model could be found that describes the given path, or multiple data models were matched.

astra.utils.data_models.paths = ['/uufs/chpc.utah.edu/common/home/sdss/apogeework/apogee/spectro/redux/r12/stars/apo25m/M67/apStar-r12-2M08485930+1117220.fits', '/uufs/chpc.utah.edu/common/home/sdss/apogeework/apogee/spectro/redux/r12/stars/apo25m/M67/apStar-r12-2M08485930+1117220.fits', '/APOGEE_REDUX/r8/apo25m/4912/55726/apVisit-r8-4912-55726-269.fits', '/Users/arc/Downloads/spec-6171-56311-0312.fits']