Channel#

class gwpy.detector.Channel(name: str | Self, **params)[source]#

Bases: object

Representation of a gravitational-wave detectory data channel.

Parameters:
namestr, Channel

Name of this Channel (or another Channel itself). If a Channel is given, all other parameters not set explicitly will be copied over.

sample_ratefloat, Quantity, optional

Rate at which data are sampled for this channel, simple floats must be given in Hz.

unitUnit, str, optional

Name of the unit for the data of this channel.

frequency_rangetuple of float

[low, high) spectral frequency range of interest for this channel.

safebool, optional

If True this channel is ‘safe’ to use as a witness of non-gravitational-wave noise in the detector.

dtypenumpy.dtype, optional

Numeric type of data for this channel.

frametypestr, optional

LDAS name for frames that contain this channel.

modelstr, optional

Name of the SIMULINK front-end model that produces this channel.

Notes

The Channel structure implemented here is designed to match the data recorded in the LIGO Channel Information System (https://cis.ligo.org) for which a query interface is provided.

Attributes Summary

MATCH

dtype

Numeric type for data in this channel.

frametype

LDAS type description for frame files containing this channel.

frequency_range

Frequency range of interest (Hertz) for this channel.

ifo

Interferometer prefix for this channel.

model

Name of the SIMULINK front-end model that defines this channel.

name

Name of this channel.

ndsname

Name of this channel as stored in the NDS database.

ndstype

NDS type integer for this channel.

safe

Whether this channel is 'safe' to use as a noise witness.

sample_rate

Rate of samples (Hertz) for this channel.

signal

Instrumental signal for this channel.

subsystem

Instrumental sub-system for this channel.

system

Instrumental system for this channel.

texname

Name of this channel in LaTeX printable format.

trend

Trend type for this channel.

type

DAQ data type for this channel.

unit

Data unit for this channel.

url

CIS browser url for this channel.

Methods Summary

copy()

Return a copy of this Channel.

find_frametype(-> str)

Find the containing frametype(s) for this Channel.

from_arrakis(arrakischannel)

Generate a new channel using an existing arrakis.Channel.

from_nds2(nds2channel)

Generate a new channel using an existing nds2.channel object.

parse_channel_name(name, *[, strict])

Decompose a channel name string into its components.

query(name, *[, kerberos])

Query the LIGO Channel Information System for name.

query_nds2(name[, host, port, connection, type])

Query an NDS server for channel information.

Attributes Documentation

MATCH = re.compile('((?:(?P<ifo>[A-Z]\\d))?|[\\w-]+):(?:(?P<system>[a-zA-Z0-9]+))?(?:[-_](?P<subsystem>[a-zA-Z0-9]+))?(?:[-_](?P<signal>[a-zA-Z0-9_-]+?))?(?:[\\.-](?P<trend>[a-z]+))?(?:,(?P<type>([a-z]-)?[a-z]+))?$')#
dtype[source]#

Numeric type for data in this channel.

frametype[source]#

LDAS type description for frame files containing this channel.

frequency_range[source]#

Frequency range of interest (Hertz) for this channel.

ifo[source]#

Interferometer prefix for this channel.

model[source]#

Name of the SIMULINK front-end model that defines this channel.

name[source]#

Name of this channel.

This should follow the naming convention, with the following format: ‘IFO:SYSTEM-SUBSYSTEM_SIGNAL’

ndsname[source]#

Name of this channel as stored in the NDS database.

ndstype[source]#

NDS type integer for this channel.

This property is mapped to the Channel.type string.

safe[source]#

Whether this channel is ‘safe’ to use as a noise witness.

Any channel that records part or all of a GW signal as it interacts with the interferometer is not safe to use as a noise witness

A safe value of None simply indicates that the safety of this channel has not been determined

sample_rate[source]#

Rate of samples (Hertz) for this channel.

signal[source]#

Instrumental signal for this channel.

subsystem[source]#

Instrumental sub-system for this channel.

system[source]#

Instrumental system for this channel.

texname[source]#

Name of this channel in LaTeX printable format.

trend[source]#

Trend type for this channel.

type[source]#

DAQ data type for this channel.

Valid values for this field are restricted to those understood by the NDS2 client sofware, namely:

‘m-trend’, ‘online’, ‘raw’, ‘reduced’, ‘s-trend’, ‘static’, ‘test-pt’

unit[source]#

Data unit for this channel.

url[source]#

CIS browser url for this channel.

Methods Documentation

copy() Self[source]#

Return a copy of this Channel.

find_frametype(
gpstime: SupportsToGps | None = None,
*,
frametype_match: str | Pattern | None = None,
return_all: Literal[False] = False,
allow_tape: bool = True,
**kwargs,
) str[source]#
find_frametype(
gpstime: SupportsToGps | None = None,
*,
frametype_match: str | Pattern | None = None,
return_all: Literal[True] = True,
allow_tape: bool = True,
**kwargs,
) list[str]

Find the containing frametype(s) for this Channel.

Parameters:
gpstimeint, optional

A reference GPS time at which to search for frame files. Default is to search in the latest available data for each discoverable dataset.

frametype_matchstr

A regular expression string to use to down-select from the list of all available datasets.

return_all: `bool`, optional

If True return all matched datasets; if False (default) only the first match is returned

allow_tapebool, default: True

If True (default) include datasets whose files are stored on slow magnetic tape.

kwargs

Other keyword arguments are passed directly to gwpy.io.datafind.find_frametype().

Returns:
frametypestr or list[str]

If return_all=False a single str containing the ‘best’ dataset name. If return_all=True a list of dataset names.

classmethod from_arrakis(arrakischannel: arrakis.Channel) Self[source]#

Generate a new channel using an existing arrakis.Channel.

Parameters:
arrakischannelarrakis.Channel

The input channel from Arrakis to parse.

Returns:
channelgwpy.detector.Channel

A new Channel.

classmethod from_nds2(nds2channel: nds2.channel) Self[source]#

Generate a new channel using an existing nds2.channel object.

classmethod parse_channel_name(
name: str,
*,
strict: bool = True,
) dict[str, str | None][source]#

Decompose a channel name string into its components.

This method parses channels acccording to the LIGO Channel Naming Convention LIGO-T990033.

Parameters:
namestr

Name to parse.

strictbool, optional

If True (default) require exact matching of format, with no surrounding text.

Returns:
matchdict

dict of channel name components with the following keys:

  • 'ifo': the letter-number interferometer prefix

  • 'system': the top-level system name

  • 'subsystem': the second-level sub-system name

  • 'signal': the remaining underscore-delimited signal name

  • 'trend': the trend type

  • 'ndstype': the NDS2 channel suffix

Any optional keys that aren’t found will return a value of None

Raises:
ValueError

if the name cannot be parsed with at least an IFO and SYSTEM

Examples

>>> Channel.parse_channel_name("L1:LSC-DARM_IN1_DQ")
{'ifo': 'L1',
 'ndstype': None,
 'signal': 'IN1_DQ',
 'subsystem': 'DARM',
 'system': 'LSC',
 'trend': None}
>>> Channel.parse_channel_name(
...     "H1:ISI-BS_ST1_SENSCOR_GND_STS_X_BLRMS_100M_300M.rms,m-trend",
... )
{'ifo': 'H1',
 'ndstype': 'm-trend',
 'signal': 'ST1_SENSCOR_GND_STS_X_BLRMS_100M_300M',
 'subsystem': 'BS',
 'system': 'ISI',
 'trend': 'rms'}
classmethod query(name: str, *, kerberos: bool | None = None, **kwargs) Self[source]#

Query the LIGO Channel Information System for name.

Parameters:
namestr

Name of channel for which to query.

kerberosbool, optional

If True use an existing Kerberos ticket as the authentication credential. Default (None) is to check for credentials and request username and password if none are found.

kwargs

Other keyword arguments are passed directly to ciecplib.get().

Returns:
channelChannel

A new Channel containing all of the attributes set from its entry in the CIS.

classmethod query_nds2(
name: str,
host: str | None = None,
port: int | None = None,
connection: nds2.connection | None = None,
type: str | int | None = None,
) Self[source]#

Query an NDS server for channel information.

Parameters:
namestr

Name of channel for which to query.

hoststr, optional

Name of NDS2 server.

portint, optional

Port number for NDS2 connection.

connectionnds2.connection

Open connection to use for query.

typestr, int

NDS2 channel type with which to restrict query

Returns:
channelChannel

Channel with metadata retrieved from NDS2 server.

Raises:
ValueError

If multiple channels are found for a given name.

Notes

Warning

One of host or connection is required.