parse_cm.load_file_path#

parse_cm.load_file_path(load_name_dir, file_glob, file_label=None)#

Get path to a unique file in load directory specified by a file glob.

The load directory can be an actual directory or a load name like “DEC1123B”. For a load name the load directory is found in $SKA/data/mpcrit1/mplogs using load_dir_from_load_name().

Parameters:
load_name_dirstr or Path

Directory with load review files (like “<root>/DEC1123/oflsb”) or load name like “DEC1123B”.

file_globstr

Glob pattern for file to find (like “CR*.backstop”).

file_labelstr, optional

Label for file type (like “backstop”) for exception messages. Default is to use file_glob.

Returns:
pathPath

Path to load file in load directory.

Examples

>>> load_file_path("DEC1123A", "CR*.backstop", "backstop")
PosixPath('/Users/aldcroft/ska/data/mpcrit1/mplogs/2023/DEC1123/oflsa/CR344_2303.backstop')
>>> load_file_path("DEC1123A", "**/*proseco.pkl.gz", "ACA pickle")
PosixPath('/Users/aldcroft/ska/data/mpcrit1/mplogs/2023/DEC1123/oflsa/output/DEC1123A_proseco.pkl.gz')