Returns the path of all of the data files in a given directory that match a given glob pattern.
Parameters: | datadir : str
pattern : str, optional
|
---|---|
Returns: | filenames : iterator of str
|
Examples
This will retrieve the contents of the data file for the astropy.wcs tests:
from astropy.utils.data import get_pkg_data_filenames
for fn in get_pkg_data_filename('maps', '*.hdr'):
with open(fn) as f:
fcontents = f.read()