get_reference_file_path

specreduce.calibration_data.get_reference_file_path(path=None, cache=False, show_progress=False)[source]

Basic function to take a path to a file and load it via pkg_resources if the specreduce_data package is available and load it via GitHub raw user content if not.

Parameters:
pathstr or None (default: None)

Filename of reference file relative to the reference_data directory within specreduce_data package.

cachebool (default: False)

Set whether file is cached if file is downloaded.

show_progressbool (default: False)

Set whether download progress bar is shown if file is downloaded.

Returns:
file_pathstr or None

Path to reference data file or None if the path cannot be constructed or if the file itself is not valid.

Examples

>>> from specreduce.calibration_data import get_reference_file_path
>>> kpno_extinction_file = get_reference_file_path("extinction/kpnoextinct.dat")