Channel
¶>>> from gwpy.detector import Channel
Each of the laser-interferometer gravitational-wave detectors record thousands of different data streams capturing a single instrumental error or control signal, or the output of an environmental sensor. These data streams are known as ‘channels’, and are named according to a convention that describes its source in the instrument, and the signal it records, for example:
L1:PSS-ISS_PDB_OUT_DQ
describes the output signal (OUT
) from photodiode-B (PDB
) inside the Intensity Stabilisation System (ISS
) of the Pre-Stabilised Laser (PSL
) powering the L1
instrument, hosted at the LIGO Livingston Observatory. The DQ
suffix indicates that this channel was recorded in data files for offline study (many more ‘test point’ channels are used only in real-time, and are never recorded).
A simple representation of this physical signal is provided by the Channel
object:
>>> from gwpy.detector import Channel
>>> signal = Channel('L1:PSL-ISS_PDB_OUT_DQ')
This new Channel
has a number of attributes that describe its source, derived from its name:
>>> print(hoft.ifo)
'L1'
>>> print(hoft.system)
'PSL'
>>> print(hoft.subsystem)
'ISS'
and so on.
Alongside nomnitive attributes, each Channel
has the following attributes:
name |
Name of this channel. |
sample_rate |
Rate of samples (Hertz) for this channel. |
unit |
Data unit for this channel. |
dtype |
Numeric type for data in this channel. |
url |
CIS browser url for this channel. |
model |
Name of the SIMULINK front-end model that defines this channel. |
Each of these can be manually passed to the Channel
constructor, or downloaded directly from the LIGO Channel Information System.
All of the LIGO interferometer data channels are recorded in the Channel Information System (https://cis.ligo.org), a queryable database containing the details of each channel recorded to disk from the observatories.
The Channel.query()
classmethod
allows you to query the database as follows:
>>> from gwpy.detector import Channel
>>> chan = Channel.query('L1:IMC-F_OUT_DQ')
>>> print(chan.sample_rate)
16384.0 Hz
>>> print(chan.url)
https://cis.ligo.org/channel/282666
>>> print(chan.model)
l1lsc
In this example we have accessed the information for the frequency noise output signal (F_OUT
) from the Input Mode Cleaner (IMC
) of the L1
instrument.
ChannelList
¶Groups of channels may be collected together in a ChannelList
, a simple extension of the built-in list
with functionality for finding
and sieveing
for specific Channel
names, sample-rates, or types.
This reference contains the following class
entries:
Channel |
Representation of a laser-interferometer data channel. |
ChannelList |
A list of channels , with parsing utilities. |
gwpy.detector.
Channel
(name, **params)[source]¶Bases: object
Representation of a laser-interferometer data channel.
Parameters: |
sample_rate :
frequency_range :
safe :
dtype :
frametype :
model :
|
---|
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.
find_frametype
(gpstime=None, frametype_match=None, host=None, port=None, return_all=False, allow_tape=True)[source]¶Find the containing frametype(s) for this Channel
Parameters: | gpstime :
frametype_match :
host :
port :
return_all: `bool`, default: `False`
allow_tape :
|
---|---|
Returns: |
|
frametype
¶LDAS type description for frame files containing this channel.
from_nds2
(nds2channel)[source]¶Generate a new channel using an existing nds2.channel object
name
¶Name of this channel.
This should follow the naming convention, with the following format: ‘IFO:SYSTEM-SUBSYSTEM_SIGNAL’
Type: | str |
---|
ndsname
¶Name of this channel as stored in the NDS database
ndstype
¶NDS type integer for this channel.
This property is mapped to the Channel.type
string.
parse_channel_name
(name, strict=True)[source]¶Decompose a channel name string into its components
Parameters: | name :
strict :
|
---|---|
Returns: | match :
|
Raises: | ValueError
|
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'}
query
(name, use_kerberos=None, debug=False)[source]¶Query the LIGO Channel Information System for the Channel
matching the given name
Parameters: | name :
use_kerberos :
debug :
|
---|---|
Returns: | c :
|
query_nds2
(name, host=None, port=None, connection=None, type=None)[source]¶Query an NDS server for channel information
Parameters: | name :
host :
port :
connection :
|
---|---|
Returns: | channel :
|
Raises: | ValueError
|
Notes
Warning
A host
is required if an open connection
is not given
safe
¶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
Type: | bool or None |
---|
texname
¶Name of this channel in LaTeX printable format.
gwpy.detector.
ChannelList
[source]¶Bases: list
A list
of channels
, with parsing utilities.
append
()¶L.append(object) – append object to end
count
(value) → integer -- return number of occurrences of value¶extend
()¶L.extend(iterable) – extend list by appending elements from the iterable
find
(name)[source]¶Find the Channel
with a specific name in this ChannelList
.
Parameters: | name :
|
---|---|
Returns: | index :
|
Raises: | ValueError
|
from_names
(*names)[source]¶Create a new ChannelList
from a list of names
The list of names can include comma-separated sets of names, in which case the return will be a flattened list of all parsed channel names.
ifos
¶The set
of interferometer prefixes used in this
ChannelList
.
index
(value[, start[, stop]]) → integer -- return first index of value.¶Raises ValueError if the value is not present.
insert
()¶L.insert(index, object) – insert object before index
pop
([index]) → item -- remove and return item at index (default last).¶Raises IndexError if list is empty or index is out of range.
query
(name, use_kerberos=None, debug=False)[source]¶Query the LIGO Channel Information System a ChannelList
.
Parameters: | name :
use_kerberos :
debug :
|
---|---|
Returns: | channels :
|
query_nds2
(names, host=None, port=None, connection=None, type=127, unique=False)[source]¶Query an NDS server for channel information
Parameters: | name :
host :
port :
connection :
unique :
|
---|---|
Returns: | channellist :
|
Raises: | ValueError
|
Notes
Warning
A host
is required if an open connection
is not given
query_nds2_availability
(*args, **kwargs)[source]¶Query for when data are available for these channels in NDS2
Parameters: | channels : start :
end :
connection :
host :
port :
|
---|---|
Returns: | segdict :
|
read
(source, *args, **kwargs)[source]¶Read a ChannelList
from a file
Parameters: | source :
|
---|
Notes
The available built-in formats are:
Format | Read | Write | Auto-identify |
---|---|---|---|
ini | Yes | Yes | Yes |
omega-scan | Yes | No | No |
remove
()¶L.remove(value) – remove first occurrence of value. Raises ValueError if the value is not present.
reverse
()¶L.reverse() – reverse IN PLACE
sieve
(name=None, sample_rate=None, sample_range=None, exact_match=False, **others)[source]¶Find all Channels
in this list matching the
specified criteria.
Parameters: | name :
sample_rate :
sample_range : 2-
exact_match :
|
---|---|
Returns: | new :
|
sort
()¶L.sort(cmp=None, key=None, reverse=False) – stable sort IN PLACE; cmp(x, y) -> -1, 0, 1
write
(target, *args, **kwargs)[source]¶Write a ChannelList
to a file
Notes
The available built-in formats are:
Format | Read | Write | Auto-identify |
---|---|---|---|
ini | Yes | Yes | Yes |
omega-scan | Yes | Yes | No |