コード例 #1
0
ファイル: statevector.py プロジェクト: Maple-Wang/gwpy
# First, we can import the `StateVector` class:
from gwpy.timeseries import StateVector

# Next, we define which bits we want to use, and can then
# :meth:`~StateVector.get` the data:
bits = [
    'Summary state',
    'State 1 damped',
    'Stage 1 isolated',
    'Stage 2 damped',
    'Stage 2 isolated',
    'Master switch ON',
    'Stage 1 WatchDog OK',
    'Stage 2 WatchDog OK',
]

data = StateVector.get('L1:ISI-ETMX_ODC_CHANNEL_OUT_DQ', 'May 22 2014 14:00', 'May 22 2014 15:00', bits=bits)
data = data.astype('uint32')  # hide

# For this example, we wish to :meth:`~StateVector.resample` the data to a
# much lower rate, to make visualising the state much easier:
data = data.resample(16)

# Finally, we make a :meth:`~StateVector.plot`, passing `insetlabels=True` to
# display the bit names inside the axes:
plot = data.plot(insetlabels=True)
plot.set_title('LLO ETMX internal seismic isolation state')
plot.add_bitmask('0b11101110')
plot.show()
コード例 #2
0
ファイル: statevector.py プロジェクト: stevereyes01/gwpy
# First, we can import the `StateVector` class:
from gwpy.timeseries import StateVector

# Next, we define which bits we want to use, and can then
# :meth:`~StateVector.get` the data:
bits = [
    'Summary state',
    'State 1 damped',
    'Stage 1 isolated',
    'Stage 2 damped',
    'Stage 2 isolated',
    'Master switch ON',
    'Stage 1 WatchDog OK',
    'Stage 2 WatchDog OK',
]

data = StateVector.get('L1:ISI-ETMX_ODC_CHANNEL_OUT_DQ', 'May 22 2014 14:00', 'May 22 2014 15:00', bits=bits)
data = data.astype('uint32')  # hide

# For this example, we wish to :meth:`~StateVector.resample` the data to a
# much lower rate, to make visualising the state much easier:
data = data.resample(16)

# Finally, we make a :meth:`~StateVector.plot`, passing `insetlabels=True` to
# display the bit names inside the axes:
plot = data.plot(insetlabels=True)
plot.gca().set_title('LLO ETMX internal seismic isolation state')
plot.add_bitmask('0b11101110')
plot.show()