当前位置: 首页>>代码示例>>Python>>正文


Python TimeSeries.get方法代码示例

本文整理汇总了Python中gwpy.timeseries.TimeSeries.get方法的典型用法代码示例。如果您正苦于以下问题:Python TimeSeries.get方法的具体用法?Python TimeSeries.get怎么用?Python TimeSeries.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gwpy.timeseries.TimeSeries的用法示例。


在下文中一共展示了TimeSeries.get方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1:

# 需要导入模块: from gwpy.timeseries import TimeSeries [as 别名]
# 或者: from gwpy.timeseries.TimeSeries import get [as 别名]
parts of the detector, closely monitoring mechanical subsystems and
environmental conditions. We can cross-correlate data from these sensors with
the primary gravitational wave data to look for evidence of terrestrial noise.

We demonstrate below a prominent 'whistle glitch' in the gravitational wave
channel, which is also witnessed by a photodiode in the Pre-Stabilized Laser
(PSL) chamber. This example uses data from the LIGO Livingston detector during
Advanced LIGO's second observing run.
"""

__author__ = "Alex Urban <[email protected]>"
__currentmodule__ = 'gwpy.timeseries'

# First, we import the `TimeSeries` and :meth:`~TimeSeries.get` the data:
from gwpy.timeseries import TimeSeries
hoft = TimeSeries.get('L1:GDS-CALIB_STRAIN', 1172489751, 1172489815)
aux = TimeSeries.get('L1:PSL-ISS_PDA_REL_OUT_DQ', 1172489751, 1172489815)

# Next, we should `~TimeSeries.whiten` the data to enhance the higher-frequency
# content and make a more faithful comparison between data streams.
whoft = hoft.whiten(8, 4)
waux = aux.whiten(8, 4)

 # We can now cross-correlate these channels:
mfilter = waux.crop(1172489782.57, 1172489783.57)
snr = whoft.correlate(mfilter).abs()

# and plot the resulting normalised signal-to-noise ratio:
plot = snr.crop(1172489782.07, 1172489784.07).plot()
plot.axes[0].set_epoch(1172489783.07)
plot.axes[0].set_ylabel('Signal-to-noise ratio', fontsize=16)
开发者ID:diegobersanetti,项目名称:gwpy,代码行数:33,代码来源:correlate.py

示例2:

# 需要导入模块: from gwpy.timeseries import TimeSeries [as 别名]
# 或者: from gwpy.timeseries.TimeSeries import get [as 别名]
from gwpy.timeseries import TimeSeries
white = TimeSeries.get(
    'L1:OAF-CAL_DARM_DQ', 'March 2 2015 12:00', 'March 2 2015 12:30')
开发者ID:gwpy,项目名称:gwpy.github.io,代码行数:5,代码来源:filter-1.py

示例3:

# 需要导入模块: from gwpy.timeseries import TimeSeries [as 别名]
# 或者: from gwpy.timeseries.TimeSeries import get [as 别名]
from gwpy.timeseries import TimeSeries
gwdata = TimeSeries.get('H1:LDAS-STRAIN', 'September 16 2010 06:40',
                        'September 16 2010 06:50')
spectrum = gwdata.asd(8, 4)
开发者ID:gwpy,项目名称:gwpy.github.io,代码行数:6,代码来源:index-1.py

示例4:

# 需要导入模块: from gwpy.timeseries import TimeSeries [as 别名]
# 或者: from gwpy.timeseries.TimeSeries import get [as 别名]
"""Calculating and plotting a `Spectrum`

I'm interested in the level of ground motion surrounding a particular time
during commissioning of the Advanced LIGO Livingston Observatory. I don't
have access to the frame files on disk, so I'll need to use NDS.
"""

__author__ = "Duncan Macleod <[email protected]>"
__currentmodule__ = 'gwpy.spectrum'

# In order to generate a `Spectrum` we need to import the
# `~gwpy.timeseries.TimeSeries` and :meth:`~gwpy.timeseries.TimeSeries.get`
# the data:
from gwpy.timeseries import TimeSeries
lho = TimeSeries.get(
    'H1:LDAS-STRAIN,rds', 'August 1 2010', 'August 1 2010 00:02')
llo = TimeSeries.get(
    'L1:LDAS-STRAIN,rds', 'August 1 2010', 'August 1 2010 00:02')

# We can then call the :meth:`~gwpy.timeseries.TimeSeries.asd` method to
# calculated the amplitude spectral density for each
# `~gwpy.timeseries.TimeSeries`:
lhoasd = lho.asd(2, 1)
lloasd = llo.asd(2, 1)

# We can then :meth:`~Spectrum.plot` the spectra
plot = lhoasd.plot(color='b', label='LHO')
ax = plot.gca()
ax.plot(lloasd, color='g', label='LLO')
ax.set_xlim(40, 4096)
ax.set_ylim(1e-23, 7.5e-21)
开发者ID:Maple-Wang,项目名称:gwpy,代码行数:33,代码来源:hoff.py

示例5:

# 需要导入模块: from gwpy.timeseries import TimeSeries [as 别名]
# 或者: from gwpy.timeseries.TimeSeries import get [as 别名]
to calculate discrete PSDs for each stride. This is fine for long-duration
data, but give poor resolution when studying short-duration phenomena.

The `~TimeSeries.spectrogram2` method allows for highly-overlapping FFT
calculations to over-sample the frequency content of the input `TimeSeries`
to produce a much more feature-rich output.
"""

__author__ = "Duncan Macleod <[email protected]>"
__currentmodule__ = 'gwpy.timeseries'

# As with the other `~gwpy.spectrogram.Spectrogram` examples, we import the
# `TimeSeries` class, and :meth:`~TimeSeries.get` the data, but in this
# example we only need 5 seconds of datam,
from gwpy.timeseries import TimeSeries
gwdata = TimeSeries.get(
    'L1:OAF-CAL_DARM_DQ', 'Feb 28 2015 06:02:05', 'Feb 28 2015 06:02:10')

# Now we can call the `~TimeSeries.spectrogram2` method of `gwdata` to
# calculate our over-dense `~gwpy.spectrogram.Spectrogram`
specgram = gwdata.spectrogram2(fftlength=0.15, overlap=0.14) ** (1/2.)

# To whiten the `specgram` we can use the :meth:`~Spectrogram.ratio` method
# to divide by the overall median:
medratio = specgram.ratio('median')

# Finally, we make a plot:
plot = medratio.plot(norm='log', vmin=0.5, vmax=10)
plot.set_yscale('log')
plot.set_ylim(40, 8192)
plot.add_colorbar(label='Amplitude relative to median')
plot.set_title('L1 $h(t)$ with noise interference')
开发者ID:Maple-Wang,项目名称:gwpy,代码行数:34,代码来源:spectrogram2.py

示例6:

# 需要导入模块: from gwpy.timeseries import TimeSeries [as 别名]
# 或者: from gwpy.timeseries.TimeSeries import get [as 别名]
from gwpy.timeseries import TimeSeries
data = TimeSeries.get('H1:ASC-Y_TR_A_NSUM_OUT_DQ', 1123084671, 1123084703)
开发者ID:gwpy,项目名称:gwpy.github.io,代码行数:4,代码来源:whiten-1.py

示例7:

# 需要导入模块: from gwpy.timeseries import TimeSeries [as 别名]
# 或者: from gwpy.timeseries.TimeSeries import get [as 别名]
high-frequency content, making discerning high-frequency features difficult.

We employ a technique called 'whitening' to normalize the power at all
frequencies so that excess power at any frequency is more obvious.

We demonstrate below with an auxiliary signal recording transmitted power
in one of the interferometer arms, which recorded two large glitches with
a frequency of around 5-50Hz.
"""

__author__ = "Duncan Macleod <[email protected]>"
__currentmodule__ = 'gwpy.timeseries'

# First, we import the `TimeSeries` and :meth:`~TimeSeries.get` the data:
from gwpy.timeseries import TimeSeries
data = TimeSeries.get('H1:ASC-Y_TR_A_NSUM_OUT_DQ', 1123084670, 1123084800)

# Now, we can `~TimeSeries.whiten` the data to enhance the higher-frequency
# content
white = data.whiten(4, 2)

# and can `~TimeSeries.plot` both the original and whitened data
epoch = 1123084687.570
plot = data.plot()
plot.axes[0].set_ylabel('Y-arm power [counts]', fontsize=16)
plot.add_timeseries(white, newax=True, sharex=plot.axes[0])
plot.axes[1].set_ylabel('Whitened amplitude', fontsize=16)
plot.axes[0].set_epoch(epoch)
plot.axes[1].set_epoch(epoch)
plot.axes[0].set_xlim(epoch-8, epoch+8)
plot.axes[1].set_xlim(epoch-8, epoch+8)
开发者ID:Maple-Wang,项目名称:gwpy,代码行数:33,代码来源:whiten.py

示例8:

# 需要导入模块: from gwpy.timeseries import TimeSeries [as 别名]
# 或者: from gwpy.timeseries.TimeSeries import get [as 别名]
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GWpy.  If not, see <http://www.gnu.org/licenses/>

"""Calculating and plotting a `SpectralVariance` histogram
"""

__author__ = "Duncan Macleod <[email protected]>"
__currentmodule__ = 'gwpy.spectrum'

# In order to generate a `SpectralVariance` histogram we need to import the
# `~gwpy.timeseries.TimeSeries` and :meth:`~gwpy.timeseries.TimeSeries.get`
# the data:
from gwpy.timeseries import TimeSeries
llo = TimeSeries.get(
    'L1:LDAS-STRAIN,rds', 'August 1 2010', 'August 1 2010 00:10')

# We can then call the :meth:`~gwpy.timeseries.TimeSeries.spectral_variance`
# method of the ``llo`` `~gwpy.timeseries.TimeSeries`:
variance = llo.spectral_variance(1, log=True, low=1e-24, high=1e-19, nbins=100)

# We can then :meth:`~SpectralVariance.plot` the `SpectralVariance`
plot = variance.plot(norm='log', vmin=0.5, vmax=100)
ax = plot.gca()
ax.grid()
ax.set_xlim(40, 4096)
ax.set_ylim(1e-24, 1e-19)
ax.set_xlabel('Frequency [Hz]')
ax.set_ylabel(r'GW ASD [strain/\rtHz]')
ax.set_title('LIGO Livingston Observatory sensitivity variance')
plot.show()
开发者ID:Maple-Wang,项目名称:gwpy,代码行数:34,代码来源:variance.py

示例9: density

# 需要导入模块: from gwpy.timeseries import TimeSeries [as 别名]
# 或者: from gwpy.timeseries.TimeSeries import get [as 别名]
changed appreciably.
"""

__author__ = "Duncan Macleod <[email protected]>"
__currentmodule__ = "gwpy.timeseries"

# First, we import the `TimeSeries`
from gwpy.timeseries import TimeSeries

# And we set the times of our investigation:
goodtime = 1061800700
badtime = 1061524816
duration = 120

# Next we :meth:`~TimeSeries.get` the data:
gooddata = TimeSeries.get("L1:PSL-ISS_PDB_OUT_DQ", goodtime, goodtime + duration)
baddata = TimeSeries.get("L1:PSL-ISS_PDB_OUT_DQ", badtime, badtime + duration)

# and calculate an `amplitude spectral density (ASD) <TimeSeries.asd>` using a 4-second Fourier transform with a 2-second overlap:
goodasd = gooddata.asd(4, 2)
badasd = baddata.asd(4, 2)

# Lastly, we make a plot of the data by `plotting <FrequencySeries.plot>` one `~gwpy.frequencyseries.FrequencySeries`, and then adding the second:
plot = badasd.plot(label="Noisy data")
ax = plot.gca()
ax.plot(goodasd, label="Clean data")
ax.set_xlabel("Frequency [Hz]")
ax.set_xlim(10, 8000)
ax.set_ylabel(r"Noise ASD [1/$\sqrt{\mathrm{Hz}}$]")
ax.set_ylim(1e-6, 5e-4)
ax.grid(True, "both", "both")
开发者ID:e-q,项目名称:gwpy,代码行数:33,代码来源:compare.py

示例10: float

# 需要导入模块: from gwpy.timeseries import TimeSeries [as 别名]
# 或者: from gwpy.timeseries.TimeSeries import get [as 别名]
#!/usr/bin/python

import sys
from gwpy.timeseries import TimeSeries

sys.stdout.write("starting first time series \n")
    #H1_channel_lockstatus_data_1 = TimeSeries.get('H1:DMT-DC_READOUT_LOCKED',float(pw_arrival_time),float(float(pw_arrival_time) + float(options.time_after_p_wave)))
    H1_channel_lockstatus_data_1 = TimeSeries.get('H1:DMT-DC_READOUT_LOCKED',float(pw_arrival_time)-10,float(rw_arrival_time))

    print >> sys.stdout.write("data gathered")
    firstcheck = H1_channel_lockstatus_data_1[0]
    if firstcheck == 1:
        for dataoutput in H1_channel_lockstatus_data_1[1:]:
            if dataoutput == 0:
                locklosscheck1 = "Y"
                break
            else:
                locklosscheck1 = "N"
                break
    else:
        locklosscheck1 = "Z"
    print >> sys.stdout.write("first timeseries complete \n")
    #H1_channel_lockstatus_data_2 = TimeSeries.get('H1:LSC-POP_A_LF_OUT_DQ',float(pw_arrival_time),float(float(pw_arrival_time) + float(options.time_after_p_wave)))
    H1_channel_lockstatus_data_2 = TimeSeries.get('H1:LSC-POP_A_LF_OUT_DQ',float(pw_arrival_time)-10,float(rw_arrival_time))

    secondcheck = H1_channel_lockstatus_data_2[0]
    if secondcheck > 10000:
        for dataoutput in H1_channel_lockstatus_data_2:
            if dataoutput < 10:
                locklosscheck2 = "Y"
                break
开发者ID:ligovirgo,项目名称:seismon,代码行数:33,代码来源:cause_lockstate_timeseries.py

示例11: print

# 需要导入模块: from gwpy.timeseries import TimeSeries [as 别名]
# 或者: from gwpy.timeseries.TimeSeries import get [as 别名]
#!/usr/bin/python

import numpy as np
from gwpy.timeseries import TimeSeries


O1_start = 1126569617
#O1_end = 1136649617
O1_end = O1_start + 2
for ifo in ['H1', 'L1']:
    channels = ['{0}:ISI-GND_STS_HAM2_Z_DQ'.format(ifo),'{0}:ISI-GND_STS_HAM2_X_DQ'.format(ifo),'{0}:ISI-GND_STS_HAM2_Y_DQ'.format(ifo),'{0}:ISI-GND_STS_HAM5_Z_BLRMS_30M_100M'.format(ifo),'{0}:ISI-GND_STS_HAM5_X_BLRMS_30M_100M'.format(ifo),'{0}:ISI-GND_STS_HAM5_Y_BLRMS_30M_100M'.format(ifo)]
    for channel in channels:
        print('Getting time series')
        velocities = TimeSeries.get(channel,O1_start,O1_end)
        print('Time series done')
        acceleration = np.diff(velocities)
        print(acceleration.value)
开发者ID:ligovirgo,项目名称:seismon,代码行数:19,代码来源:prepare_get_acceleration.py


注:本文中的gwpy.timeseries.TimeSeries.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。