Git Product home page Git Product logo

gwpy's Introduction

GWpy is a collaboration-driven Python package providing tools for studying data from ground-based gravitational-wave detectors.

GWpy provides a user-friendly, intuitive interface to the common time-domain and frequency-domain data produced by the LIGO and Virgo observatories and their analyses, with easy-to-follow tutorials at each step.

https://gwpy.github.io

Release status

PyPI version Conda version

DOI License Supported Python versions

Development status

Build status Coverage status Maintainability

Installation

To install, you can do:

conda install -c conda-forge gwpy

or

python -m pip install gwpy

You can test your installation, and its version by

python -c "import gwpy; print(gwpy.__version__)"

License

GWpy is released under the GNU General Public License v3.0 or later, see here for a description of this license, or see the LICENSE file for the full text.

gwpy's People

Contributors

areeda avatar aromerorodriguez avatar asouthgate avatar dbkeitel avatar dethodav avatar duncanmmacleod avatar e-q avatar eagoetz avatar ethanmarx avatar francois-rozet avatar gitter-badger avatar katrinleinweber avatar lpsinger avatar martinberoiz avatar mattpitkin avatar mynameispatrick avatar paulaltin avatar pchanial avatar rngeorge avatar scottcoughlin2014 avatar tjma12 avatar vivienr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gwpy's Issues

Cut timeseries by given start and end time

It could be nice to be able to specify a start and end time and return a new timeseries cut to that start and end time. I use code like:

    tt1 = np.array(dataFull1.times)
    indexes = np.intersect1d(np.where(tt1 >= gpss[i])[0],np.where(tt1 <= gpss[i+1])[0])
    indexMin = np.min(indexes)
    indexMax = np.max(indexes)
    dataCut1 = dataFull1[indexMin:indexMax]

It isn't necessary for sure, but I could imagine people doing it enough that something like

dataCut1 = dataFull1.cut(start,end)

could be useful.

Plot.add_timeseries fails when colorbar Axes is present

Trying to add a new set of data Axes to a plot with a colorbar fails because the colorbar Axes object doesn't have the relevant geometry attributes and methods:

>>> from gwpy.timeseries import TimeSeries
>>> ts = TimeSeries.fetch('H1:LDAS-STRAIN,rds', 'September 16 2010 06:40', 'September 16 2010 06:50')
>>> specgram = ts.spectrogram(5, fftlength=2, overlap=1) ** (1/2.)
>>> plot = specgram.plot()
>>> plot.add_colorbar()
>>> plot.add_timeseries(ts, newax=True)
Traceback (most recent call last):
  File "gwpy-78.py", line 16, in <module>
    plot.add_timeseries(ts, newax=True)
  File "/Users/duncan/Library/Python/2.7/lib/python/site-packages/gwpy-0.1b1.dev46-py2.7.egg/gwpy/plotter/timeseries.py", line 403, in add_timeseries
    super(TimeSeriesPlot, self).add_timeseries(timeseries, **kwargs)
  File "/Users/duncan/Library/Python/2.7/lib/python/site-packages/gwpy-0.1b1.dev46-py2.7.egg/gwpy/plotter/decorators.py", line 41, in wrapper
    return func(artist, *args, **kwargs)
  File "/Users/duncan/Library/Python/2.7/lib/python/site-packages/gwpy-0.1b1.dev46-py2.7.egg/gwpy/plotter/core.py", line 604, in add_timeseries
    ax=ax, newax=newax, **kwargs)
  File "/Users/duncan/Library/Python/2.7/lib/python/site-packages/gwpy-0.1b1.dev46-py2.7.egg/gwpy/plotter/decorators.py", line 41, in wrapper
    return func(artist, *args, **kwargs)
  File "/Users/duncan/Library/Python/2.7/lib/python/site-packages/gwpy-0.1b1.dev46-py2.7.egg/gwpy/plotter/core.py", line 693, in add_array
    ax = self._add_new_axes(projection=projection)
  File "/Users/duncan/Library/Python/2.7/lib/python/site-packages/gwpy-0.1b1.dev46-py2.7.egg/gwpy/plotter/core.py", line 358, in _add_new_axes
    geometry = self._increment_geometry()
  File "/Users/duncan/Library/Python/2.7/lib/python/site-packages/gwpy-0.1b1.dev46-py2.7.egg/gwpy/plotter/core.py", line 342, in _increment_geometry
    current = self.axes[-1].get_geometry()
AttributeError: 'Axes' object has no attribute 'get_geometry'

"any" and "all" built-in boolean function don't work on StateTimeSeries objects

The "any" and "all" functions are useful for working with boolean arrays, and should therefore work on StateTimeSeries objects. Unfortunately they currently don't:

In [164]: state = gwpy.timeseries.StateTimeSeries([False])

In [165]: any(state)
Out[165]: True

In [166]: all(state)
Out[166]: True

It would be great if these functions worked, since they could be useful in identifying state activity in epochs.

unittests fail on python-2.6

The test suite is failing on python-2.6 as follows:

$ python setup.py test
...
Traceback (most recent call last):
  File "setup.py", line 353, in <module>
    'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
  File "/usr/lib64/python2.6/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib64/python2.6/distutils/dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "build/bdist.linux-x86_64/egg/setuptools/command/test.py", line 145, in run
  File "build/bdist.linux-x86_64/egg/setuptools/command/test.py", line 126, in with_project_on_sys_path
  File "build/bdist.linux-x86_64/egg/setuptools/command/test.py", line 166, in run_tests
  File "/usr/lib64/python2.6/unittest.py", line 815, in __init__
    self.parseArgs(argv)
  File "/usr/lib64/python2.6/unittest.py", line 842, in parseArgs
    self.createTests()
  File "/usr/lib64/python2.6/unittest.py", line 848, in createTests
    self.module)
  File "/usr/lib64/python2.6/unittest.py", line 612, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib64/python2.6/unittest.py", line 586, in loadTestsFromName
    return self.loadTestsFromModule(obj)
  File "build/bdist.linux-x86_64/egg/setuptools/command/test.py", line 40, in loadTestsFromModule
  File "/usr/lib64/python2.6/unittest.py", line 583, in loadTestsFromName
    parent, obj = obj, getattr(obj, part)
AttributeError: 'module' object has no attribute 'segments'

gwpy-plot can't display simple GPS times on time axis

The gwpy-plot command-line interface doesn't expose any time-axis scale options to the user, meaning they can't choose between the (default) human-readable 'Time (some unit) from epoch', and just displaying the GPS times.

I'm not sure if GWpy can actually display just GPS times, without matplotlib imposing an offset, but this should be workable pretty quickly.

TimeSeries.spectrogram error messages aren't obvious

The TimeSeries.spectrogram method should sanity check the relation between the stride, fftlength, and overlap parameters. At the moment if fftlength is greater than stride, an error gets thrown by scipy:

ValueError: noverlap must be less than nperseg.

The spectrogram method should raise exceptions with more sensible error messages.

Bug in SpectralVariation

Adding these lines to gw_ex_plot_spectrogram.py:

import gwpy.spectrum
kwargs = {'log':True,'nbins':500,'norm':True}
specvar = gwpy.spectrum.hist.SpectralVariance.from_spectrogram(specgram,**kwargs)
print specvar
specvar = 100 * specvar
print specvar

triggers an error on the second print line

ERROR: AttributeError: 'SpectralVariance' object has no attribute '_bins' [gwpy.spectrum.hist]
Traceback (most recent call last):
File "gw_ex_plot_spectrogram.py", line 60, in
print specvar
File "/home/mcoughlin/.local/lib/python2.6/site-packages/gwpy-0.0.dev387-py2.6.egg/gwpy/data/array.py", line 164, in str
rval = str(getattr(self, key)).replace('\n',
File "/home/mcoughlin/.local/lib/python2.6/site-packages/gwpy-0.0.dev387-py2.6.egg/gwpy/spectrum/hist.py", line 76, in bins
return self._bins
AttributeError: 'SpectralVariance' object has no attribute '_bins'

gwpy-plot timeseries gives different plot for minute, second trend, raw data

I plotted a timeseries using minute trend data. I'm looking for where the HWS camera turns off, and on the minute plot it's at 60 minutes in. When I switched to second trend for better resolution, it's at 80 minutes in. With the raw data, it never turns off. I'm not sure whether this is a bug in the plotting code or maybe in NDS2.

gwpy-plot timeseries --chan "H1:TCS-ITMX_HWS_DALSACAMERASWITCH.mean,m-trend" "H1:TCS-ITMY_HWS_DALSACAMERASWITCH.mean,m-trend" --start 1113368400 --dur 7200 --ymin -0.1 --ymax 1.1 --out test-hws-mtrend.png

test-hws-mtrend

gwpy-plot timeseries --chan "H1:TCS-ITMX_HWS_DALSACAMERASWITCH.mean,s-trend" "H1:TCS-ITMY_HWS_DALSACAMERASWITCH.mean,s-trend" --start 1113368400 --dur 7200 --ymin -0.1 --ymax 1.1 --out test-hws-strend.png

test-hws-strend

gwpy-plot timeseries --chan "H1:TCS-ITMX_HWS_DALSACAMERASWITCH" "H1:TCS-ITMY_HWS_DALSACAMERASWITCH" --start 1113368400 --dur 7200 --ymin -0.1 --ymax 1.1 --out test-hws-raw.png

test-hws-raw

Default spectrogram from time series will fail on image rendering

The default spectrogram created from a time series will produce low frequency of 0 Hz and also assign a logscale to the frequency axis. Upon rendering (matplotlib.savefig) this raises a ValueError since the frequency axis now attempts to span the semi-infinite interval.

(Pdb) l
 49             super(SpectrogramPlot, self).__init__(**kwargs)
 50     
 51             # plot data
 52             for i,spectrogram in enumerate(spectrograms):
 53                 self.add_spectrogram(spectrogram, newax=sep, **plotargs)
 54  ->             self.axes[-1].set_yscale('log')
 55                 self.axes[-1].fmt_ydata = lambda f: ('%s %s'
 56                                                      % (f, spectrogram.yunit))
 57                 self.axes[-1].set_ylabel('Frequency [%s]' % spectrogram.yunit)
 58     
 59             # set matching epoch for each set of axes
(Pdb) spectrogram.f0
<Quantity 0.0 Hz>
(Pdb) bt
  /home/pankow/magnetometer/gnome-data-analysis/8_16_2014_analysis/script_spectrogram(15)<module>()
-> plot = specgram.plot(norm='log',vmin=1e-7,vmax=1e-5)
  /home/detchar/opt/gwpysoft/lib64/python2.6/site-packages/gwpy/spectrogram/core.py(191)plot()
-> return SpectrogramPlot(self, **kwargs)
> /home/detchar/opt/gwpysoft/lib64/python2.6/site-packages/gwpy/plotter/spectrogram.py(54)__init__()
-> self.axes[-1].set_yscale('log')

ValueError raised by numpy.max in cli.spectrogram

This LDVW URL request reports an error from the gwpy-plot CLI process:

Traceback (most recent call last):
File "/usr/local/ldvw/bin/gwpy-plot", line 118, in 
result_code = prod.makePlot(args)
File "/usr/lib/python2.6/site-packages/gwpy/cli/cliproduct.py", line 778, in makePlot
self.gen_plot(args)
File "/usr/lib/python2.6/site-packages/gwpy/cli/spectrogram.py", line 87, in gen_plot
stride = max(2*secpfft, stride)
File "/usr/lib64/python2.6/site-packages/numpy/core/fromnumeric.py", line 2135, in amax
out=out, keepdims=keepdims)
File "/usr/lib64/python2.6/site-packages/numpy/core/_methods.py", line 26, in _amax
return umr_maximum(a, axis, None, out, keepdims)
ValueError: 'axis' entry is out of bounds

The original command-line is reported as

gwpy-plot spectrogram --chan 'L1:OAF-CAL_DARM_DQ' --start 1109982616 --duration 600 --out '/usr/local/tomcat_base/temp/ldvw8406441437680960249.png' --secpfft '0.500' --overlap '0.900' --fmin 40 --fmax 4000 --imin '0.500' --imax '10.000' --norm

The error comes from misuse of numpy.max (and probably also numpy.min). I am preparing a fix which will be submitted via PR.

Time series fetch seems to have trouble with with odd prefixes

The following code snippet fails with the latest pull from dev, it did work in previous versions:

from gwpy.timeseries import TimeSeries
chan = 'LVE-EX:X3_810BTORR.mean,m-trend'
dur = 36000
start = 1072539420
data = TimeSeries.fetch(chan, start, start+dur, verbose=True)

produces the error:
```AttributeError: 'Channel' object has no attribute '_ifo' ```

This is one of the examples in gwpy-plot documentation.  The plot from a previous version looks like: 

https://ligodv.areeda.com/gwpy/cli_examples/cli-ts-02.png

gwpy-plot raises NotImplementedError with matplotlib < 1.4

The gwpy-plot CLI ends up raising a NotImplementedError when the legend is removed with matplotlib < 1.4:

$ gwpy-plot timeseries --chan L1:OAF-CAL_DARM_DQ --start 1102766651 --out /tmp/cli-01.png
Traceback (most recent call last):
  File "/home/duncan.macleod/.local/bin/gwpy-plot", line 5, in <module>
    pkg_resources.run_script('gwpy==0.1a10.dev427', 'gwpy-plot')
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 534, in run_script
    dist = self.by_key.get(req.key)
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 1434, in run_script
    def _listdir(self,fspath):
  File "/mnt/qfs4/duncan.macleod/.local/lib/python2.6/site-packages/gwpy-0.1a10.dev427-py2.6.egg/EGG-INFO/scripts/gwpy-plot", line 118, in <module>
    result_code = prod.makePlot(args)
  File "/home/duncan.macleod/.local/lib/python2.6/site-packages/gwpy-0.1a10.dev427-py2.6.egg/gwpy/cli/cliproduct.py", line 777, in makePlot
    self.annotate_save_plot(args)
  File "/home/duncan.macleod/.local/lib/python2.6/site-packages/gwpy-0.1a10.dev427-py2.6.egg/gwpy/cli/cliproduct.py", line 650, in annotate_save_plot
    self.ax.legend_.remove()
  File "/home/duncan.macleod/.local/lib/python2.6/site-packages/matplotlib/artist.py", line 137, in remove
    raise NotImplementedError('cannot remove artist')
NotImplementedError: cannot remove artist

This has been confirmed with matplotlib 1.3.1, and confirmed as not a bug with matplotlib 1.4.2.

SnglBurstTable.fetch does not return error messages

Trying to get Omicron triggers using the fetch method of SnglBurstTable, I found that no error message is returned if the channel is not analyzed by Omicron (or if the channel name is wrong). Also no error message is given if the name of the ETG is wrong, and the help message doesn't list the possible ETGs, or specify formatting (e.g. omicron vs Omicron).

Examples:

SnglBurstTable.fetch('H1:NOT-A_CHANNEL','omicron',1111230000,1111240000)

SnglBurstTable.fetch('H1:LSC-DARM_IN1_DQ','iota',1111230000,1111240000)

Both return an empty list.

Spectrogram plotting fails with AttributeError

ERROR: AttributeError: 'Array' object has no attribute 'value'
You can trigger it by creating a spectrogram and calling its .plot() function.

[gwpy.plotter.spectrogram]
Traceback (most recent call last):
File "pylal_seismon_run", line 279, in
pylal.pylal_seismon_psd.spectra(params,channel,segment)
File "/home/mcoughlin/LAL/master/lib64/python2.6/site-packages/pylal/pylal_seismon_psd.py", line 468, in spectra
plot = medratio.plot()
File "/home/mcoughlin/.local/lib/python2.6/site-packages/gwpy-0.0.dev247-py2.6.egg/gwpy/spectrogram/core.py", line 154, in plot
return SpectrogramPlot(self, **kwargs)
File "/home/mcoughlin/.local/lib/python2.6/site-packages/gwpy-0.0.dev247-py2.6.egg/gwpy/plotter/spectrogram.py", line 52, in init
ymax = max(s.frequencies.max().value for s in spectrograms)
File "/home/mcoughlin/.local/lib/python2.6/site-packages/gwpy-0.0.dev247-py2.6.egg/gwpy/plotter/spectrogram.py", line 52, in
ymax = max(s.frequencies.max().value for s in spectrograms)
AttributeError: 'Array' object has no attribute 'value'

Table.read(format='txt') doesn't allow loadtxt kwargs

The Table.read() unified IO method for formats txt and csv doesn't accept other kwargs that can be passed to numpy.loadtxt:

>>> events = MultiBurstTable.read('/home/marissa.walker/L1_cwb_Feb28_2015/report/postprod/M1.R_RSRA_i0cc60_i1rho0_freq64_2048/data/EVENTS.txt', columns=['snr', 'flow', 'fhigh', 'duration', 'time'], usecols=[2, 13, 14, 15, 20])
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/mnt/qfs4/duncan.macleod/<ipython console> in <module>()

/home/duncan.macleod/.local/lib/python2.6/site-packages/astropy-1.0.1-py2.6-linux-x86_64.egg/astropy/io/registry.pyc in read(cls, *args, **kwargs)
    324 
    325         reader = get_reader(format, cls)
--> 326         data = reader(*args, **kwargs)
    327 
    328         if not isinstance(data, cls):

TypeError: table_from_ascii_rows() got an unexpected keyword argument 'usecols'

run from the LIGO-CIT data centre. I think just passing kwargs onto numpy.loadtxt is the easiest way to go.

NDS2 server selection doesn't work for LVE-EX-style channels

Each of the LIGO sites uses a number of channels such as LVE-EX:X3_810BTORR for monitoring the vacuum system. Since the prefix LVE-EX doesn't parse as a proper IFO prefix, the default NDS2 server is selected as that at CIT.

While the prefix doesn't identify the IFO, it does identify the site, since they are either e.g. LVE-EX or HVE-EX, for LLO and LHO respectively.

The NDS2 server selection algorithm should be able to select a server for these channels as well.

LIGO_LW tables should read ASCII/CSV with unified I/O read() method

The LIGO_LW format tables imported from glue should be able to read space-, tab-, and comma-separated text files using the standard unified read() method.

The following simple example works fine for reading CSV and is easily adaptable for other delimiters:

import numpy
from gwpy.table.lsctables import (New, SnglBurstTable)
from gwpy.time import LIGOTimeGPS
trigs = New(SnglBurstTable, columns=['peak_time', 'peak_time_ns', 'snr', 'central_freq'])
for t, f, snr in numpy.loadtxt('mytrigs.csv', delimiter=','):
    row = trigs.RowType()
    row.set_peak(LIGOTimeGPS(float(t)))
    row.central_freq = f
    row.snr = snr
    trigs.append(row)

filtering out by factor of 2*pi

All filtering is out by a factor of 2_pi at the moment. On line 169 in:
/mnt/qfs5/detchar/opt/gwpysoft/lib64/python2.6/site-packages/gwpy/spectrum/core.py
frequencies should actually be w (so 2_pi*frequencies)

cli: example fails on 58a68a

On the current HEAD of the GWpy repository, the CLI example cli-spg-01.png fails to build as follows:

$ make ../build/sphinx/cli_examples/cli-spg-01.png
cli-spg-01
Traceback (most recent call last):
  File "../bin/gwpy-plot", line 118, in <module>
    result_code = prod.makePlot(args)
  File "/home/duncan.macleod/.local/lib/python2.6/site-packages/gwpy-0.1b1.dev17-py2.6.egg/gwpy/cli/cliproduct.py", line 797, in makePlot
    self.gen_plot(args)
  File "/home/duncan.macleod/.local/lib/python2.6/site-packages/gwpy-0.1b1.dev17-py2.6.egg/gwpy/cli/spectrogram.py", line 94, in gen_plot
    snr_nfft = self.dur / (secpfft * stride)
NameError: global name 'stride' is not defined
make: *** [../build/sphinx/cli_examples/cli-spg-01.png] Error 1

@areeda, can you take a look?

LAL incompatibility

As of today, the latest version of LAL in master does not jive well with GWpy. It seems that from lal import lal doesn't work anymore (although import lal does). For instance:

>>> from gwpy.timeseries import TimeSeries
>>> data = TimeSeries.read("/archive/frames/trend/minute-trend/40m/C-M-11/C-M-1111554000-3600.gwf", "C1:LSC-DARM_OUT_DQ.mean")
>>> spectrum = data.asd(method='median-mean')
  File "<stdin>", line 1, in <module>
  File "/home/max.isi/.local/lib/python2.6/site-packages/gwpy-0.1b1.dev17-py2.6.egg/gwpy/timeseries/core.py", line 492, in asd
    overlap=overlap, **kwargs) ** (1/2.)
  File "/home/max.isi/.local/lib/python2.6/site-packages/gwpy-0.1b1.dev17-py2.6.egg/gwpy/timeseries/core.py", line 459, in psd
    psd_ = method_func(self, nfft, **kwargs)
  File "/home/max.isi/.local/lib/python2.6/site-packages/gwpy-0.1b1.dev17-py2.6.egg/gwpy/spectrum/lal_.py", line 220, in _spectrum
    return lal_psd(*args, **kwargs)
  File "/home/max.isi/.local/lib/python2.6/site-packages/gwpy-0.1b1.dev17-py2.6.egg/gwpy/utils/deps.py", line 81, in wrapper
    stacklevel=2)
  File "/home/max.isi/.local/lib/python2.6/site-packages/gwpy-0.1b1.dev17-py2.6.egg/gwpy/utils/deps.py", line 50, in import_method_dependency
    return __import__(module, fromlist=[''])
ImportError: Cannot import lal.lal required by the _spectrum() method: 'No module named lal'

Spectrogram calculation is sub-optimal

The current Spectrogram calculation (from a TimeSeries) uses non-overlapping chunks, with each one being used to calculate a PSD. This means the edges of each chunk are not represented properly in the overall result, and that the resolution of the resulting Spectrogram is low.

We need to rethink the way the Spectrogram is calculated, mainly for plotting purposes.

TimeSeries.read is poorly documented

The TimeSeries.read method is poorly documented. One user tried the following:

data = TimeSeries.read('/archive/frames/A6/raw/H1/H-H1_R-11112/H-H1_R-1111231744-64.gwf', 'H1:LSC-DARM_IN1_DQ', 1111231750, 1111231770)

which should work, but doesn't because of the way the keyword arguments are passed around.

Improvements need to be made to the keyword argument handling, and the docstring for the read() classmethod.

Legend label bug

    plot = dataHighpass.plot(label="highpass")
    plot.add_timeseries(dataFull,label="data")
    plot.add_timeseries(dataLowpass,label="lowpass")

This type of behavior throws a keyword error. But if you leave off the first label, the second label gets pointed to the first line, the third label to the second, etc.

BodePlot

If I want to plot the transfer function of a filter I naively tried BodePlot('zpk filter') which does not work.

Auto-coherence

Should have a TimeSeries method to run an auto-coherence, i.e. coherence of a time-series with a time-shifted version of itself.

Select server for nds transfer based on time of the data

Data at the sites LLO/LHO are archived to tape after about a month, perhaps 3 weeks. Data can take hours to retrieve from tape if multiple people are using it.

LDR sometimes gets behind so while data usually arrives at CIT in 10 minutes, we seen it take a week when something nasty happens.

A solution, or at least improvement would be to have the choice of server to try first depend on the age of the data being requested. A good cut-off value seems to be 2 weeks. If the data is older than that NDS2 server at CIT should be preferred over the server at the appropriate observatory.

gwpy-plot timeseries of constant value give error,but produces a reasonable plot

Example:

gwpy-plot timeseries --chan H1:LSC-Y_TR_A_LF_OUT_DQ --start
Gives:

/home/detchar/opt/gwpysoft/lib64/python2.6/site-packages/matplotlib/axes.py:2760: UserWarning: Attempting to set identical bottom==top results
in singular transformations; automatically expanding.
bottom=615.266601562, top=615.266601562

  • 'bottom=%s, top=%s') % (bottom, top))

gwpy-plot should detect this and do some expansion of the axis.

Coherence default fftlen doesn't work

Calling coherence on a time series fails with an exception in mlab.py on line 1362 (my version) where it checks
if len(x) < 2 * NFFT
But in core.py around line 991 it sets
fftlength = self_.duration.value
then later turns that to samples.

Setting fftlen explicitly works fine.

Value of a TimeSeries.epoch is incorrect

I have a time series whose .value property is 35 seconds before the correct answer. I did

data2 = TimeSeries.fetch('H1:SUS-MC2_M3_MASTER_OUT_UR_DQ', 1112015670, 1112015676, verbose=True)

Then data2.epoch gives

but data2.epoch.value is 1112015635.0

Spectrogram2 sometimes has wrong scaling

For certain choices of fftlength and overlap, spectrogram2 is scaled wrong. In the example, the data is 6 seconds but the plot is squashed into 5.76 seconds. I injected a delta function, and it shows up at the wrong time, consistent with the squashing. This is only really noticeable for certain choices and not for others. Maybe there's a weird rounding error?

image

from gwpy.timeseries import TimeSeries

start_time = 1113031000
dur = 6

probe = 4.

darm=TimeSeries.fetch('L1:OAF-CAL_DARM_DQ',start_time,start_time+dur)

idx = int(16384*probe)
darm[idx] = 0.*darm[idx]

specgram = darm.spectrogram2(fftlength=0.05, overlap=0.049) ** (1/2.)
medratio = specgram.ratio('median')
plot = medratio.plot(norm='log', vmin=0.5, vmax=10)
plot.set_yscale('log')
plot.set_ylim(32, 8192)
plot.set_xlim(start_time, start_time+dur)
ax = plot.gca()

ax.axvline(start_time+probe,c='k',label='correct loc')
ax.axvline(start_time+(5.76/6.)*probe,c='r',label='scaled by .96')
ax.legend()
plot.savefig('test-specgram.png')

TimeSeriesPlot y-axis values should use scientific notation below 1e-3

The TimeSeriesPlot prints y-axis values as float, instead of scientific notation, for values that are very small:

from gwpy.timeseries import TimeSeries
data = TimeSeries.fetch('L1:OAF-CAL_DARM_DQ', 1108807722, 1108807724)
plot = data.plot()
plot.show()

gwpy-y-axis-values

Ideally the y-axis tick labels would be -11e-5 up to -4e-5 or similar.

Using label kwarg in TimeSeries.plot raises TypeError

The TimeSeries.plot method should be able to handle a custom label for the plot. Currently the following code raises a TypeError:

from urllib2 import urlopen
from numpy import asarray
from gwpy.timeseries import TimeSeries

data = urlopen(
    'http://www.ligo.org/science/GW100916/L-strain_hp30-968654552-10.txt'
).read()
ts = TimeSeries(asarray(data.splitlines(), dtype=float),
                epoch=968654552, sample_rate=16384, unit='strain')
plot = ts.plot(label='TEST')
plot.set_title('LIGO Livingston Observatory data for GW100916')
plot.set_ylabel('Gravitational-wave strain amplitude')
plot.show()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.