find_frametype#
- gwpy.io.datafind.find_frametype(
- channel: str | Channel,
- gpstime: SupportsToGps | None = None,
- *,
- frametype_match: str | Pattern | None = None,
- host: str | None = None,
- urltype: str = 'file',
- ext: str = 'gwf',
- return_all: Literal[False] = False,
- allow_tape: bool = False,
- on_gaps: Literal['error', 'ignore', 'warn'] = 'error',
- **gwdatafind_kw,
- gwpy.io.datafind.find_frametype(
- channel: str | Channel,
- gpstime: SupportsToGps | None = None,
- *,
- frametype_match: str | Pattern | None = None,
- host: str | None = None,
- urltype: str = 'file',
- ext: str = 'gwf',
- return_all: Literal[True] = True,
- allow_tape: bool = False,
- on_gaps: Literal['error', 'ignore', 'warn'] = 'error',
- **gwdatafind_kw,
- gwpy.io.datafind.find_frametype(
- channel: str | Channel,
- gpstime: SupportsToGps | None = None,
- *,
- frametype_match: str | Pattern | None = None,
- host: str | None = None,
- urltype: str = 'file',
- ext: str = 'gwf',
- allow_tape: bool = False,
- on_gaps: Literal['error', 'ignore', 'warn'] = 'error',
- **gwdatafind_kw,
- gwpy.io.datafind.find_frametype(
- channel: Iterable[ChannelLike],
- gpstime: SupportsToGps | None = None,
- *,
- frametype_match: str | Pattern | None = None,
- host: str | None = None,
- urltype: str = 'file',
- ext: str = 'gwf',
- return_all: Literal[False] = False,
- allow_tape: bool = False,
- on_gaps: Literal['error', 'ignore', 'warn'] = 'error',
- **gwdatafind_kw,
- gwpy.io.datafind.find_frametype(
- channel: Iterable[ChannelLike],
- gpstime: SupportsToGps | None = None,
- *,
- frametype_match: str | Pattern | None = None,
- host: str | None = None,
- urltype: str = 'file',
- ext: str = 'gwf',
- return_all: Literal[True] = True,
- allow_tape: bool = False,
- on_gaps: Literal['error', 'ignore', 'warn'] = 'error',
- **gwdatafind_kw,
- gwpy.io.datafind.find_frametype(
- channel: Iterable[ChannelLike],
- gpstime: SupportsToGps | None = None,
- *,
- frametype_match: str | Pattern | None = None,
- host: str | None = None,
- urltype: str = 'file',
- ext: str = 'gwf',
- allow_tape: bool = False,
- on_gaps: Literal['error', 'ignore', 'warn'] = 'error',
- **gwdatafind_kw,
Find the frametype(s) that hold data for a given channel.
- Parameters:
- channel
str,Channel The channel to find.
- gpstime
int, optional Target GPS time at which to find correct type.
- frametype_match
str, optional Regular expression to use for frametype
strmatching.- host
str, optional Name of datafind host to use.
- urltype
str, optional The URL type to use. Default is “file” to use paths available on the file system.
- ext
str, optional The file extension for which to search. “gwf” is the only file extension supported, but this may be extended in the future.
- return_all
bool, optional If
Truereturn all found types; ifFalse(default) return only the ‘best’ match.- allow_tape
bool, optional If
False(default) do not test types whose frame files are stored on tape (not on spinning disk).- cache
bool,None, optional Whether to cache the contents of remote URLs. Default (
None) is to check theGWPY_CACHEenvironment variable. See Environment variables for details.- on_gaps
str, optional Action to take when the requested all or some of the GPS interval is not covereed by the dataset, one of:
'error': raise aRuntimeError(default)'warn': emit a warning but return all available URLs'ignore': return the list of URLs with no warnings
- gwdatafind_kw
Other keyword arguments are passed to the
gwdatafind.find_types, andgwdatafind.find_urls.functions.
- channel
- Returns:
Ifasinglenameisgiven,andreturn_all=False(default):- frametype
str name of best match frame type
Ifasinglenameisgiven,andreturn_all=True:- types
listofstr the list of all matching frame types
Ifmultiplenamesaregiven,theabovereturntypesarewrappedintoadict[str, str | list[str]].
Examples
>>> from gwpy.io import datafind as io_datafind >>> io_datafind.find_frametype('H1:IMC-PWR_IN_OUTPUT', gpstime=1126259462) 'H1_R' >>> io_datafind.find_frametype( ... 'H1:IMC-PWR_IN_OUTPUT', ... gpstime=1126259462, ... return_all=True, ... ) ['H1_R', 'H1_C'] >>> io_datafind.find_frametype( ... ('H1:IMC-PWR_IN_OUTPUT', 'H1:OMC-DCPD_SUM_OUTPUT', 'H1:GDS-CALIB_STRAIN'), ... gpstime=1126259462, ... return_all=True, ... ) {'H1:GDS-CALIB_STRAIN': ['H1_HOFT_C00'], 'H1:OMC-DCPD_SUM_OUTPUT': ['H1_R', 'H1_C'], 'H1:IMC-PWR_IN_OUTPUT': ['H1_R', 'H1_C']}