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,
) str[source]#
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,
) list[str]
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,
) str
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,
) dict[ChannelLike, str]
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,
) dict[ChannelLike, list[str]]
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,
) dict[ChannelLike, list[str]]

Find the frametype(s) that hold data for a given channel.

Parameters:
channelstr, Channel

The channel to find.

gpstimeint, optional

Target GPS time at which to find correct type.

frametype_matchstr, optional

Regular expression to use for frametype str matching.

hoststr, optional

Name of datafind host to use.

urltypestr, optional

The URL type to use. Default is “file” to use paths available on the file system.

extstr, optional

The file extension for which to search. “gwf” is the only file extension supported, but this may be extended in the future.

return_allbool, optional

If True return all found types; if False (default) return only the ‘best’ match.

allow_tapebool, optional

If False (default) do not test types whose frame files are stored on tape (not on spinning disk).

cachebool, None, optional

Whether to cache the contents of remote URLs. Default (None) is to check the GWPY_CACHE environment variable. See Environment variables for details.

on_gapsstr, optional

Action to take when the requested all or some of the GPS interval is not covereed by the dataset, one of:

  • 'error': raise a RuntimeError (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, and gwdatafind.find_urls.functions.

Returns:
If a single name is given, and return_all=False (default):
frametypestr

name of best match frame type

If a single name is given, and return_all=True:
typeslist of str

the list of all matching frame types

If multiple names are given, the above return types are wrapped into a
dict[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']}