gwsumm 2.2.4__tar.gz → 2.2.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gwsumm-2.2.4 → gwsumm-2.2.6}/PKG-INFO +2 -2
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/_version.py +2 -2
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/archive.py +73 -2
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/channels.py +86 -4
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/data/coherence.py +35 -1
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/data/range.py +14 -10
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/html/bootstrap.py +1 -1
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/html/static.py +2 -2
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm.egg-info/PKG-INFO +2 -2
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm.egg-info/requires.txt +1 -1
- {gwsumm-2.2.4 → gwsumm-2.2.6}/pyproject.toml +1 -1
- {gwsumm-2.2.4 → gwsumm-2.2.6}/.codeclimate.yml +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/.codecov.yml +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/.flake8 +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/.gitattributes +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/.github/workflows/build.yml +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/.github/workflows/lint.yml +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/.gitignore +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/.readthedocs.yaml +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/CONTRIBUTING.md +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/LICENSE +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/MANIFEST.in +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/README.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/Makefile +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/_static/css/custom.css +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/_templates/autoclass/class.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/_templates/autosummary/base.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/_templates/autosummary/class.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/_templates/autosummary/module.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/_templates/layout.html +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/api/index.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/automation.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/cli.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/conf.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/configuration/data.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/configuration/format.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/configuration/index.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/configuration/tabs.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/environment.yml +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/examples/first.png +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/examples/imc.png +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/images/screenshot.png +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/index.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/make.bat +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/modes.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/overview.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/plots.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/states.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/tabs/api.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/tabs/index.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/tabs/modes.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/docs/tabs/websites.rst +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/__init__.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/__main__.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/batch.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/config/__init__.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/config/defaults.ini +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/config/matplotlib.ini +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/data/__init__.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/data/mathutils.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/data/spectral.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/data/timeseries.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/data/utils.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/globalv.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/html/__init__.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/html/html5.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/html/tests/__init__.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/html/tests/test_bootstrap.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/html/tests/test_html5.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/html/tests/test_static.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/io.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/mode.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/__init__.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/builtin.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/core.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/guardian/__init__.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/guardian/__main__.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/guardian/core.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/guardian/tests/__init__.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/guardian/tests/test_main.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/mixins.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/noisebudget.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/range.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/registry.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/segments.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/sei.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/triggers/__init__.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/triggers/__main__.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/triggers/core.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/triggers/tests/__init__.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/triggers/tests/test_main.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/plot/utils.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/segments.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/state/__init__.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/state/all.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/state/core.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/state/registry.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tabs/__init__.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tabs/builtin.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tabs/core.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tabs/data.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tabs/etg.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tabs/fscan.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tabs/gracedb.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tabs/guardian.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tabs/management.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tabs/misc.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tabs/registry.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tabs/sei.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tabs/stamp.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tests/__init__.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tests/common.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tests/test_archive.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tests/test_batch.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tests/test_channels.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tests/test_config.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tests/test_data.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tests/test_mode.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tests/test_plot.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tests/test_tabs.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/tests/test_utils.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/triggers.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/units.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm/utils.py +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm.egg-info/SOURCES.txt +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm.egg-info/dependency_links.txt +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm.egg-info/entry_points.txt +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/gwsumm.egg-info/top_level.txt +0 -0
- {gwsumm-2.2.4 → gwsumm-2.2.6}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: gwsumm
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.6
|
|
4
4
|
Summary: A python toolbox used by the LIGO Scientific Collaboration for detector characterisation
|
|
5
5
|
Author-email: Alex Urban <alex.urban@ligo.org>, Duncan Macleod <duncan.macleod@ligo.org>
|
|
6
6
|
Maintainer-email: Evan Goetz <evan.goetz@ligo.org>
|
|
@@ -28,7 +28,7 @@ Description-Content-Type: text/x-rst
|
|
|
28
28
|
License-File: LICENSE
|
|
29
29
|
Requires-Dist: astropy>=3.0.0
|
|
30
30
|
Requires-Dist: gwdatafind>=1.1.1
|
|
31
|
-
Requires-Dist: gwdetchar>=2.2.
|
|
31
|
+
Requires-Dist: gwdetchar>=2.2.6
|
|
32
32
|
Requires-Dist: gwpy>=2.0.0
|
|
33
33
|
Requires-Dist: gwtrigfind
|
|
34
34
|
Requires-Dist: lalsuite
|
|
@@ -302,18 +302,48 @@ def read_data_archive(sourcefile, rm_source_on_fail=True):
|
|
|
302
302
|
|
|
303
303
|
def find_daily_archives(start, end, ifo, tag, basedir=os.curdir):
|
|
304
304
|
"""Find the daily archives spanning the given GPS [start, end) interval
|
|
305
|
+
|
|
306
|
+
Parameters
|
|
307
|
+
----------
|
|
308
|
+
start : `float`, `~datetime.datetime`, `~astropy.time.Time`, `str`
|
|
309
|
+
start time of the archive file to find, any object that can be
|
|
310
|
+
converted into a `LIGOTimeGPS`, `~astropy.time.Time`, or
|
|
311
|
+
`~datetime.datetime` is acceptable
|
|
312
|
+
end : `float`, `~datetime.datetime`, `~astropy.time.Time`, `str`
|
|
313
|
+
end time of the archive file to find, any object that can be
|
|
314
|
+
converted into a `LIGOTimeGPS`, `~astropy.time.Time`, or
|
|
315
|
+
`~datetime.datetime` is acceptable
|
|
316
|
+
ifo : `str`
|
|
317
|
+
interferometer string, ex. 'H1'
|
|
318
|
+
tag : `str`
|
|
319
|
+
tag string for the archive file
|
|
320
|
+
basedir : `path-like`, optional
|
|
321
|
+
base path to archive files, default: '.'
|
|
322
|
+
|
|
323
|
+
Returns
|
|
324
|
+
-------
|
|
325
|
+
archives : `list`
|
|
326
|
+
list of matching archive files
|
|
327
|
+
|
|
328
|
+
Notes
|
|
329
|
+
-----
|
|
330
|
+
This will only search the day directories with the format `YYYYMMDD`
|
|
305
331
|
"""
|
|
306
332
|
archives = []
|
|
333
|
+
|
|
334
|
+
# Convert start and end to properly formatted datetime objects
|
|
307
335
|
s = from_gps(to_gps(start))
|
|
308
336
|
e = from_gps(to_gps(end))
|
|
337
|
+
|
|
338
|
+
# append to the archives list as long as the iterating start time is
|
|
339
|
+
# earlier than the end time
|
|
309
340
|
while s < e:
|
|
310
341
|
daybase = mode.get_base(s, mode=mode.Mode.day)
|
|
311
342
|
ds = to_gps(s)
|
|
312
343
|
s += datetime.timedelta(days=1)
|
|
313
344
|
de = to_gps(s)
|
|
314
345
|
archivedir = os.path.join(basedir, daybase, 'archive')
|
|
315
|
-
arch = os.path.join(archivedir, '
|
|
316
|
-
% (ifo, tag, ds, de-ds))
|
|
346
|
+
arch = os.path.join(archivedir, f'{ifo}-{tag}-{ds}-{de-ds}.h5')
|
|
317
347
|
if os.path.isfile(arch):
|
|
318
348
|
archives.append(arch)
|
|
319
349
|
return archives
|
|
@@ -323,6 +353,27 @@ def find_daily_archives(start, end, ifo, tag, basedir=os.curdir):
|
|
|
323
353
|
|
|
324
354
|
def _write_object(data, *args, **kwargs):
|
|
325
355
|
"""Internal method to write something to HDF5 with error handling
|
|
356
|
+
|
|
357
|
+
Parameters
|
|
358
|
+
----------
|
|
359
|
+
data : gwpy object
|
|
360
|
+
TimeSeries or FrequencySeries
|
|
361
|
+
args :
|
|
362
|
+
passed to underlying write method
|
|
363
|
+
kwargs :
|
|
364
|
+
passed to underlying write method
|
|
365
|
+
|
|
366
|
+
Warns
|
|
367
|
+
-----
|
|
368
|
+
TypeError
|
|
369
|
+
ValueError
|
|
370
|
+
RuntimeError
|
|
371
|
+
If the name already exists in the HDF5 file
|
|
372
|
+
|
|
373
|
+
Raises
|
|
374
|
+
------
|
|
375
|
+
RuntimeError
|
|
376
|
+
Any error other than the object name already exists in the HDF5 file
|
|
326
377
|
"""
|
|
327
378
|
try:
|
|
328
379
|
return data.write(*args, **kwargs)
|
|
@@ -337,6 +388,16 @@ def _write_object(data, *args, **kwargs):
|
|
|
337
388
|
|
|
338
389
|
def segments_to_array(segmentlist):
|
|
339
390
|
"""Convert a `SegmentList` to a 2-dimensional `numpy.ndarray`
|
|
391
|
+
|
|
392
|
+
Parameters
|
|
393
|
+
----------
|
|
394
|
+
segmentlist : `~gwpy.segments.SegmentList`
|
|
395
|
+
input segment list to convert
|
|
396
|
+
|
|
397
|
+
Returns
|
|
398
|
+
-------
|
|
399
|
+
out : `float` `numpy.ndarray`
|
|
400
|
+
output segment list as a numpy array
|
|
340
401
|
"""
|
|
341
402
|
out = ndarray((len(segmentlist), 2), dtype=float)
|
|
342
403
|
for i, seg in enumerate(segmentlist):
|
|
@@ -346,6 +407,16 @@ def segments_to_array(segmentlist):
|
|
|
346
407
|
|
|
347
408
|
def segments_from_array(array):
|
|
348
409
|
"""Convert a 2-dimensional `numpy.ndarray` to a `SegmentList`
|
|
410
|
+
|
|
411
|
+
Parameters
|
|
412
|
+
----------
|
|
413
|
+
array : `float` `numpy.ndarray`
|
|
414
|
+
input numpy array to convert into a segment list
|
|
415
|
+
|
|
416
|
+
Returns
|
|
417
|
+
-------
|
|
418
|
+
out : `~gwpy.segments.SegmentList`
|
|
419
|
+
output segment list
|
|
349
420
|
"""
|
|
350
421
|
out = SegmentList()
|
|
351
422
|
for row in array:
|
|
@@ -43,6 +43,18 @@ re_channel = re.compile(r'[A-Z]\d:[a-zA-Z0-9]+' # core channel section L1:TEST
|
|
|
43
43
|
# -- channel creation ---------------------------------------------------------
|
|
44
44
|
|
|
45
45
|
def _match(channel):
|
|
46
|
+
"""Find a matching channel in global memory variable
|
|
47
|
+
|
|
48
|
+
Parameters
|
|
49
|
+
----------
|
|
50
|
+
channel : `str`, `~gwpy.detector.Channel`
|
|
51
|
+
name of a channel
|
|
52
|
+
|
|
53
|
+
Returns
|
|
54
|
+
-------
|
|
55
|
+
found : `Channel`
|
|
56
|
+
matching channel from global memory or an empty list
|
|
57
|
+
"""
|
|
46
58
|
channel = Channel(channel)
|
|
47
59
|
name = str(channel)
|
|
48
60
|
type_ = channel.type
|
|
@@ -69,22 +81,45 @@ def _find_parent(channel):
|
|
|
69
81
|
This is either the raw channel from which a trend was generated, or the
|
|
70
82
|
real channel for a mathematically-manipulated channel.
|
|
71
83
|
|
|
84
|
+
Parameters
|
|
85
|
+
----------
|
|
86
|
+
channel : `~gwpy.detector.Channel`
|
|
87
|
+
trend channel or mathematically-manipulated channel
|
|
88
|
+
|
|
89
|
+
Returns
|
|
90
|
+
-------
|
|
91
|
+
parent_channel : `~gwpy.detector.Channel`
|
|
92
|
+
the raw channel from the trend or real channel from manipulated channel
|
|
93
|
+
|
|
72
94
|
Raises
|
|
73
95
|
------
|
|
74
96
|
ValueError
|
|
75
97
|
if the parent cannot be parsed
|
|
76
98
|
"""
|
|
99
|
+
# If the channel is a trend, then get the part of the name before the dot
|
|
77
100
|
if channel.trend:
|
|
78
101
|
parent = str(channel).rsplit('.')[0]
|
|
79
102
|
else:
|
|
80
103
|
parent, = re_channel.findall(str(channel))
|
|
104
|
+
# If the parent and input channel are the same, then no parent is found
|
|
81
105
|
if parent == str(channel):
|
|
82
|
-
raise ValueError("Cannot find parent for '{
|
|
83
|
-
|
|
106
|
+
raise ValueError(f"Cannot find parent for '{str(channel)}'")
|
|
107
|
+
parent_channel = get_channel(parent)
|
|
108
|
+
return parent_channel
|
|
84
109
|
|
|
85
110
|
|
|
86
111
|
def _update_dependent(channel):
|
|
87
112
|
"""Update a trend channel from its parent
|
|
113
|
+
|
|
114
|
+
TODO: what does this mean?
|
|
115
|
+
|
|
116
|
+
Parameters
|
|
117
|
+
----------
|
|
118
|
+
channel : `~gwpy.detector.Channel`
|
|
119
|
+
|
|
120
|
+
Returns
|
|
121
|
+
-------
|
|
122
|
+
channel : `~gwpy.detector.Channel`
|
|
88
123
|
"""
|
|
89
124
|
try:
|
|
90
125
|
source = _find_parent(channel)
|
|
@@ -126,6 +161,22 @@ def _with_update_dependent(func):
|
|
|
126
161
|
|
|
127
162
|
def _new(channel, find_parent=True):
|
|
128
163
|
"""Create a new `~gwpy.detector.Channel` in the globalv cache.
|
|
164
|
+
|
|
165
|
+
Parameters
|
|
166
|
+
----------
|
|
167
|
+
channel : `str`, `~gwpy.detector.Channel`
|
|
168
|
+
channel string or object to create in the global memory
|
|
169
|
+
find_parent : `bool`, optional, default: `True`
|
|
170
|
+
query for raw version of trend channel (trends not in CIS)
|
|
171
|
+
|
|
172
|
+
Returns
|
|
173
|
+
-------
|
|
174
|
+
Channel : `~gwpy.detector.Channel`
|
|
175
|
+
newly created channel
|
|
176
|
+
|
|
177
|
+
Raises
|
|
178
|
+
------
|
|
179
|
+
RuntimeError
|
|
129
180
|
"""
|
|
130
181
|
# convert to Channel
|
|
131
182
|
if isinstance(channel, Channel):
|
|
@@ -229,7 +280,19 @@ def get_channel(channel, find_parent=True, timeout=5):
|
|
|
229
280
|
|
|
230
281
|
|
|
231
282
|
def get_channels(channels, **kwargs):
|
|
232
|
-
"""Find (or create) multiple channels
|
|
283
|
+
"""Find (or create) multiple channels calling get_channel()
|
|
284
|
+
|
|
285
|
+
Parameters
|
|
286
|
+
----------
|
|
287
|
+
channels : `list`
|
|
288
|
+
list of channels as `str` or `~gwpy.detector.Channel` objects
|
|
289
|
+
**kwargs
|
|
290
|
+
keyword arguments applied to each channel in the list
|
|
291
|
+
|
|
292
|
+
Returns
|
|
293
|
+
-------
|
|
294
|
+
ChannelList : `~gwpy.detector.ChannelList`
|
|
295
|
+
a list of channels
|
|
233
296
|
|
|
234
297
|
See Also
|
|
235
298
|
--------
|
|
@@ -252,6 +315,11 @@ def update_missing_channel_params(channel, **kwargs):
|
|
|
252
315
|
channel to update
|
|
253
316
|
**kwargs
|
|
254
317
|
`(key, value)` pairs to set
|
|
318
|
+
|
|
319
|
+
Returns
|
|
320
|
+
-------
|
|
321
|
+
target : `~gwpy.detector.Channel`
|
|
322
|
+
the channel after updating parameters
|
|
255
323
|
"""
|
|
256
324
|
target = get_channel(str(channel))
|
|
257
325
|
if isinstance(channel, Channel):
|
|
@@ -292,6 +360,16 @@ def update_channel_params():
|
|
|
292
360
|
def split(channelstring):
|
|
293
361
|
"""Split a comma-separated list of channels that may, or may not
|
|
294
362
|
contain NDS2 channel types as well
|
|
363
|
+
|
|
364
|
+
Parameters
|
|
365
|
+
----------
|
|
366
|
+
channelstring : `str`
|
|
367
|
+
comma-separated string of channels
|
|
368
|
+
|
|
369
|
+
Returns
|
|
370
|
+
-------
|
|
371
|
+
out : `list`
|
|
372
|
+
list of strings for each channel
|
|
295
373
|
"""
|
|
296
374
|
out = []
|
|
297
375
|
channelstring = re_quote.sub('', channelstring)
|
|
@@ -331,9 +409,13 @@ def split(channelstring):
|
|
|
331
409
|
def split_combination(channelstring):
|
|
332
410
|
"""Split a math-combination of channels
|
|
333
411
|
|
|
412
|
+
Parameters
|
|
413
|
+
----------
|
|
414
|
+
channelstring : `str`
|
|
415
|
+
|
|
334
416
|
Returns
|
|
335
417
|
-------
|
|
336
|
-
|
|
418
|
+
ChannelList : `~gwpy.detector.ChannelList`
|
|
337
419
|
"""
|
|
338
420
|
return get_channels(re_channel.findall(str(channelstring)),
|
|
339
421
|
find_parent=False)
|
|
@@ -29,7 +29,8 @@ import numpy
|
|
|
29
29
|
|
|
30
30
|
from astropy import units
|
|
31
31
|
|
|
32
|
-
from gwpy.segments import (DataQualityFlag, SegmentList,
|
|
32
|
+
from gwpy.segments import (DataQualityFlag, SegmentList,
|
|
33
|
+
Segment, SegmentListDict)
|
|
33
34
|
from gwpy.frequencyseries import FrequencySeries
|
|
34
35
|
from gwpy.spectrogram import SpectrogramList
|
|
35
36
|
|
|
@@ -131,8 +132,41 @@ def _get_coherence_spectrogram(channel_pair, segments, config=None,
|
|
|
131
132
|
sampling = None
|
|
132
133
|
|
|
133
134
|
# initialize component lists if they don't exist yet
|
|
135
|
+
# store compnents in a backup variable
|
|
136
|
+
coherence_bkp = {}
|
|
134
137
|
for ck in ckeys:
|
|
135
138
|
globalv.COHERENCE_COMPONENTS.setdefault(ck, SpectrogramList())
|
|
139
|
+
coherence_bkp[ck] = globalv.COHERENCE_COMPONENTS.get(
|
|
140
|
+
ck, SpectrogramList())
|
|
141
|
+
|
|
142
|
+
# When coherence components contain different segments,
|
|
143
|
+
# computing coherence for new segments can result in a
|
|
144
|
+
# ValueError traceback due to incompatible shapes.
|
|
145
|
+
# To prevent this issue, we collect segments from all components,
|
|
146
|
+
# clear them from the global variable, and then restore from the
|
|
147
|
+
# coherence_bkp only the data that the segments available in
|
|
148
|
+
# coherence all components.
|
|
149
|
+
|
|
150
|
+
# get the segment spans from all components
|
|
151
|
+
spans = SegmentListDict()
|
|
152
|
+
for ck in ckeys:
|
|
153
|
+
spans[ck] = SegmentList(
|
|
154
|
+
[spec.span for spec in globalv.COHERENCE_COMPONENTS[ck]])
|
|
155
|
+
# keep only the intersection of the segments
|
|
156
|
+
spans = spans.intersection(list(ckeys))
|
|
157
|
+
|
|
158
|
+
# clean the components in the global variable
|
|
159
|
+
globalv.COHERENCE_COMPONENTS.update(
|
|
160
|
+
{ck: SpectrogramList() for ck in ckeys})
|
|
161
|
+
|
|
162
|
+
# restore the data for segments available in all components
|
|
163
|
+
for seg in spans:
|
|
164
|
+
for ck in ckeys:
|
|
165
|
+
spec = _get_from_list(coherence_bkp[ck], seg)
|
|
166
|
+
add_coherence_component_spectrogram(spec, key=ck)
|
|
167
|
+
|
|
168
|
+
# explicitly delete the backup variable to decrease RAM consuption
|
|
169
|
+
del coherence_bkp
|
|
136
170
|
|
|
137
171
|
# get data if query=True or if there are new segments
|
|
138
172
|
query &= abs(new) != 0
|
|
@@ -122,16 +122,20 @@ def get_range_spectrogram(channel, segments, config=None, cache=None,
|
|
|
122
122
|
|
|
123
123
|
# return correct data, according to state segment
|
|
124
124
|
out = SpectrogramList()
|
|
125
|
-
|
|
126
|
-
for
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
125
|
+
try:
|
|
126
|
+
for specgram in globalv.SPECTROGRAMS[key]:
|
|
127
|
+
for seg in segments:
|
|
128
|
+
if abs(seg) < specgram.dt.value:
|
|
129
|
+
continue
|
|
130
|
+
if specgram.span.intersects(seg):
|
|
131
|
+
common = specgram.span & type(seg)(
|
|
132
|
+
seg[0], seg[1] + specgram.dt.value)
|
|
133
|
+
s = specgram.crop(*common)
|
|
134
|
+
if s.shape[0]:
|
|
135
|
+
out.append(s)
|
|
136
|
+
except KeyError:
|
|
137
|
+
# in case the key does not exist return empty SpectrogramList
|
|
138
|
+
return out
|
|
135
139
|
return out.coalesce()
|
|
136
140
|
|
|
137
141
|
|
|
@@ -162,7 +162,7 @@ def state_switcher(states, default=0):
|
|
|
162
162
|
page.a(str(state), class_='dropdown-item state', title=str(state),
|
|
163
163
|
id_='state_%s' % re_cchar.sub('_', str(state)).lower(),
|
|
164
164
|
onclick='jQuery(this).load_state(\'%s\');' % href)
|
|
165
|
-
page.div.close() # dropdown-menu dropdown-menu-
|
|
165
|
+
page.div.close() # dropdown-menu dropdown-menu-end
|
|
166
166
|
page.li.close() # nav-item dropdown state-switch
|
|
167
167
|
page.ul.close() # nav navbar-nav
|
|
168
168
|
return page
|
|
@@ -34,7 +34,7 @@ CSS = OrderedDict((
|
|
|
34
34
|
'font-awesome/6.5.1/css/fontawesome.min.css'),
|
|
35
35
|
('font-awesome-solid', 'https://cdnjs.cloudflare.com/ajax/libs/'
|
|
36
36
|
'font-awesome/6.5.1/css/solid.min.css'),
|
|
37
|
-
('gwbootstrap', 'https://cdn.jsdelivr.net/npm/gwbootstrap@1.3.
|
|
37
|
+
('gwbootstrap', 'https://cdn.jsdelivr.net/npm/gwbootstrap@1.3.6/'
|
|
38
38
|
'lib/gwbootstrap.min.css'),
|
|
39
39
|
))
|
|
40
40
|
|
|
@@ -51,7 +51,7 @@ JS = OrderedDict((
|
|
|
51
51
|
('datepicker', 'https://cdnjs.cloudflare.com/ajax/libs/'
|
|
52
52
|
'bootstrap-datepicker/1.9.0/js/'
|
|
53
53
|
'bootstrap-datepicker.min.js'),
|
|
54
|
-
('gwbootstrap', 'https://cdn.jsdelivr.net/npm/gwbootstrap@1.3.
|
|
54
|
+
('gwbootstrap', 'https://cdn.jsdelivr.net/npm/gwbootstrap@1.3.6/'
|
|
55
55
|
'lib/gwbootstrap-extra.min.js'),
|
|
56
56
|
))
|
|
57
57
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: gwsumm
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.6
|
|
4
4
|
Summary: A python toolbox used by the LIGO Scientific Collaboration for detector characterisation
|
|
5
5
|
Author-email: Alex Urban <alex.urban@ligo.org>, Duncan Macleod <duncan.macleod@ligo.org>
|
|
6
6
|
Maintainer-email: Evan Goetz <evan.goetz@ligo.org>
|
|
@@ -28,7 +28,7 @@ Description-Content-Type: text/x-rst
|
|
|
28
28
|
License-File: LICENSE
|
|
29
29
|
Requires-Dist: astropy>=3.0.0
|
|
30
30
|
Requires-Dist: gwdatafind>=1.1.1
|
|
31
|
-
Requires-Dist: gwdetchar>=2.2.
|
|
31
|
+
Requires-Dist: gwdetchar>=2.2.6
|
|
32
32
|
Requires-Dist: gwpy>=2.0.0
|
|
33
33
|
Requires-Dist: gwtrigfind
|
|
34
34
|
Requires-Dist: lalsuite
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|