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, sample_rate=None, unit=None, frequency_range=None, safe=None, type=None, dtype=None, frametype=None, model=None, url=None)[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.
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 () |
|
find_frametype ([gpstime, frametype_match, ...]) |
Find the containing frametype(s) for this 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[, debug, timeout]) |
Query the LIGO Channel Information System for the Channel |
query_nds2 (*args, **kwargs) |
Query an NDS server for channel information |
Attributes Documentation
MATCH
= <_sre.SRE_Pattern object>¶frametype
¶LDAS type description for frame files containing this channel.
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.
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.
type
¶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’
Type: | str |
---|
Methods Documentation
find_frametype
(gpstime=None, frametype_match=None, host=None, port=None, return_all=False, exclude_tape=False)[source]¶Find the containing frametype(s) for this Channel
Parameters: | gpstime :
frametype_match :
host :
port :
return_all: `bool`, default: `False` :
exclude_tape :
|
---|---|
Returns: |
|
from_nds2
(nds2channel)[source]¶Generate a new channel using an existing nds2.channel object
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, debug=False, timeout=None)[source]¶Query the LIGO Channel Information System for the Channel
matching the given name
Parameters: | name :
debug :
timeout :
|
---|---|
Returns: | Channel :
|
query_nds2
(*args, **kwargs)[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
gwpy.detector.
ChannelList
[source]¶Bases: list
A list
of channels
, with parsing utilities.
Attributes Summary
ifos |
The set of interferometer prefixes used in this ChannelList . |
Methods Summary
append |
L.append(object) – append object to end |
count (...) |
|
extend |
L.extend(iterable) – extend list by appending elements from the iterable |
find (name) |
Find the Channel with a specific name in this ChannelList . |
from_names (*names) |
|
index ((value, [start, ...) |
Raises ValueError if the value is not present. |
insert |
L.insert(index, object) – insert object before index |
pop (...) |
Raises IndexError if list is empty or index is out of range. |
query (name[, debug, timeout]) |
Query the LIGO Channel Information System a ChannelList . |
query_nds2 (*args, **kwargs) |
Query an NDS server for channel information |
query_nds2_availability (*args, **kwargs) |
Query for when data are available for these channels in NDS2 |
read (*args, **kwargs) |
Read a ChannelList from a file |
remove |
L.remove(value) – remove first occurrence of value. |
reverse |
L.reverse() – reverse IN PLACE |
sieve ([name, sample_rate, sample_range, ...]) |
Find all Channels in this list matching the specified criteria. |
sort |
L.sort(cmp=None, key=None, reverse=False) – stable sort IN PLACE; |
write (data, *args, **kwargs) |
Write out data |
Attributes Documentation
ifos
¶The set
of interferometer prefixes used in this
ChannelList
.
Methods Documentation
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 :
|
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, debug=False, timeout=None)[source]¶Query the LIGO Channel Information System a ChannelList
.
Parameters: | name :
debug :
timeout :
|
---|---|
Returns: | `ChannelList` :
|
query_nds2
(*args, **kwargs)[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 :
host :
port :
|
---|---|
Returns: | nested dict : |
read
(*args, **kwargs)¶Read a ChannelList
from a file
Parameters: |
|
---|
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
(data, *args, **kwargs)¶Write out data
The arguments passed to this method depend on the format
The available built-in formats are:
Format | Read | Write | Auto-identify |
---|---|---|---|
ini | Yes | Yes | Yes |
omega-scan | Yes | Yes | No |