filename_metadata#

gwpy.io.cache.filename_metadata(filename: FileSystemPath) tuple[str, str, Segment][source]#

Return metadata parsed from a filename following LIGO-T010150.

This method is lenient with regards to integers in the GPS start time of the file, as opposed to gwdatafind.utils.filename_metadata, which is strict.

Parameters:
filenamestr

the path name of a file

Returns:
obsstr

the observatory metadata

tagstr

the file tag

segmentgwpy.segments.Segment

the GPS [float, float) interval for this file

Notes

LIGO-T010150 declares a file naming convention that includes documenting the GPS start integer and integer duration of a file, see that document for more details.

Examples

>>> from gwpy.io.cache import filename_metadata
>>> filename_metadata("A-B-0-1.txt")
('A', 'B', Segment(0, 1))
>>> filename_metadata("A-B-0.456-1.345.txt")
("A", "B", Segment(0.456, 1.801))