GWSumm: the gravitational-wave summary information system

PyPI version Conda version

DOI License Supported Python versions

The gwsumm package is a tool used by the Laser Interferometer Gravitational-wave Observatory (LIGO) to collect, aggregate, and visually summarise the sundry data produced throughout the experiment in order to characterise instrument performance.

The output of this package, known internally as the ‘summary pages’, give an archive of a number of figures or merit, including time-series amplitude trends, frequency spectra and spectrograms, and transient event triggers.

This package includes a collection of command-line utilities and a python module:

import gwsumm

Installation

GWSumm is best installed with conda:

conda install -c conda-forge gwsumm

but can also be installed with pip:

python -m pip install gwsumm

Note, users with LIGO.ORG credentials have access to a software container with a regularly-updated build of GWSumm. For more information please refer to the LSCSoft Conda documentation.

Contributing

All code should follow the Python Style Guide outlined in PEP 0008; users can use the flake8 package to check their code for style issues before submitting.

See the contributions guide for the recommended procedure for proposing additions/changes.

The GWSumm project is hosted on GitHub:

License

GWSumm is distributed under the GNU General Public License.

What is GWSumm?

The gwsumm package (‘the summary pages’) is a python toolbox that can be used to generate a structured HTML webpage displaying graphical data that describe any and all aspects of gravitational-wave interferometer performance. The summary pages were developed in collaboration between the LIGO Laboratory and the GEO600 project with the goal of generating an automated daily summary of laser-interferometer operations and performance.

The LIGO Summary Pages are used to characterize and monitor the status of the detectors and their subsystems. In addition, data products and webpages from other analysis tools are included in the Summary Pages.

The output acts as a kind of daily magazine, allowing instrument scientists and data analysis teams a archived, searchable summary of the key figures of merit that will determine the sensitivity and ultimately the science output of these instruments.

Those readers who are members of the LIGO Scientific Collaboration, the Virgo Collaboration, or KAGRA can view the current LIGO summary pages at the following sites:

H1

https://ldas-jobs.ligo-wa.caltech.edu/~detchar/summary/

L1

https://ldas-jobs.ligo-la.caltech.edu/~detchar/summary/

Working model

The GWSumm package provides an abstract set of classes from which any user can build their own python program to read, manipulate, and display data. However, for the specific purpose of the LIGO instrumental summary pages, the gw_summary command-line executable is used to read in a number of INI-format configuration files that define what data should be read, how it should be manipulated, and how it should all be displayed.

These configuration files are made up [tab-xxx] section with the following format:

[tab-IMC]
name = Input mode cleaner
shortname = IMC
1 = L1:IMC-PWR_IN_OUT_DQ timeseries
1-ylim = 0,80
1-title = 'Power into IMC'
[html]
issues =

This block defines the IMC tab, with a name (and a shortname): a single timeseries plot of the L1:IMC-PWR_IN_OUT_DQ channel. The plot has been customised with a y-axis limit and a title. This also defines the required [html] section, where the required key issues is defined. This example can be saved to a file called imc.ini.

This tab is then generated by passing it to the gw_summary executable, along with some GPS times over which to run:

$ gw_summary gps 'Feb 29 2020 00:00' 'Feb 29 2020 01:00' --config-file imc.ini

This minimal setup will produce the following HTML page 1266969618-1266973218/imc/index.html:

GWSumm example screenshot

Command-line interface

GW Summary

The primary interface for GWSumm is a command-line utility called gw_summary. For a full explanation of the available command-line arguments and options, you can run

$ python ../bin/gw_summary --help
python: can't open file '/home/docs/checkouts/readthedocs.org/user_builds/gwsumm/checkouts/stable/docs/../bin/gw_summary': [Errno 2] No such file or directory

This tool can be run in four modes: daily, weekly, and monthly analyses, and a specific range of GPS times.

Day mode

To run in daily summary mode, the following command-line options are available:

$ python gw_summary day --help
python: can't open file '/home/docs/checkouts/readthedocs.org/user_builds/gwsumm/checkouts/stable/docs/gw_summary': [Errno 2] No such file or directory
Week mode

The arguments in weekly mode are as follows:

$ python gw_summary week --help
python: can't open file '/home/docs/checkouts/readthedocs.org/user_builds/gwsumm/checkouts/stable/docs/gw_summary': [Errno 2] No such file or directory
Month mode

In monthly mode:

$ python gw_summary month --help
python: can't open file '/home/docs/checkouts/readthedocs.org/user_builds/gwsumm/checkouts/stable/docs/gw_summary': [Errno 2] No such file or directory
GPS mode

To run within a specific (but arbitrary) range of GPS seconds:

$ python gw_summary gps --help
python: can't open file '/home/docs/checkouts/readthedocs.org/user_builds/gwsumm/checkouts/stable/docs/gw_summary': [Errno 2] No such file or directory
Batch mode

To stage a batch of analyses with a large collection of configuration files, as is done in embarrassingly parallel fashion when the summary pages run online, you can use the gw_summary_pipe command-line utility. This tool uses HT Condor to schedule and run jobs in parallel.

To see all the available arguments and options for this tool, you can run with –help as usual:

$ python gw_summary_pipe --help
python: can't open file '/home/docs/checkouts/readthedocs.org/user_builds/gwsumm/checkouts/stable/docs/gw_summary_pipe': [Errno 2] No such file or directory

Automatic generation for LIGO

The LIGO Detector Characterization group use the gwsumm package to generate daily, weekly, and monthly summaries of the performance of the LIGO detectors. These data generation runs are automatically completed using the HTCondor high-throughput job scheduler.

Members of the LIGO Scientific Collaboration or the Virgo Collaboration can view more details on the HTCondor configuration here.

Introduction to Tabs

GWsumm can be used either from the command line as described in CLI interface or as a package to progromatically generate pages called “tabs”.

A Tab is a single, configurable page of output, containing some data. Each Tab is written in its own HTML page, and can be written to contain any set of data, with any format.

The basic object provided by :mod:`gwsumm.tabs` is the Tab, which allows embedding of arbitrary HTML text into a standard surrounding HTML framework. The Tab also defines the API for other tabs.

Simple Tab use

A simple Tab can be created in only two steps

from gwsumm.tabs import Tab
mytab = Tab('My first tab')
mytab.write_html("This tab doesn't do very much")

This will create a directory under the current one,

  • my_first_tab/ containing the HTML for the new tab

The output webpage looks like:

First GWSumm example screenshot

The content given to Tab.write_html is passed along untouched, so can contain any HTML you like.

Generating websites

The next page will guide you through created groups of tabs and combining them to generate a fully-fledged website complete with navigation.

Generating Websites

As we have seen, generating standalone pages is trivial using GWSumm. What would be more useful would be to generate linked sets of pages, aka a website.

Tab parents

In the above example, each tab is included as a link in the navigation bar. However, in larger websites with many pages, the navigation can quickly become cluttered and will start to overflow the width of the page. This can be avoided by declaring ~Tab.parent for sets of tabs:

tab1 = Tab('Tab 1')
tab2a = Tab('A', parent='Tab 2')
tab2b = Tab('B', parent=tab2a.parent)
tabs = [tab1, tab2a, tab2b]
tab1.write_html('This is tab 1', tabs=tabs)
tab2a.write_html('This is tab 2A', tabs=tabs)
tab2b.write_html('This is tab 2B', tabs=tabs)

Here we have set a parent tab for 2A, and used the same for 2B, which creates a dropdown menu in the navigation bar linking to these tabs. ‘Tab 2’ is never created, but is used only for navigation.

Tab groups

For even larger websites, sets of tabs under a single parent can be further separated into groups <Tab.group>. For example, to put 2A into group 1 and 2B into group 2, we can write:

tab1 = Tab('Tab 1')
tab2a = Tab('A', parent='Tab 2', group='1')
tab2b = Tab('B', parent=tab2a.parent, group='2')
tabs = [tab1, tab2a, tab2b]
tab1.write_html('This is tab 1', tabs=tabs)
tab2a.write_html('This is tab 2A', tabs=tabs)
tab2b.write_html('This is tab 2B', tabs=tabs)

Tab modes

In its simplest form, the Tab is essentially a blank canvas on which to write whatever you want. However, the original mandate for GWSumm was to provide a framework in which to generate automatic summaries of LIGO data, over a given timescale.

To handle data processing, rather than static HTML generation, each Tab has a type, based on its relation to any interval in time

The type of a Tab is set automatically when it is created based on the value of the :attr:`~Tab.mode` attribute, so you don’t need to remember the above objects.

Modes

GWSumm currently support seven different Tab modes:

Mode

Enum

Description

STATIC

0

No associated time interval

EVENT

1

Associated with a single GPS time, normally around an event

GPS

2

Simple (arbitrary) GPS [start, end) interval

DAY

10

One UTC 24-hour day

WEEK

11

One 7-day week

MONTH

12

One calendar month

YEAR

13

One calendar year

Assigning modes

Each Tab will be assigned a mode (unless specified as follows, the default mode is STATIC). The assignment can be done on a per-tab basis by passing the ~Tab.mode keyword argument when creating a Tab, or globally, by using the :meth:`gwsumm.mode.set_mode`. The latter sets the default mode for all subsequent tabs created in this session.

If a :attr:`~Tab.mode` is given that associates with a GPS time or times, these must be given via the ~IntervalTab.span or ~EventTab.gpstime keyword arguments, otherwise a TypeError will be raised. The span tuple is the (GPS start time, GPS end time)

>>> tab = Tab('My first tab', mode='day', span=(0, 100))
>>> print(tab.mode, tab.span)
(10, Segment(0, 100))
>>> tab = Tab('My first tab', mode='EVENT', gpstime=101)
>>> print(tab.mode, tab.gpstime)
(1, LIGOTimeGPS(101,0))

Tab API

gwsumm.tabs Package

This module defines the Tab API, and all of the built-in tab objects

Functions

get_tab(name)

Query the registry for the tab class registered to the given name

register_tab(tab[, name, force])

Register a new summary Tab to the given name

Classes

AboutTab(*args, **kwargs)

Page describing how the containing HTML pages were generated

AccountingTab(*args, **kwargs)

Summarise the data recorded by the operating mode channels

BaseTab(name[, index, shortname, parent, ...])

The core Tab object, defining basic functionality

DataTab(*args, **kwargs)

A tab where plots and data summaries are built upon request

Error404Tab(*args, **kwargs)

Custom HTTP 404 error page

EventTab(*args, **kwargs)

Tab defined around a central GPS time

EventTriggerTab(*args, **kwargs)

Custom DataTab displaying a summary of event trigger generation

ExternalTab(*args, **kwargs)

A simple tab to link HTML from an external source

FscanTab(*args, **kwargs)

Custom tab displaying a summary of Fscan results.

GpsTab(name[, index, shortname, parent, ...])

Stub for GPS-related tabs

GraceDbTab(*args, **kwargs)

Custom tab displaying a summary of GraceDb results.

GuardianTab(*args, **kwargs)

Summarises the data recorded by an Advanced LIGO Guardian node.

IntervalTab(*args, **kwargs)

Tab defined within a GPS [start, end) interval

ParentTab(*args, **kwargs)

Dummy Tab only for navigation

PlotTab(*args, **kwargs)

A simple tab to layout some figures in the #main div.

ProcessedTab()

Abstract base class to detect necessity to run Tab.process()

SEIWatchDogTab(*args, **kwargs)

Summarise the WatchDog trips recorded from the SEI system.

StampPEMTab(*args, **kwargs)

Custom tab displaying a summary of StampPEM results.

StateTab(*args, **kwargs)

Tab with multiple content pages defined via 'states'

StaticTab(name[, index, shortname, parent, ...])

Simple Tab with no GPS association

Tab(*args, **kwargs)

A Simple HTML tab.

TabList([entries])

Custom list of Tab objects with sorting and parsing

UrlTab(*args, **kwargs)

Class Inheritance Diagram
digraph inheritance3d6cedfdfd { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "AboutTab" [URL="index.html#gwsumm.tabs.misc.AboutTab",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Page describing how the containing HTML pages were generated"]; "Tab" -> "AboutTab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "AccountingTab" [URL="index.html#gwsumm.tabs.management.AccountingTab",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Summarise the data recorded by the operating mode channels"]; "DataTab" -> "AccountingTab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BaseTab" [URL="index.html#gwsumm.tabs.core.BaseTab",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="The core `Tab` object, defining basic functionality"]; "DataTab" [URL="index.html#gwsumm.tabs.data.DataTab",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A tab where plots and data summaries are built upon request"]; "ProcessedTab" -> "DataTab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "StateTab" -> "DataTab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Error404Tab" [URL="index.html#gwsumm.tabs.misc.Error404Tab",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Custom HTTP 404 error page"]; "Tab" -> "Error404Tab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "EventTab" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="`Tab` defined around a central GPS time"]; "GpsTab" -> "EventTab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "EventTriggerTab" [URL="index.html#gwsumm.tabs.etg.EventTriggerTab",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Custom `DataTab` displaying a summary of event trigger generation"]; "DataTab" -> "EventTriggerTab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ExternalTab" [URL="index.html#gwsumm.tabs.builtin.ExternalTab",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A simple tab to link HTML from an external source"]; "Tab" -> "ExternalTab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "FscanTab" [URL="index.html#gwsumm.tabs.fscan.FscanTab",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Custom tab displaying a summary of Fscan results."]; "DataTab" -> "FscanTab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GpsTab" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Stub for GPS-related tabs"]; "BaseTab" -> "GpsTab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GraceDbTab" [URL="index.html#gwsumm.tabs.gracedb.GraceDbTab",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Custom tab displaying a summary of GraceDb results."]; "DataTab" -> "GraceDbTab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GuardianTab" [URL="index.html#gwsumm.tabs.guardian.GuardianTab",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Summarises the data recorded by an Advanced LIGO Guardian node."]; "DataTab" -> "GuardianTab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "IntervalTab" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="`Tab` defined within a GPS [start, end) interval"]; "GpsTab" -> "IntervalTab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ParentTab" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Dummy `Tab` only for navigation"]; "Tab" -> "ParentTab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PlotTab" [URL="index.html#gwsumm.tabs.builtin.PlotTab",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A simple tab to layout some figures in the #main div."]; "Tab" -> "PlotTab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ProcessedTab" [URL="index.html#gwsumm.tabs.data.ProcessedTab",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Abstract base class to detect necessity to run Tab.process()"]; "SEIWatchDogTab" [URL="index.html#gwsumm.tabs.sei.SEIWatchDogTab",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Summarise the WatchDog trips recorded from the SEI system."]; "DataTab" -> "SEIWatchDogTab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "StampPEMTab" [URL="index.html#gwsumm.tabs.stamp.StampPEMTab",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Custom tab displaying a summary of StampPEM results."]; "DataTab" -> "StampPEMTab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "StateTab" [URL="index.html#gwsumm.tabs.builtin.StateTab",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Tab with multiple content pages defined via 'states'"]; "PlotTab" -> "StateTab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "StaticTab" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Simple `Tab` with no GPS association"]; "BaseTab" -> "StaticTab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Tab" [URL="index.html#gwsumm.tabs.core.Tab",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A Simple HTML tab."]; "BaseTab" -> "Tab" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TabList" [URL="index.html#gwsumm.tabs.core.TabList",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Custom `list` of `Tab` objects with sorting and parsing"]; "UrlTab" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "Tab" -> "UrlTab" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

States

A SummaryState defines a sub-set of time over which a ~gwsumm.tabs.Tab should be processed. Each SummaryState is normally tied to one or more data-quality flags marking times during which each of the LIGO instruments was operating in a certain configuration, or was subject to a known noise interference.

The state registry

GWSumm defines a state ‘registry’, simply a record of all SummaryState objects that have been defined (and registered) so far in a given program. The registry just makes remembering states in complicated programs a little easier.

Any SummaryState can be registered with an arbitrary name as follows:

>>> from gwsumm.state.registry import register_state
>>> register_state(mystate, 'my state')

and can be recovered later:

>>> from gwsumm.state.registry import get_state
>>> mystate = get_state('my state')
API reference

SummaryState(name[, known, active, ...])

An operating state over which to process a ~gwsumm.tabs.DataTab.

get_state(key)

Query the registry for the SummaryState registered to the given key

get_states([keys])

Query the registry for a list of states (defaults to all)

register_state(state[, key, force])

Register a new SummaryState to the given key

Plots

A Plot is a representation of an image to be included in the HTML output a tab.

For simple purposes, a Plot is just a reference to an existing image file that can be imported into an HTML page via the <img> tag.

For more complicated purposes, a number of data plot classes are provided to allow users to generate images on-the-fly. The available classes are:

TimeSeriesDataPlot(*args, **kwargs)

DataPlot of some TimeSeries data.

SpectrogramDataPlot(*args, **kwargs)

DataPlot a Spectrogram

SegmentDataPlot(flags, start, end[, state, ...])

Segment plot of one or more DataQualityFlags <DataQualityFlag>.

StateVectorDataPlot(*args, **kwargs)

DataPlot of some StateVector data.

SpectrumDataPlot(channels, start, end[, ...])

Spectrum plot for a SummaryTab

TimeSeriesHistogramPlot(channels, start, end)

HistogramPlot from a Series

TriggerTimeSeriesDataPlot(*args, **kwargs)

Custom time-series plot to handle discontiguous TimeSeries.

TriggerHistogramPlot(*args, **kwargs)

HistogramPlot from a LIGO_LW Table

TriggerRateDataPlot(*args, **kwargs)

TimeSeriesDataPlot of trigger rate.

gwsumm.mode Module

Job modes

Functions

get_base(date[, mode])

Determine the correct base attribute for the given date and mode.

get_mode([m])

Return the enum for the given mode, defaults to the current mode.

set_mode(m)

Set the current mode.

unique(enumeration)

Class decorator for enumerations ensuring unique member values.

Classes

Enum(value[, names, module, qualname, type, ...])

Create a collection of name/value pairs.

Mode(value[, names, module, qualname, type, ...])

Enumeration of valid processing 'modes'

OrderedEnum(value[, names, module, ...])

Class Inheritance Diagram
digraph inheritance32686c8ec0 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "Enum" [URL="https://docs.python.org/3/library/enum.html#enum.Enum",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Create a collection of name/value pairs."]; "Mode" [URL="index.html#gwsumm.mode.Mode",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Enumeration of valid processing 'modes'"]; "OrderedEnum" -> "Mode" [arrowsize=0.5,style="setlinewidth(0.5)"]; "OrderedEnum" [URL="index.html#gwsumm.mode.OrderedEnum",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Enum" -> "OrderedEnum" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Full API

gwsumm package
Subpackages
gwsumm.config package
Module contents

Thin wrapper around configparser

class gwsumm.config.GWSummConfigParser(*args, **kwargs)[source]

Bases: ConfigParser

OPTCRE = re.compile('(?P<option>[^=\\s][^=]*)\\s*(?P<vi>[=])\\s*(?P<value>.*)$')
finalize()[source]

Finalize this GWSummConfigParser by running all the loaders

This method is just a shortcut to run each of the following

load_plugins()

Load all plugin modules as defined in the [plugins] section

load_units()

Load all unit definitions as defined in the [units] section

load_channels()

Load all channel definitions as given in the selfuration

load_states([section])

Read and format a list of SummaryState definitions from the given :class:`~configparser.ConfigParser`

classmethod from_configparser(cp)[source]

Copy an existing :class:`~configparser.ConfigParser`.

get_css(section='html')[source]
get_javascript(section='html')[source]
interpolate_section_names(**kwargs)[source]

Interpolate a specific key in a section name using val

load_channels()[source]

Load all channel definitions as given in the selfuration

Channels are loaded from sections named [channels-…] or those sections whose name is a channel name in itself

load_plugins()[source]

Load all plugin modules as defined in the [plugins] section

load_rcParams(section='rcParams')[source]

Load custom matplotlib.rcParams for plots in this analysis

load_states(section='states')[source]

Read and format a list of SummaryState definitions from the given :class:`~configparser.ConfigParser`

load_units()[source]

Load all unit definitions as defined in the [units] section

nditems(section, **kwargs)[source]
ndoptions(section, **kwargs)[source]
optionxform

alias of str

read(filenames)[source]

Read and parse a filename or an iterable of filenames.

Files that cannot be opened are silently ignored; this is designed so that you can specify an iterable of potential configuration file locations (e.g. current directory, user’s home directory, systemwide directory), and all existing configuration files in the iterable will be read. A single filename may also be given.

Return list of successfully read files.

set_date_options(start, end, section='DEFAULT')[source]

Set datetime options in [DEFAULT] based on the given times

The following options are set

  • gps-start-time - the integer GPS start time of this job

  • gps-end-time - the integer GPS end time of this job

  • yyyy - the four-digit year of the start date

  • mm - the two-digit month of the start date

  • dd - the two-digit day-of-month of the start date

  • yyyymm - the six-digit year and month of the start date

  • yyyymmdd - the eight-digit year-month-day of the start date

  • duration - the duration of the job (seconds)

Additionally, if LAL is available, the following extra options are also set

  • leap-seconds - the number of leap seconds for the start date

  • gps-start-time-noleap - the leap-corrected integer GPS start time

  • gps-end-time-noleap - the leap-corrected integer GPS end time

set_ifo_options(ifo, observatory=None, section='DEFAULT')[source]

Set configurations options in [DEFAULT] based on the given ifo

The following options are set

  • IFO - the two-character interferometer prefix, e.g. L1

  • ifo - the two-character interferometer prefix in lower-case,

    e.g. l1

  • SITE - the single-character site ID, e.g. L

  • site - the single-character site ID,n lower-case e.g. l

Additionally, if observatory is given, or the ifo matches known observatories, the following option is set

  • observatory - the name of the observatory, e.g. LIGO Livingston

gwsumm.data package
Submodules
gwsumm.data.coherence module

Utilities for data handling and display

gwsumm.data.coherence.add_coherence_component_spectrogram(specgram, key=None, coalesce=True)[source]

Add a Coherence spectrogram to the global memory cache

gwsumm.data.coherence.complex_percentile(array, percentile)[source]
gwsumm.data.coherence.get_coherence_spectrogram(channel_pair, segments, config=None, cache=None, query=True, nds=None, return_=True, frametype=None, nproc=1, datafind_error='raise', return_components=False, **fftparams)[source]

Retrieve the time-series and generate a coherence spectrogram of the two given channels

gwsumm.data.coherence.get_coherence_spectrograms(channel_pairs, segments, config=None, cache=None, query=True, nds=None, return_=True, frametype=None, nproc=1, datafind_error='raise', **fftparams)[source]

Get coherence spectrograms for multiple channels

gwsumm.data.coherence.get_coherence_spectrum(channel_pair, segments, config=None, cache=None, query=True, nds=None, return_=True, **fftparams)[source]

Retrieve the time-series and generate a coherence spectrogram of the given channel

gwsumm.data.mathutils module

Handle arbitrary mathematical operations applied to data series

gwsumm.data.mathutils.get_operator(opstr)[source]
gwsumm.data.mathutils.get_with_math(channel, segments, load_func, get_func, **ioargs)[source]

Get data with optional arbitrary math definitions

Parameters:
channelstr

name of the meta-channel to create

segments~gwpy.segments.SegmentList

segments over which to create the new channel

load_funccallable

method to call to load data from disk

get_funccallable

method to call to return channel data

**ioargs

all other kwargs are passed to the load_func and get_func

Returns:
datalistTimeSeriesList, or similar

a structured list of data objects, probably either for TimeSeries or Spectrogram

gwsumm.data.mathutils.parse_math_definition(definition)[source]

Parse the definition for a channel combination

This method can only handle commutative operations, no fancy stuff with parentheses. Something like A * B is fine, but not (A + B) ^ 2

All operands, operators, and values should be space-separated.

Returns:
channelslist of tuple

a list of 2-tuples containing the name of each channel, and any mathematical operations to be applied to that channel only

operatorslist of callable

the list of functions that combine one channel and the previous, if channels is a list of length N, then the operators list will have length N-1

Examples

>>> parse_math_definition('H1:TEST * L1:TEST^2')
([('H1:TEST', None), ('L1:TEST', (<built-in function pow>, 2.0))],
 [<built-in function mul>])
gwsumm.data.range module

Get range data

gwsumm.data.range.get_range(channel, segments, config=None, cache=None, query=True, nds=None, return_=True, nproc=1, datafind_error='raise', frametype=None, stride=None, fftlength=None, overlap=None, method=None, **rangekwargs)[source]

Calculate the sensitive distance for a given strain channel

gwsumm.data.range.get_range_channel(channel, **rangekwargs)[source]

Return the meta-channel name used to store range data

gwsumm.data.range.get_range_spectrogram(channel, segments, config=None, cache=None, query=True, nds=None, return_=True, nproc=1, datafind_error='raise', frametype=None, stride=60, fftlength=None, overlap=None, method=None, **rangekwargs)[source]

Estimate the spectral contribution to sensitive distance for a given strain channel

gwsumm.data.range.get_range_spectrum(channel, segments, config=None, cache=None, query=True, nds=None, return_=True, nproc=1, datafind_error='raise', frametype=None, stride=60, fftlength=None, overlap=None, method=None, which='all', state=None, **rangekwargs)[source]

Compute percentile spectra of the range integrand from a set of spectrograms

gwsumm.data.spectral module

Get spectrograms and spectra

gwsumm.data.spectral.add_spectrogram(specgram, key=None, coalesce=True)[source]

Add a Spectrogram to the global memory cache

gwsumm.data.spectral.apply_transfer_function_series(specgram, tfunc)[source]

Multiply a spectrogram by a transfer function FrequencySeries

This method interpolates the transfer function onto the frequency vector of the spectrogram, so should work regardless of the inputs

gwsumm.data.spectral.get_spectrogram(channel, segments, config=None, cache=None, query=True, nds=None, format='power', return_=True, frametype=None, nproc=1, datafind_error='raise', **fftparams)[source]

Retrieve the time-series and generate a spectrogram of the given channel

gwsumm.data.spectral.get_spectrograms(channels, segments, config=None, cache=None, query=True, nds=None, format='power', return_=True, frametype=None, nproc=1, datafind_error='raise', **fftparams)[source]

Get spectrograms for multiple channels

gwsumm.data.spectral.get_spectrum(channel, segments, config=None, cache=None, query=True, nds=None, format='power', return_=True, frametype=None, nproc=1, datafind_error='raise', state=None, **fftparams)[source]

Retrieve the time-series and generate a spectrum of the given channel

gwsumm.data.spectral.size_for_spectrogram(size, stride, fftlength, overlap)[source]
gwsumm.data.timeseries module

Utilities for data handling and display

gwsumm.data.timeseries.add_timeseries(timeseries, key=None, coalesce=True)[source]

Add a TimeSeries to the global memory cache

Parameters:
timeseriesTimeSeries or StateVector

the data series to add

keystr, optional

the key with which to store these data, defaults to the ~gwpy.timeseries.TimeSeries.name of the series

coalescebool, optional

coalesce contiguous series after adding, defaults to True

gwsumm.data.timeseries.all_adc(cache)[source]

Returns True if all cache entries point to GWF file known to contain only ADC channels

This is useful to set type=’adc’ when reading with frameCPP, which can greatly speed things up.

gwsumm.data.timeseries.exclude_short_trend_segments(segments, ifo, frametype)[source]

Remove segments from a list shorter than 1 trend sample

gwsumm.data.timeseries.filter_timeseries(ts, filt)[source]

Filter a TimeSeris using a function or a ZPK definition.

gwsumm.data.timeseries.find_best_frames(ifo, frametype, start, end, **kwargs)[source]

Find frames for the given type, replacing with a better type if needed

gwsumm.data.timeseries.find_frame_type(channel)[source]

Find the frametype associated with the given channel

If the input channel has a frametype attribute, that will be used, otherwise the frametype will be guessed based on the channel name and any trend options given

gwsumm.data.timeseries.find_frames(ifo, frametype, gpsstart, gpsend, config=<GWSummConfigParser()>, urltype='file', gaps='warn', onerror='raise')[source]

Query the datafind server for GWF files for the given type

Parameters:
ifostr

prefix for the IFO of interest (either one or two characters)

frametypestr

name of the frametype to find

gpsstartint

GPS start time of the query

gpsendint

GPS end time of the query

config~ConfigParser.ConfigParser, optional

configuration with [datafind] section containing server specification, otherwise taken from the environment

urltypestr, optional

what type of file paths to return, default: file

gapsstr, optional

what to do when gaps are detected, one of

  • ignore : do nothing

  • warn : display the existence of gaps but carry on

  • raise : raise an exception

onerrorstr, optional

what to do when the gwdatafind query itself fails, same options as for gaps

Returns:
cachelist of str

a list of file paths pointing at GWF files matching the request

gwsumm.data.timeseries.frame_trend_type(ifo, frametype)[source]

Returns the trend type of based on the given frametype

gwsumm.data.timeseries.get_channel_type(name)[source]

Returns the probable type of this channel, based on the name

Parameters:
namestr

the name of the channel

Returns:
typestr

one of 'adc', 'proc', or 'sim'

gwsumm.data.timeseries.get_timeseries(channel, segments, config=None, cache=None, query=True, nds=None, nproc=1, frametype=None, statevector=False, return_=True, datafind_error='raise', **ioargs)[source]

Retrieve data for channel

Parameters:
channelstr or ~gwpy.detector.Channel

the name of the channel you want

segments~gwpy.segments.SegmentList

the data segments of interest

config~gwsumm.config.GWSummConfigParser

the configuration for this analysis

cache~glue.lal.Cache or list of str

a cache of data files from which to read

querybool, optional

whether you want to retrieve new data from the source if it hasn’t been loaded already

ndsbool, optional

whether to try and use NDS2 for data access, default is to guess based on other arguments and the environment

nprocint, optional

number of parallel cores to use for file reading, default: 1

frametypestr, optional`

the frametype of the target channels, if not given, this will be guessed based on the channel name(s)

statevectorbool, optional

whether you want to load ~gwpy.timeseries.StateVector rather than ~gwpy.timeseries.TimeSeries data

datafind_errorstr, optional

what to do in the event of a datafind error, one of

  • ‘raise’ : stop immediately upon error

  • ‘warn’ : print warning and continue as if no frames had been found

  • ‘ignore’ : print nothing and continue with no frames

return_bool, optional

whether you actually want anything returned to you, or you are just calling this function to load data for use later

**ioargs

all other keyword arguments are passed to the relevant data reading method (either ~gwpy.timeseries.TimeSeries.read or ~gwpy.timeseries.TimeSeries.fetch or state-vector equivalents)

Returns:
data~gwpy.timeseries.TimeSeriesList

a list of TimeSeries

gwsumm.data.timeseries.get_timeseries_dict(channels, segments, config=<GWSummConfigParser()>, cache=None, query=True, nds=None, nproc=1, frametype=None, statevector=False, return_=True, datafind_error='raise', **ioargs)[source]

Retrieve the data for a set of channels

Parameters:
channelslist of str or ~gwpy.detector.Channel

the channels you want to get

segments~gwpy.segments.SegmentList

the data segments of interest

config~gwsumm.config.GWSummConfigParser

the configuration for this analysis

querybool, optional

whether you want to retrieve new data from the source if it hasn’t been loaded already

ndsbool, optional

whether to try and use NDS2 for data access, default is to guess based on other arguments and the environment

nprocint, optional

number of parallel cores to use for file reading, default: 1

frametypestr, optional`

the frametype of the target channels, if not given, this will be guessed based on the channel name(s)

statevectorbool, optional

whether you want to load ~gwpy.timeseries.StateVector rather than ~gwpy.timeseries.TimeSeries data

datafind_errorstr, optional

what to do in the event of a datafind error, one of

  • ‘raise’ : stop immediately upon error

  • ‘warn’ : print warning and continue as if no frames had been found

  • ‘ignore’ : print nothing and continue with no frames

return_bool, optional

whether you actually want anything returned to you, or you are just calling this function to load data for use later

**ioargs

all other keyword arguments are passed to the relevant data reading method (either ~gwpy.timeseries.TimeSeriesDict.read or ~gwpy.timeseries.TimeSeriesDict.fetch or state-vector equivalents)

Returns:
datalistdict of ~gwpy.timeseries.TimeSeriesList

a set of (channel, TimeSeriesList) pairs

gwsumm.data.timeseries.locate_data(channels, segments, list_class=<class 'gwpy.timeseries.timeseries.TimeSeriesList'>)[source]

Find and return available (already loaded) data

gwsumm.data.timeseries.resample_timeseries_dict(tsd, nproc=1, **sampling_dict)[source]

Resample a TimeSeriesDict

Parameters:
tsd~gwpy.timeseries.TimeSeriesDict

the input dict to resample

nprocint, optional

the number of parallel processes to use

**sampling_dict

<name>=<sampling frequency> pairs defining new sampling frequencies for keys of tsd

Returns:
resampled~gwpy.timeseries.TimeSeriesDict

a new dict with the keys from tsd and resampled values, if that key was included in sampling_dict, or the original value

gwsumm.data.timeseries.sieve_cache(cache, ifo=None, tag=None, segment=None)[source]
gwsumm.data.utils module

Utilities for data loading and pre-processing

class gwsumm.data.utils.FftParams(**kwargs)[source]

Bases: object

Convenience object to hold signal-processing parameters

dict()[source]
fftlength
method
overlap
scheme
stride
window
gwsumm.data.utils.get_fftparams(channel, **defaults)[source]
gwsumm.data.utils.make_globalv_key(channels, fftparams=None)[source]

Generate a unique key for storing data in a globalv dict

Parameters:
channelsstr, list

one or more channels to group in this key

fftparamsFftParams

structured set of signal-processing parameters used to generate the dataset

gwsumm.data.utils.use_configparser(f)[source]

Decorate a method to use a valid default for ‘config’

This is just to allow lazy passing of config=None

gwsumm.data.utils.use_segmentlist(f)[source]

Decorate a method to convert incoming segments into a SegmentList

This assumes that the method to be decorated takes a segment list as the second positionsl argument.

Module contents

Methods and classes for loading and pre-processing data

Each of the sub-modules are designed to read or create the data requested only once, with the containers from the globalv module used as a storage buffer for each unique data type

gwsumm.html package
Subpackages
gwsumm.html.tests package
Submodules
gwsumm.html.tests.test_bootstrap module

Unit tests for gwsumm.html.bootstrap

gwsumm.html.tests.test_bootstrap.test_banner()[source]
gwsumm.html.tests.test_bootstrap.test_base_map_dropdown()[source]
gwsumm.html.tests.test_bootstrap.test_calendar(mode, datefmt)[source]
gwsumm.html.tests.test_bootstrap.test_calendar_no_mode()[source]
gwsumm.html.tests.test_bootstrap.test_state_switcher()[source]
gwsumm.html.tests.test_bootstrap.test_wrap_content()[source]
gwsumm.html.tests.test_html5 module

Unit tests for gwsumm.html.html5

gwsumm.html.tests.test_html5.test_comments_box()[source]
gwsumm.html.tests.test_html5.test_dialog_box(tmpdir)[source]
gwsumm.html.tests.test_html5.test_expand_path()[source]
gwsumm.html.tests.test_html5.test_ldvw_qscan_batch()[source]
gwsumm.html.tests.test_html5.test_ldvw_qscan_single()[source]
gwsumm.html.tests.test_html5.test_load()[source]
gwsumm.html.tests.test_html5.test_load_custom()[source]
gwsumm.html.tests.test_html5.test_load_state()[source]
gwsumm.html.tests.test_html5.test_overlay_canvas()[source]
gwsumm.html.tests.test_static module

Unit tests for gwsumm.html.static

gwsumm.html.tests.test_static.test_get_css()[source]
gwsumm.html.tests.test_static.test_get_js()[source]
Module contents

Unit tests for gwsumm.html

Submodules
gwsumm.html.bootstrap module

Helper functions for twitter-bootstrap HTML constructs.

gwsumm.html.bootstrap.banner(title, subtitle=None, titleclass=None, subtitleclass=None)[source]

Construct a banner heading in bootstrap format

Parameters:
titlestr

name of page (<h1>)

subtitlestr, optional

description of page (<p>)

titleclassstr, optional

class option for <h1>

subtitleclassstr, optional

class option for <p>

Returns:
banner~MarkupPy.markup.page

markup.py page instance

gwsumm.html.bootstrap.base_map_dropdown(this, id_=None, bases={})[source]

Construct a dropdown menu that links to a version of the current page on another server, based on a new base.

gwsumm.html.bootstrap.calendar(date, tag='a', class_='nav-link dropdown-toggle', id_='calendar', dateformat=None, mode=None)[source]

Construct a bootstrap-datepicker calendar.

Parameters:
date:class:`datetime.datetime`, :class:`datetime.date`

active date for the calendar

tagstr

type of enclosing HTML tag, default: <a>

Returns:
calendarlist

a list of three oneliner strings of HTML containing the calendar text and a triggering dropdown

gwsumm.html.bootstrap.state_switcher(states, default=0)[source]

Build a state switch button, including all of the given states, with the default selected by index

gwsumm.html.bootstrap.wrap_content(page)[source]

Utility to wrap some HTML into the relevant <div>s for the main body of a page in bootstrap format

Parameters:
page:class:`~MarkupPy.markup.page`, str

HTML content to be wrapped

spanint

column span of content, default: ‘full’ (12)

Returns:
wrappedpage:class:`~MarkupPy.markup.page`

A new page with the input content wrapped as

<div class="container">
</div>
gwsumm.html.html5 module

HTML5-specific extensions

gwsumm.html.html5.comments_box(name, identifier=None, title=None, url=None)[source]

Generate a Disqus comments box

gwsumm.html.html5.dialog_box(content, title, id_, btntxt)[source]

Generate a dialog box to be loaded modal atop the main page

Parameters:
contentstr

either raw markdown text or the path to a file containing markdown, this will be rendered in HTML as the contents of the dialog box

titlestr

title to display atop the dialog box

id_str

unique identifier for the dialog box

btntxtstr

text (usually a single character) to appear inside a sticky button that opens the dialog box

Returns:
page~MarkupPy.markup.page

fully rendered HTML containing the dialog box

gwsumm.html.html5.ldvw_qscan(channel, time, fmin=10, fmax='inf', qmin=4, qmax=100)[source]

Generate a Q-scan through LIGO DataViewer Web (LDVW)

gwsumm.html.html5.load(url, id_='main', error=False, success=None)[source]

Construct the HTML script required to load a url into the HTML element with the given unique id_.

gwsumm.html.html5.load_state(url)[source]

Construct the HTML script required to load the Tab HTML for a given :class:`~gwsumm.state.core.SummaryState`

Parameters:
urlstr

path (relative to <base>) of HTML to load

id_str, optional, default: ‘#main’

<div> ‘id’ in which to load HTML

Returns:
HTMLstr

HTML one-liner with script loading

gwsumm.html.html5.overlay_canvas()[source]

Generate a dialog box allowing users to select and overlay plots

Returns:
page~MarkupPy.markup.page

fully rendered HTML containing the dialog box

gwsumm.html.static module

HTML <head> helphers

This module mainly declares the resources used by standard on HTML pages

gwsumm.html.static.get_css()[source]

Return a dict of CSS files to link in the HTML <head>

gwsumm.html.static.get_js()[source]

Return a dict of javascript files to link in the HTML <head>

Module contents

HTML helpers

HTML output is built upon the markup.py module and primarily formatted to fit the twitter bootstrap library.

gwsumm.plot package
Subpackages
gwsumm.plot.guardian package
Subpackages
gwsumm.plot.guardian.tests package
Submodules
gwsumm.plot.guardian.tests.test_main module

Tests for the gwsumm.plot.guardian command-line interface

gwsumm.plot.guardian.tests.test_main.test_main(tmpdir, caplog)[source]
Module contents

Unit tests for gwsumm.plot.guardian

Submodules
gwsumm.plot.guardian.core module

Plots of Guardian data

class gwsumm.plot.guardian.core.GuardianStatePlot(*args, **kwargs)[source]

Bases: SegmentDataPlot

defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'color': None, 'contour.algorithm': 'mpl2014', 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'insetlabels': 'inset', 'legend-bbox_to_anchor': (1.0, 1.0), 'legend-borderaxespad': 0, 'legend-fontsize': 12, 'legend-frameon': False, 'legend-handletextpad': 0.5, 'legend-loc': 'upper left', 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'legend_bbox_to_anchor': (1.0, 1.0), 'legend_borderaxespad': 0.0, 'legend_fontsize': 12, 'legend_frameon': False, 'legend_loc': 'upper left', 'linewidth': 0.5, 'mask': None, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'nominalcolor': '#ffb200', 'on-is-bad': False, 'requestcolor': '#0066ff', 'savefig.transparent': True, 'svg.fonttype': 'none', 'text.parse_math': True, 'xscale': 'auto-gps', 'xtick.labelsize': 14.0, 'yscale': 'linear', 'ytick.labelsize': 10}

dict of default plotting kwargs

draw()[source]

Read in all necessary data, and generate the figure.

property ifo
property node
type = 'guardian'

name for DataPlot subclass

Module contents

Submodule for plots of Guardian data

gwsumm.plot.triggers package
Subpackages
gwsumm.plot.triggers.tests package
Submodules
gwsumm.plot.triggers.tests.test_main module

Tests for the gwsumm.plot.triggers command-line interface

gwsumm.plot.triggers.tests.test_main.test_main(dqflag, tmpdir, caplog)[source]
gwsumm.plot.triggers.tests.test_main.test_main_invalid_columns(capsys)[source]
gwsumm.plot.triggers.tests.test_main.test_main_with_cache_and_tiles(tmpdir, caplog)[source]
Module contents

Unit tests for gwsumm.plot.triggers

Submodules
gwsumm.plot.triggers.core module

Definitions for event trigger plots

class gwsumm.plot.triggers.core.TriggerDataPlot(channels, start, end, state=None, outdir='.', etg=None, **kwargs)[source]

Bases: TriggerPlotMixin, TimeSeriesDataPlot

Standard event trigger plot

add_loudest_event(ax, table, rank, *columns, **kwargs)[source]
data = 'triggers'
defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'clim': None, 'cmap': 'YlGnBu', 'color': None, 'colorlabel': None, 'contour.algorithm': 'mpl2014', 'edgecolor': 'face', 'facecolor': None, 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'logcolor': False, 'marker': 'o', 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 's': 20, 'savefig.transparent': True, 'svg.fonttype': 'none', 'text.parse_math': True, 'vmax': None, 'vmin': None, 'x': 'time', 'xscale': 'auto-gps', 'xtick.labelsize': 14.0, 'y': 'snr', 'yscale': 'linear', 'ytick.labelsize': 14.0}

dict of default plotting kwargs

draw()[source]

Read in all necessary data, and generate the figure.

property pid

Unique identifier for this TriggerDataPlot.

Extends the standard TimeSeriesDataPlot pid with the ETG and each of the column names.

type = 'triggers'

name for DataPlot subclass

class gwsumm.plot.triggers.core.TriggerHistogramPlot(*args, **kwargs)[source]

Bases: TriggerPlotMixin, TimeSeriesHistogramPlot

HistogramPlot from a LIGO_LW Table

data = 'triggers'
draw()[source]

Get data and generate the figure.

property pid
type = 'trigger-histogram'

name for DataPlot subclass

class gwsumm.plot.triggers.core.TriggerPlotMixin(*args, **kwargs)[source]

Bases: object

Mixin to overwrite channels property for trigger plots

We don’t need to get channel data for trigger plots.

property allchannels

List of all unique channels for this plot

property pid
class gwsumm.plot.triggers.core.TriggerRateDataPlot(*args, **kwargs)[source]

Bases: TriggerPlotMixin, TimeSeriesDataPlot

TimeSeriesDataPlot of trigger rate.

data = 'triggers'
defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'column': None, 'contour.algorithm': 'mpl2014', 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'legend-bbox_to_anchor': (1.0, 1.0), 'legend-frameon': False, 'legend-loc': 'upper left', 'legend-markerscale': 3, 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'savefig.transparent': True, 'svg.fonttype': 'none', 'text.parse_math': True, 'xscale': 'auto-gps', 'xtick.labelsize': 14.0, 'ylabel': 'Rate [Hz]', 'yscale': 'linear', 'ytick.labelsize': 14.0}

dict of default plotting kwargs

draw()[source]

Read in all necessary data, and generate the figure.

property pid
type = 'trigger-rate'

name for DataPlot subclass

class gwsumm.plot.triggers.core.TriggerTimeSeriesDataPlot(*args, **kwargs)[source]

Bases: TimeSeriesDataPlot

Custom time-series plot to handle discontiguous TimeSeries.

data = 'triggers'
draw()[source]

Read in all necessary data, and generate the figure.

type = 'trigger-timeseries'

name for DataPlot subclass

Module contents

Submodule for plots of event triggers

Submodules
gwsumm.plot.builtin module

Definitions for the standard plots

class gwsumm.plot.builtin.CoherenceSpectrogramDataPlot(*args, **kwargs)[source]

Bases: SpectrogramDataPlot

DataPlot a Spectrogram of the coherence between two channels

data = 'coherence-spectrogram'
defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'clim': None, 'colorlabel': None, 'contour.algorithm': 'mpl2014', 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'format': None, 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'logcolor': False, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'rasterized': True, 'ratio': None, 'savefig.transparent': True, 'svg.fonttype': 'none', 'text.parse_math': True, 'xscale': 'auto-gps', 'xtick.labelsize': 14.0, 'ylabel': 'Frequency [Hz]', 'yscale': 'log', 'ytick.labelsize': 14.0}

dict of default plotting kwargs

type = 'coherence-spectrogram'

name for DataPlot subclass

class gwsumm.plot.builtin.CoherenceSpectrumDataPlot(channels, start, end, state=None, outdir='.', tag=None, pid=None, href=None, new=True, all_data=False, read=True, fileformat='png', caption=None, **pargs)[source]

Bases: SpectrumDataPlot

Coherence pectrum plot for a SummaryTab

data = 'coherence-spectrogram'
defaults = {'alpha': 0.1, 'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'contour.algorithm': 'mpl2014', 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'format': None, 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'no-percentiles': False, 'reference-linestyle': '--', 'savefig.transparent': True, 'svg.fonttype': 'none', 'text.parse_math': True, 'xscale': 'log', 'xtick.labelsize': 14.0, 'yscale': 'linear', 'ytick.labelsize': 14.0, 'zorder': 1}

dict of default plotting kwargs

get_channel_groups()[source]

Hi-jacked method to return pairs of channels

For the CoherenceSpectrumDataPlot this method is only used in determining how to separate lists of plotting argument given by the user.

type = 'coherence-spectrum'

name for DataPlot subclass

class gwsumm.plot.builtin.RayleighSpectrogramDataPlot(*args, **kwargs)[source]

Bases: SpectrogramDataPlot

Rayleigh statistic versino of SpectrogramDataPlot

data = 'rayleigh-spectrogram'
defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'clim': [0.25, 4], 'cmap': 'BrBG_r', 'colorlabel': 'Rayleigh statistic', 'contour.algorithm': 'mpl2014', 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'format': 'rayleigh', 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'rasterized': True, 'ratio': None, 'savefig.transparent': True, 'svg.fonttype': 'none', 'text.parse_math': True, 'xscale': 'auto-gps', 'xtick.labelsize': 14.0, 'ylabel': 'Frequency [Hz]', 'yscale': 'log', 'ytick.labelsize': 14.0}

dict of default plotting kwargs

type = 'rayleigh-spectrogram'

name for DataPlot subclass

class gwsumm.plot.builtin.RayleighSpectrumDataPlot(channels, start, end, state=None, outdir='.', tag=None, pid=None, href=None, new=True, all_data=False, read=True, fileformat='png', caption=None, **pargs)[source]

Bases: SpectrumDataPlot

Rayleigh statistic versino of SpectrumDataPlot

data = 'rayleigh-spectrum'
defaults = {'alpha': 0.1, 'format': 'rayleigh', 'no-percentiles': True, 'reference-linestyle': '--', 'xscale': 'log', 'yscale': 'log', 'zorder': 1}

dict of default plotting kwargs

type = 'rayleigh-spectrum'

name for DataPlot subclass

class gwsumm.plot.builtin.SpectralVarianceDataPlot(channels, *args, **kwargs)[source]

Bases: SpectrumDataPlot

SpectralVariance histogram plot for a DataTab

data = 'spectrogram'
defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'contour.algorithm': 'mpl2014', 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'format': None, 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'log': True, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'nbins': 100, 'no-percentiles': False, 'reference-linestyle': '--', 'savefig.transparent': True, 'svg.fonttype': 'none', 'text.parse_math': True, 'xscale': 'log', 'xtick.labelsize': 14.0, 'yscale': 'log', 'ytick.labelsize': 14.0, 'zorder': 1}

dict of default plotting kwargs

parse_variance_kwargs()[source]
type = 'variance'

name for DataPlot subclass

class gwsumm.plot.builtin.SpectrogramDataPlot(*args, **kwargs)[source]

Bases: TimeSeriesDataPlot

DataPlot a Spectrogram

data = 'spectrogram'
defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'contour.algorithm': 'mpl2014', 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'format': None, 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'rasterized': True, 'ratio': None, 'savefig.transparent': True, 'svg.fonttype': 'none', 'text.parse_math': True, 'xscale': 'auto-gps', 'xtick.labelsize': 14.0, 'ylabel': 'Frequency [Hz]', 'yscale': 'log', 'ytick.labelsize': 14.0}

dict of default plotting kwargs

draw()[source]

Read in all necessary data, and generate the figure.

get_ratio(specgrams)[source]
property pid
type = 'spectrogram'

name for DataPlot subclass

class gwsumm.plot.builtin.SpectrumDataPlot(channels, start, end, state=None, outdir='.', tag=None, pid=None, href=None, new=True, all_data=False, read=True, fileformat='png', caption=None, **pargs)[source]

Bases: DataPlot

Spectrum plot for a SummaryTab

data = 'spectrum'
defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'contour.algorithm': 'mpl2014', 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'format': None, 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'no-percentiles': False, 'reference-linestyle': '--', 'savefig.transparent': True, 'svg.fonttype': 'none', 'text.parse_math': True, 'xscale': 'log', 'xtick.labelsize': 14.0, 'yscale': 'log', 'ytick.labelsize': 14.0, 'zorder': 1}

dict of default plotting kwargs

draw()[source]

Process all data and generate the output file for this SummaryPlot.

This function should be provided by all sub-classes, and should take no arguments.

parse_references(prefix='reference(\\d+)?\\Z')[source]

Parse parameters for displaying one or more reference traces

type = 'spectrum'

name for DataPlot subclass

class gwsumm.plot.builtin.TimeSeriesDataPlot(*args, **kwargs)[source]

Bases: DataLabelSvgMixin, DataPlot

DataPlot of some TimeSeries data.

add_future_shade(gps=None, facecolor='gray', alpha=0.1, **kwargs)[source]

Shade those parts of the figure that display times in the future

add_state_segments(ax, visible=None, **kwargs)[source]

Add an Axes below the given ax displaying the SummaryState for this TimeSeriesDataPlot.

Parameters:
axAxes

the set of Axes below which to display the state segments.

visiblebool, optional

whether or not to display the axes, or just make space for them, default is None, meaning a dynamic choice based on the state

**kwargs

other keyword arguments will be passed to the :meth:`~gwpy.plot.Plot.add_segments_bar` method.

data = 'timeseries'
defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'contour.algorithm': 'mpl2014', 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'savefig.transparent': True, 'svg.fonttype': 'none', 'text.parse_math': True, 'xscale': 'auto-gps', 'xtick.labelsize': 14.0, 'yscale': 'linear', 'ytick.labelsize': 14.0}

dict of default plotting kwargs

draw(outputfile=None)[source]

Read in all necessary data, and generate the figure.

init_plot(*args, **kwargs)[source]

Initialise the Figure and Axes objects for this TimeSeriesDataPlot.

type = 'timeseries'

name for DataPlot subclass

class gwsumm.plot.builtin.TimeSeriesHistogram2dDataPlot(*args, **kwargs)[source]

Bases: TimeSeriesHistogramPlot

DataPlot of the 2D histogram of two TimeSeries.

data = 'timeseries'
defaults = {'alpha': None, 'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'bins': 100, 'bottom': 1e-300, 'cmap': 'inferno_r', 'contour.algorithm': 'mpl2014', 'edgecolors': 'None', 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'grid': 'both', 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'histtype': 'stepfilled', 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'log': True, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'normed': True, 'rwidth': 1, 'savefig.transparent': True, 'shading': 'flat', 'svg.fonttype': 'none', 'text.parse_math': True, 'xtick.labelsize': 14.0, 'ylabel': 'Rate [Hz]', 'yscale': 'linear', 'ytick.labelsize': 14.0}

dict of default plotting kwargs

draw(outputfile=None)[source]

Get data and generate the figure.

parse_hist_kwargs(**defaults)[source]
parse_pcmesh_kwargs(**defaults)[source]
type = 'histogram2d'

name for DataPlot subclass

class gwsumm.plot.builtin.TimeSeriesHistogramPlot(channels, start, end, state=None, outdir='.', tag=None, pid=None, href=None, new=True, all_data=False, read=True, fileformat='png', caption=None, **pargs)[source]

Bases: DataPlot

HistogramPlot from a Series

data = 'timeseries'
defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'bottom': 1e-300, 'contour.algorithm': 'mpl2014', 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'histtype': 'stepfilled', 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'log': True, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'rwidth': 1, 'savefig.transparent': True, 'svg.fonttype': 'none', 'text.parse_math': True, 'xtick.labelsize': 14.0, 'ylabel': 'Rate [Hz]', 'ytick.labelsize': 14.0}

dict of default plotting kwargs

draw(outputfile=None)[source]

Get data and generate the figure.

init_plot(geometry=None, **kwargs)[source]

Initialise the Figure and Axes objects for this TimeSeriesDataPlot.

parse_plot_kwargs(**defaults)[source]

Pop keyword arguments for Axes.plot from the pargs for this Plot

type = 'histogram'

name for DataPlot subclass

gwsumm.plot.builtin.undo_demodulation(spec, channel, limits=None)[source]
gwsumm.plot.core module

Parse, define, and geenrate plots as requests through the configuration for GWSumm

class gwsumm.plot.core.DataPlot(channels, start, end, state=None, outdir='.', tag=None, pid=None, href=None, new=True, all_data=False, read=True, fileformat='png', caption=None, **pargs)[source]

Bases: SummaryPlot

A SummaryPlot from instrumental data.

Parameters:
channelslist

a list of channel names that define the data sources for this DataPlot

startfloat

GPS start time of this DataPlot.

endfloat

GPS end time of this DataPlot.

tagstr

a descriptive tag for this DataPlot, used as part of the output file name

outdirstr

output directory path for this DataPlot, defaults to the current directory

hrefstr

custom URL for this plot to link towards.

**kwargs

all other keyword arguments to be passed to this plot’s :meth:`process` method.

Notes

All sub-classes of this object must provide the following methods

:meth:`add_data_source`

routine for appending data sources to the plot

DRAW_PARAMS = ['weights', 'extent', 'linewidth', 'stacked', 'norm', 'cmap', 'rasterized', 'vmax', 'vmin', 'rwidth', 'color', 'normed', 'label', 'interpolation', 'zorder', 'histtype', 'aspect', 'bottom', 'log', 'linestyle', 'orientation', 'logbins', 'imshow', 'bins', 's', 'align', 'alpha', 'density', 'marker', 'origin', 'cumulative', 'range']

list of parameters parsed for plot() calls

add_channel(channel)[source]
add_hvlines()[source]

Add horizontal and vertical lines to this DataPlot

These should be defined in the configuration via the hline and vline keys.

property allchannels

List of all unique channels for this plot

apply_parameters(*axes, **pargs)[source]
property channels

List of data-source :class:`Channels <~gwpy.detector.channel.Channel>` for this DataPlot.

Type:

:class:`~gwpy.detector.channel.ChannelList`

defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'contour.algorithm': 'mpl2014', 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'savefig.transparent': True, 'svg.fonttype': 'none', 'text.parse_math': True, 'xtick.labelsize': 14.0, 'ytick.labelsize': 14.0}

dict of default plotting kwargs

draw()[source]

Process all data and generate the output file for this SummaryPlot.

This function should be provided by all sub-classes, and should take no arguments.

property end
finalize(outputfile=None, close=True, **savekwargs)[source]

Save the plot to disk and close.

classmethod from_ini(config, section, start, end, channels=None, **kwargs)[source]

Define a new DataPlot.

get_channel_groups()[source]

Find and group (mean, min, max) sets of channels for plotting.

Returns:
groupslist of tuple

list of (channelname, channellist) tuples giving core channel name and an ordered list of channels. Ordering in preference of ‘rms’, ‘mean’, ‘min’, ‘max’.

Notes

This method used to return an OrderedDict, but was changed to return a list of tuple to enable plotting a channel multiple times on a plot, for whatever reason.

property href

HTML <img> href attribute for this SummaryPlot.

property ifos

Interferometer set for this DataPlot

init_plot(data=[], FigureClass=<class 'gwpy.plot.plot.Plot'>, geometry=(1, 1), projection='rectilinear', sharex=True, sharey=True, **kwargs)[source]

Initialise the Figure and Axes objects for this DataPlot.

property logx
property logy
property outputfile

Output file for this DataPlot.

parse_legend_kwargs(**defaults)[source]

Pop the legend arguments from the pargs for this Plot

parse_list(prefix, **defaults)[source]

Parse a list of something from parameters

This enables listing `hline`s (for example) in the config as

[plot-blah] hline = 100 hline-linestyle = ‘–’ hline-color = ‘red’ hline2 = 200 hline2-linestyle = ‘–’ hline2-color = ‘blue’

Returns an OrderedDict with keys matching the primary parsed value, and values as everything else, e.g.

{100: {‘linestyle’: ‘–’, ‘color’: ‘red’},

200: {‘linestyle’: ‘–’, ‘color’: ‘blue’},}

parse_plot_kwargs(**defaults)[source]

Pop keyword arguments for Axes.plot from the pargs for this Plot

parse_rcParams(params)[source]

Parse matplotlib rcParams settings from a dict of plot params

property pid
process(outputfile=None, close=True)[source]
property span

The GPS [start, stop) interval for this DataPlot.

property start
property state

~gwsumm.state.SummaryState defining validity of this DataPlot.

property tag

File tag for this DataPlot.

type = 'data'

name for DataPlot subclass

class gwsumm.plot.core.SummaryPlot(href=None, src=None, new=True, caption='')[source]

Bases: object

An image to displayed in GWSumm HTML output.

Parameters:
hrefstr, optional

The IMG URL for this SummaryPlot.

newbool, optional

bool flag whether this is a new plot to be processed (True), of that the output already exists on disk (False).

Notes

This class is a stub, designed to make creating detailed SummaryPlot classes easier.

property caption

HTML <fancybox plot> title attribute for this SummaryPlot.

classmethod from_ini(*args, **kwargs)[source]

Define a new SummaryPlot from a an INI-format ConfigParser section.

property href

HTML <img> href attribute for this SummaryPlot.

property new

Flag whether this is a new plot or, already exists.

Set new=False to skip actually processing this SummaryPlot, and just link to the outputfile.

property src
type = None
gwsumm.plot.mixins module
class gwsumm.plot.mixins.DataLabelSvgMixin(*args, **kwargs)[source]

Bases: SvgMixin

draw_svg(outputfile)[source]
class gwsumm.plot.mixins.SegmentLabelSvgMixin(*args, **kwargs)[source]

Bases: SvgMixin

draw_svg(outputfile)[source]
class gwsumm.plot.mixins.SvgMixin(*args, **kwargs)[source]

Bases: object

abstract draw_svg(outputfile)[source]
finalize(outputfile=None, close=True, **savekwargs)[source]
finalize_svg(tree, outputfile, script=None)[source]
gwsumm.plot.noisebudget module

Extensions to the spectrum plot for noise budgets

class gwsumm.plot.noisebudget.NoiseBudgetPlot(channels, start, end, state=None, outdir='.', tag=None, pid=None, href=None, new=True, all_data=False, read=True, fileformat='png', caption=None, **pargs)[source]

Bases: SpectrumDataPlot

Plot of a noise budget ASD

data = 'spectrum'
defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'contour.algorithm': 'mpl2014', 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'format': 'asd', 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'no-percentiles': False, 'reference-linestyle': '--', 'residual-color': 'grey', 'residual-label': 'Residual', 'residual-linestyle': ':', 'savefig.transparent': True, 'sum-color': 'black', 'sum-label': 'Sum of noises', 'sum-linestyle': '--', 'svg.fonttype': 'none', 'text.parse_math': True, 'xscale': 'log', 'xtick.labelsize': 14.0, 'yscale': 'log', 'ytick.labelsize': 14.0, 'zorder': 1}

dict of default plotting kwargs

parse_residual_params(**defaults)[source]
parse_sum_params(**defaults)[source]
type = 'noise-budget'

name for DataPlot subclass

class gwsumm.plot.noisebudget.RelativeNoiseBudgetPlot(channels, start, end, state=None, outdir='.', tag=None, pid=None, href=None, new=True, all_data=False, read=True, fileformat='png', caption=None, **pargs)[source]

Bases: SpectrumDataPlot

Spectrum plot for a SummaryTab

data = 'spectrum'
defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'contour.algorithm': 'mpl2014', 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'format': 'asd', 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'no-percentiles': False, 'reference-linestyle': '--', 'savefig.transparent': True, 'svg.fonttype': 'none', 'text.parse_math': True, 'xscale': 'log', 'xtick.labelsize': 14.0, 'yscale': 'log', 'ytick.labelsize': 14.0, 'zorder': 1}

dict of default plotting kwargs

type = 'noise-budget-ratio'

name for DataPlot subclass

gwsumm.plot.range module

Definitions for range plots

class gwsumm.plot.range.GWpyTimeVolumeDataPlot(*args, **kwargs)[source]

Bases: RangePlotMixin, SimpleTimeVolumeDataPlot

TimeVolumeDataPlot where the range is calculated on-the-fly

type = 'strain-time-volume'

name for DataPlot subclass

class gwsumm.plot.range.RangeCumulativeHistogramPlot(*args, **kwargs)[source]

Bases: RangePlotMixin, TimeSeriesHistogramPlot

defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'bottom': 1e-300, 'contour.algorithm': 'mpl2014', 'cumulative': True, 'density': True, 'fftlength': 8, 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'fmin': 10, 'font.sans-serif': ['Roboto'], 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'histtype': 'stepfilled', 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'log': False, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'overlap': 4, 'range': (1, 'max'), 'rwidth': 1, 'savefig.transparent': True, 'snr': 8.0, 'stride': 60.0, 'svg.fonttype': 'none', 'text.parse_math': True, 'xlabel': 'Angle-averaged range [Mpc]', 'xtick.labelsize': 14.0, 'ylabel': 'Cumulative time duration', 'ytick.labelsize': 14.0}

dict of default plotting kwargs

type = 'range-cumulative-histogram'

name for DataPlot subclass

class gwsumm.plot.range.RangeCumulativeSpectrumDataPlot(*args, **kwargs)[source]

Bases: RangePlotMixin, SpectrumDataPlot

data = 'spectrum'
defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'contour.algorithm': 'mpl2014', 'fftlength': 8, 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'fmin': 10, 'font.sans-serif': ['Roboto'], 'format': None, 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'no-percentiles': False, 'overlap': 4, 'reference-linestyle': '--', 'savefig.transparent': True, 'snr': 8.0, 'stride': 60.0, 'svg.fonttype': 'none', 'text.parse_math': True, 'xlabel': 'Frequency [Hz]', 'xscale': 'log', 'xtick.labelsize': 14.0, 'ylabel': 'Cumulative fraction of range [%]', 'ylim': [0, 100], 'yscale': 'linear', 'ytick.labelsize': 14.0, 'ytickmarks': [0, 20, 40, 60, 80, 100], 'yticks': [0, 20, 40, 60, 80, 100], 'zorder': 1}

dict of default plotting kwargs

type = 'cumulative-range-spectrum'

name for DataPlot subclass

class gwsumm.plot.range.RangeDataHistogramPlot(*args, **kwargs)[source]

Bases: RangePlotMixin, TimeSeriesHistogramPlot

defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'bottom': 1e-300, 'contour.algorithm': 'mpl2014', 'fftlength': 8, 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'fmin': 10, 'font.sans-serif': ['Roboto'], 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'histtype': 'stepfilled', 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'log': True, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'overlap': 4, 'rwidth': 1, 'savefig.transparent': True, 'snr': 8.0, 'stride': 60.0, 'svg.fonttype': 'none', 'text.parse_math': True, 'xlabel': 'Sensitive distance [Mpc]', 'xtick.labelsize': 14.0, 'ylabel': 'Rate [Hz]', 'ytick.labelsize': 14.0}

dict of default plotting kwargs

type = 'range-histogram'

name for DataPlot subclass

class gwsumm.plot.range.RangeDataPlot(*args, **kwargs)[source]

Bases: RangePlotMixin, TimeSeriesDataPlot

defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'contour.algorithm': 'mpl2014', 'fftlength': 8, 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'fmin': 10, 'font.sans-serif': ['Roboto'], 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'overlap': 4, 'savefig.transparent': True, 'snr': 8.0, 'stride': 60.0, 'svg.fonttype': 'none', 'text.parse_math': True, 'xscale': 'auto-gps', 'xtick.labelsize': 14.0, 'ylabel': 'Sensitive distance [Mpc]', 'yscale': 'linear', 'ytick.labelsize': 14.0}

dict of default plotting kwargs

type = 'range'

name for DataPlot subclass

class gwsumm.plot.range.RangePlotMixin(*args, **kwargs)[source]

Bases: object

data = 'spectrogram'
defaults = {'fftlength': 8, 'fmin': 10, 'overlap': 4, 'snr': 8.0, 'stride': 60.0}
draw()[source]

Read in all necessary data and generate a figure

class gwsumm.plot.range.RangeSpectrogramDataPlot(*args, **kwargs)[source]

Bases: RangePlotMixin, SpectrogramDataPlot

defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'cmap': 'inferno', 'contour.algorithm': 'mpl2014', 'fftlength': 8, 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'fmin': 10, 'font.sans-serif': ['Roboto'], 'format': None, 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'norm': 'linear', 'overlap': 4, 'rasterized': True, 'ratio': None, 'savefig.transparent': True, 'snr': 8.0, 'stride': 60.0, 'svg.fonttype': 'none', 'text.parse_math': True, 'xscale': 'auto-gps', 'xtick.labelsize': 14.0, 'ylabel': 'Frequency [Hz]', 'yscale': 'log', 'ytick.labelsize': 14.0}

dict of default plotting kwargs

type = 'range-spectrogram'

name for DataPlot subclass

class gwsumm.plot.range.RangeSpectrumDataPlot(*args, **kwargs)[source]

Bases: RangePlotMixin, SpectrumDataPlot

data = 'spectrum'
defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'contour.algorithm': 'mpl2014', 'fftlength': 8, 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'fmin': 10, 'font.sans-serif': ['Roboto'], 'format': None, 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'no-percentiles': False, 'overlap': 4, 'reference-linestyle': '--', 'savefig.transparent': True, 'snr': 8.0, 'stride': 60.0, 'svg.fonttype': 'none', 'text.parse_math': True, 'xlabel': 'Frequency [Hz]', 'xscale': 'log', 'xtick.labelsize': 14.0, 'yscale': 'linear', 'ytick.labelsize': 14.0, 'zorder': 1}

dict of default plotting kwargs

type = 'range-spectrum'

name for DataPlot subclass

class gwsumm.plot.range.SimpleTimeVolumeDataPlot(sources, *args, **kwargs)[source]

Bases: SegmentDataPlot

Time-series of the time-volume searched by an interferometer

DRAW_PARAMS = ['weights', 'extent', 'linewidth', 'stacked', 'norm', 'cmap', 'rasterized', 'vmax', 'vmin', 'rwidth', 'color', 'normed', 'label', 'interpolation', 'zorder', 'histtype', 'aspect', 'bottom', 'log', 'linestyle', 'orientation', 'logbins', 'imshow', 'bins', 's', 'align', 'alpha', 'density', 'marker', 'origin', 'cumulative', 'range']

list of parameters parsed for plot() calls

static calculate_time_volume(segments, range)[source]
combined_time_volume(allsegments, allranges)[source]
data = 'timeseries'
defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'contour.algorithm': 'mpl2014', 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'savefig.transparent': True, 'svg.fonttype': 'none', 'text.parse_math': True, 'xscale': 'auto-gps', 'xtick.labelsize': 14.0, 'yscale': 'linear', 'ytick.labelsize': 14.0}

dict of default plotting kwargs

draw(outputfile=None)[source]

Generate the figure for this plot

classmethod from_ini(*args, **kwargs)[source]

Define a new DataPlot.

parse_plot_kwargs(**defaults)

Pop keyword arguments for Axes.plot from the pargs for this Plot

property pid

File pid for this DataPlot.

type = 'time-volume'

name for DataPlot subclass

gwsumm.plot.registry module

Registry for GWSumm output plot types

All plot types should be registered for easy identification from the configuration INI files

gwsumm.plot.registry.get_plot(name)[source]

Query the registry for the plot class registered to the given name

gwsumm.plot.registry.register_plot(plot, name=None, force=False)[source]

Register a new summary Plot to the given name

Parameters:
namestr

unique descriptive name for this type of plot, must not contain any spaces, e.g. ‘timeseries’

plotclasstype

defining Class for this plot type

forcebool

overwrite existing registration for this type

Raises:
ValueError

if name is already registered and force not given as True

gwsumm.plot.segments module

Definitions for the standard plots

class gwsumm.plot.segments.DutyDataPlot(flags, start, end, state=None, outdir='.', bins=None, **kwargs)[source]

Bases: SegmentDataPlot

DataPlot of the duty-factor for a SegmentList

calculate_duty_factor(segments, bins=None, cumulative=False, normalized=None)[source]
data = 'segments'
defaults = {'alpha': 0.8, 'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'contour.algorithm': 'mpl2014', 'cumulative': False, 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'normalized': None, 'savefig.transparent': True, 'sep': False, 'side_by_side': False, 'stacked': False, 'svg.fonttype': 'none', 'text.parse_math': True, 'xscale': 'auto-gps', 'xtick.labelsize': 14.0, 'ylabel': 'Duty factor [%]', 'ylim': (0, 100), 'yscale': 'linear', 'ytick.labelsize': 14.0}

dict of default plotting kwargs

draw(outputfile=None)[source]

Read in all necessary data, and generate the figure.

get_bins()[source]

Work out the correct histogram binning for this DutyDataPlot

parse_plot_kwargs(*args, **kwargs)[source]

Pop keyword arguments for Axes.plot from the pargs for this Plot

property pid

File pid for this DataPlot.

type = 'duty'

name for DataPlot subclass

class gwsumm.plot.segments.NetworkDutyBarPlot(flags, start, end, state=None, outdir='.', **kwargs)[source]

Bases: SegmentBarPlot

Special case of the SegmentPiePlot for network duty factors.

NETWORK_COLOR = {'G1': '#222222', 'H1': '#ee0000', 'I1': '#b0dd8b', 'K1': '#ffb200', 'L1': '#4ba6ff', 'V1': '#9b59b6'}
NETWORK_NAME = {0: 'no', 1: 'single', 2: 'double', 3: 'triple', 4: 'quadruple', 5: 'quintuple', 6: 'sextuple'}
defaults = {'alpha': 0.6, 'scale': 'percent', 'title': 'Network duty factor', 'ylabel': 'Duty factor [%]'}

dict of default plotting kwargs

draw()[source]

Process all data and generate the output file for this SummaryPlot.

This function should be provided by all sub-classes, and should take no arguments.

type = 'network-duty-segment-bar'

name for DataPlot subclass

class gwsumm.plot.segments.NetworkDutyPiePlot(flags, start, end, state=None, outdir='.', **kwargs)[source]

Bases: SegmentPiePlot

Special case of the SegmentPiePlot for network duty factors

NETWORK_COLOR = {'G1': '#222222', 'H1': '#ee0000', 'I1': '#b0dd8b', 'K1': '#ffb200', 'L1': '#4ba6ff', 'V1': '#9b59b6', 'double': (0.0, 0.4, 1.0), 'no': 'black', 'quadruple': (1.0, 0.4, 0.0), 'single': (1.0, 0.7, 0.0), 'triple': 'pink'}
NETWORK_NAME = {0: 'no', 1: 'single', 2: 'double', 3: 'triple', 4: 'quadruple', 5: 'quintuple', 6: 'sextuple'}
defaults = {'legend-bbox_to_anchor': (0.8, 0.5), 'legend-fontsize': 24, 'legend-frameon': False, 'legend-loc': 'center left', 'wedge-edgecolor': 'white', 'wedge-width': 0.55}

dict of default plotting kwargs

draw()[source]

Process all data and generate the output file for this SummaryPlot.

This function should be provided by all sub-classes, and should take no arguments.

type = 'network-duty-pie'

name for DataPlot subclass

class gwsumm.plot.segments.ODCDataPlot(*args, **kwargs)[source]

Bases: SegmentLabelSvgMixin, StateVectorDataPlot

Custom StateVectorDataPlot for ODCs with bitmasks

data = 'odc'
defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'color': None, 'contour.algorithm': 'mpl2014', 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'in_mask_color': (0.0, 0.4, 1.0), 'insetlabels': 'inset', 'legend-bbox_to_anchor': (1.01, 1), 'legend-borderaxespad': 0.0, 'legend-fontsize': 10, 'legend-frameon': False, 'legend-handletextpad': 0.5, 'legend-loc': 'upper left', 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'mask': None, 'masked_off_color': 'red', 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'no_summary_bit': False, 'on-is-bad': False, 'savefig.transparent': True, 'svg.fonttype': 'none', 'text.parse_math': True, 'unmasked_off_color': (1.0, 0.7, 0.0), 'xscale': 'auto-gps', 'xtick.labelsize': 14.0, 'yscale': 'linear', 'ytick.labelsize': 14.0}

dict of default plotting kwargs

draw()[source]

Read in all necessary data, and generate the figure.

get_bitmask_channels()[source]
property pid
type = 'odc'

name for DataPlot subclass

class gwsumm.plot.segments.SegmentBarPlot(flags, start, end, state=None, outdir='.', **kwargs)[source]

Bases: BarPlot, SegmentDataPlot

SCALE_UNIT = {'percent': '%', 1: 'seconds', 3600: 'hours', 60: 'minutes', None: 'seconds'}
defaults = {'alpha': 0.6, 'color': '#33cc33', 'edgecolor': 'green', 'scale': 'percent'}

dict of default plotting kwargs

draw(outputfile=None)[source]

Process all data and generate the output file for this SummaryPlot.

This function should be provided by all sub-classes, and should take no arguments.

type = 'segment-bar'

name for DataPlot subclass

class gwsumm.plot.segments.SegmentDataPlot(flags, start, end, state=None, outdir='.', **kwargs)[source]

Bases: SegmentLabelSvgMixin, TimeSeriesDataPlot

Segment plot of one or more DataQualityFlags <DataQualityFlag>.

DRAW_PARAMS = ['weights', 'extent', 'linewidth', 'stacked', 'norm', 'cmap', 'rasterized', 'vmax', 'vmin', 'rwidth', 'color', 'normed', 'label', 'interpolation', 'zorder', 'histtype', 'aspect', 'bottom', 'log', 'linestyle', 'orientation', 'logbins', 'imshow', 'bins', 's', 'align', 'alpha', 'density', 'marker', 'origin', 'cumulative', 'range', 'known', 'height', 'y', 'facecolor', 'edgecolor']

list of parameters parsed for plot() calls

add_flag(f)[source]
add_legend(ax, colors, **kwargs)[source]
property allflags
data = 'segments'
defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'color': None, 'contour.algorithm': 'mpl2014', 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'insetlabels': 'inset', 'legend-bbox_to_anchor': (1.0, 1.0), 'legend-borderaxespad': 0, 'legend-fontsize': 12, 'legend-frameon': False, 'legend-handletextpad': 0.5, 'legend-loc': 'upper left', 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'mask': None, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'on-is-bad': False, 'savefig.transparent': True, 'svg.fonttype': 'none', 'text.parse_math': True, 'xscale': 'auto-gps', 'xtick.labelsize': 14.0, 'yscale': 'linear', 'ytick.labelsize': 14.0}

dict of default plotting kwargs

draw()[source]

Read in all necessary data, and generate the figure.

property flags
classmethod from_ini(config, section, start, end, flags=None, state='all', **kwargs)[source]

Define a new DataPlot.

get_channel_groups(*args, **kwargs)[source]

Find and group (mean, min, max) sets of channels for plotting.

Returns:
groupslist of tuple

list of (channelname, channellist) tuples giving core channel name and an ordered list of channels. Ordering in preference of ‘rms’, ‘mean’, ‘min’, ‘max’.

Notes

This method used to return an OrderedDict, but was changed to return a list of tuple to enable plotting a channel multiple times on a plot, for whatever reason.

get_segment_color()[source]

Parse the configured pargs and determine the colors for active and valid segments.

property ifos

Interferometer set for this SegmentDataPlot

init_plot(projection='segments', **kwargs)[source]

Initialise the Figure and Axes objects for this TimeSeriesDataPlot.

property padding
parse_plot_kwargs(*args, **kwargs)[source]

Pop keyword arguments for Axes.plot from the pargs for this Plot

property pid

File pid for this DataPlot.

type = 'segments'

name for DataPlot subclass

class gwsumm.plot.segments.SegmentHistogramPlot(flags, start, end, state=None, outdir='.', **kwargs)[source]

Bases: TimeSeriesHistogramPlot, SegmentDataPlot

Histogram of segment duration

data = 'segments'
defaults = {'bottom': 0, 'histtype': 'stepfilled', 'log': False, 'rwidth': 1, 'ylabel': 'Number of segments'}

dict of default plotting kwargs

draw(outputfile=None)[source]

Get data and generate the figure.

parse_plot_kwargs(**defaults)

Pop keyword arguments for Axes.plot from the pargs for this Plot

type = 'segment-histogram'

name for DataPlot subclass

class gwsumm.plot.segments.SegmentPiePlot(flags, start, end, state=None, outdir='.', **kwargs)[source]

Bases: PiePlot, SegmentDataPlot

defaults = {'legend-bbox_to_anchor': (0.8, 0.5), 'legend-fontsize': 14, 'legend-frameon': False, 'legend-loc': 'center left', 'wedge-edgecolor': 'white', 'wedge-width': 0.55}

dict of default plotting kwargs

draw(outputfile=None)[source]

Process all data and generate the output file for this SummaryPlot.

This function should be provided by all sub-classes, and should take no arguments.

parse_plot_kwargs(**defaults)

Pop keyword arguments for Axes.plot from the pargs for this Plot

parse_wedge_kwargs(defaults={})[source]
type = 'segment-pie'

name for DataPlot subclass

class gwsumm.plot.segments.StateVectorDataPlot(*args, **kwargs)[source]

Bases: TimeSeriesDataPlot

DataPlot of some StateVector data.

While technically a sub-class of the TimeSeriesDataPlot, for data access and processing reasons, the output shadows that of the SegmentDataPlot more closely.

DRAW_PARAMS = ['weights', 'extent', 'linewidth', 'stacked', 'norm', 'cmap', 'rasterized', 'vmax', 'vmin', 'rwidth', 'color', 'normed', 'label', 'interpolation', 'zorder', 'histtype', 'aspect', 'bottom', 'log', 'linestyle', 'orientation', 'logbins', 'imshow', 'bins', 's', 'align', 'alpha', 'density', 'marker', 'origin', 'cumulative', 'range', 'known', 'height', 'y', 'facecolor', 'edgecolor']

list of parameters parsed for plot() calls

data = 'statevector'
defaults = {'animation.convert_args': ['-layers', 'OptimizePlus'], 'axes.axisbelow': False, 'axes.edgecolor': 'gray', 'axes.formatter.limits': [-3, 4], 'axes.formatter.use_mathtext': True, 'axes.grid': True, 'axes.labelpad': 5.0, 'axes.labelsize': 18.0, 'axes.titlesize': 22.0, 'color': None, 'contour.algorithm': 'mpl2014', 'figure.figsize': [12.0, 6.0], 'figure.labelsize': 'large', 'figure.labelweight': 'normal', 'font.sans-serif': ['Roboto'], 'grid.alpha': 0.5, 'grid.linewidth': 0.5, 'insetlabels': 'inset', 'legend-bbox_to_anchor': (1.0, 1.0), 'legend-borderaxespad': 0, 'legend-fontsize': 12, 'legend-frameon': False, 'legend-handletextpad': 0.5, 'legend-loc': 'upper left', 'legend.edgecolor': 'inherit', 'legend.fancybox': False, 'legend.fontsize': 10.0, 'legend.handlelength': 1.0, 'legend.numpoints': 2, 'mask': None, 'mathtext.bf': 'Roboto', 'mathtext.cal': 'Calligraffiti', 'mathtext.fontset': 'custom', 'mathtext.it': 'Roboto:italic', 'mathtext.rm': 'Roboto', 'mathtext.sf': 'Roboto', 'mathtext.tt': 'Roboto Slab', 'on-is-bad': False, 'savefig.transparent': True, 'svg.fonttype': 'none', 'text.parse_math': True, 'xscale': 'auto-gps', 'xtick.labelsize': 14.0, 'yscale': 'linear', 'ytick.labelsize': 14.0}

dict of default plotting kwargs

draw()[source]

Read in all necessary data, and generate the figure.

property flag

List of flags generated for this StateVectorDataPlot.

get_segment_color()

Parse the configured pargs and determine the colors for active and valid segments.

init_plot(*args, **kwargs)[source]

Initialise the Figure and Axes objects for this TimeSeriesDataPlot.

parse_plot_kwargs(*args, **kwargs)[source]

Pop keyword arguments for Axes.plot from the pargs for this Plot

property pid
type = 'statevector'

name for DataPlot subclass

gwsumm.plot.segments.common_limits(datasets, default_min=0, default_max=0)[source]

Find the global maxima and minima of a list of datasets.

Parameters:
datasetsiterable

list (or any other iterable) of data arrays to analyse.

default_minfloat, optional

fall-back minimum value if datasets are all empty.

default_maxfloat, optional

fall-back maximum value if datasets are all empty.

Returns:
(min, max)float

2-tuple of common minimum and maximum over all datasets.

gwsumm.plot.segments.tint_hex(*args, **kwargs)[source]
gwsumm.plot.sei module

SummaryTab for seismic watchdog monitoring

class gwsumm.plot.sei.SeiWatchDogPlot(gpstime, chamber, sensor, config, outfile, ifo=None, duration=30, nds=False, datacache=None)[source]

Bases: DataPlot

Plot a specific SEI WatchDog trip

data = 'watchdog'
draw()[source]

Process all data and generate the output file for this SummaryPlot.

This function should be provided by all sub-classes, and should take no arguments.

property outputfile

Output file for this DataPlot.

type = 'watchdog'

name for DataPlot subclass

gwsumm.plot.utils module

Utilies for GWSumm plotting

gwsumm.plot.utils.get_column_label(column)[source]
gwsumm.plot.utils.get_column_string(column)[source]

Format the string columnName (e.g. xml table column) into latex format for an axis label.

Parameters:
columnstr

string to format

Examples

>>> get_column_string('snr')
'SNR'
>>> get_column_string('bank_chisq_dof')
r'Bank $\chi^2$ DOF'
gwsumm.plot.utils.hash(string, num=6)[source]

Generate an N-character hash string based using string to initialise

Parameters:
stringstr

the initialisation string

numint, optional

the length of the hash to produce

Returns:
hashstr

the new hash

Examples

>>> from gwsumm.plot.utils import hash
>>> print(hash("I love gravitational waves"))
80c897
Module contents

A Plot is a representation of an image to be included in the HTML output a tab.

For simple purposes, a Plot is just a reference to an existing image file that can be imported into an HTML page via the <img> tag.

For more complicated purposes, a number of data plot classes are provided to allow users to generate images on-the-fly. The available classes are:

TimeSeriesDataPlot(*args, **kwargs)

DataPlot of some TimeSeries data.

SpectrogramDataPlot(*args, **kwargs)

DataPlot a Spectrogram

SegmentDataPlot(flags, start, end[, state, ...])

Segment plot of one or more DataQualityFlags <DataQualityFlag>.

StateVectorDataPlot(*args, **kwargs)

DataPlot of some StateVector data.

SpectrumDataPlot(channels, start, end[, ...])

Spectrum plot for a SummaryTab

TimeSeriesHistogramPlot(channels, start, end)

HistogramPlot from a Series

TriggerTimeSeriesDataPlot(*args, **kwargs)

Custom time-series plot to handle discontiguous TimeSeries.

TriggerHistogramPlot(*args, **kwargs)

HistogramPlot from a LIGO_LW Table

TriggerRateDataPlot(*args, **kwargs)

TimeSeriesDataPlot of trigger rate.

gwsumm.state package
Submodules
gwsumm.state.all module

Definition of the ‘All’ state.

This is a special SummaryState that has valid and active segments spanning the full analysis interval.

gwsumm.state.all.generate_all_state(start, end, register=True, **kwargs)[source]

Build a new SummaryState for the given [start, end) interval.

Parameters:
start~gwpy.time.LIGOTimeGPS, float

the GPS start time of the current analysis

end~gwpy.time.LIGOTimeGPS, float

the GPS end time of the current analysis

registerbool, optional

should the new SummaryState be registered, default True

**kwargs

other keyword arguments passed to the SummaryState constructor

Returns:
allstateSummaryState

the newly created ‘All’ SummaryState

gwsumm.state.core module

Definition of the SummaryState class.

class gwsumm.state.core.SummaryState(name, known=[], active=[], description=None, definition=None, hours=None, key=None, filename=None, url=None)[source]

Bases: DataQualityFlag

An operating state over which to process a ~gwsumm.tabs.DataTab.

Parameters:
namestr

name for this state

known~gwpy.segments.SegmentList, optional

list of known segments

active~gwpy.segments.SegmentList, optional

list of active segments

descriptionstr, optional

text describing what this state means

definitionstr, optional

logical combination of flags that define known and active segments for this state (see :attr:`documentation <SummaryState.definition>` for details)

keystr, optional

registry key for this state, defaults to :attr:`~SummaryState.name`

MATH_DEFINITION = re.compile('(<|<=|=|>=|>|==|!=)')
copy()[source]

Build an exact copy of this flag.

Returns:
flag2DataQualityFlag

a copy of the original flag, but with a fresh memory address.

property definition

The combination of data-quality flags that define this SummaryState

For example:

>>> state = SummaryState(definition='L1:DMT-SCIENCE:1')

would define a SummaryState based on the validity and activity of the single flag 'L1:DMT-SCIENCE:1' (the science-mode flag for the LIGO Livingston Observatory interferometer). Similarly:

>>> state = SummaryState(
        definition='L1:DMT-SCIENCE:1&!L1:DMT-LIGHTDIP_10_PERCENT:1')

would define a SummaryState as active when the 'L1:DMT-SCIENCE:1' flag was active and the 'L1:DMT-LIGHTDIP_10_PERCENT:1' flag was not active.

The following logical identifiers are acceptable:

&

Union (i.e. flag1 and flag2 must be active)

|

Intersection (i.e. flag1 or flag2 must be active)

&!

One-sided difference (i.e. flag1 is active and flag2 is notactive)

!=

Two-sided difference (i.e. flag1 is active and flag2 is not ORflag2 is active and flag2 is not)

Type:

str

property end

GPS end time of this state’s validity

fetch(config=<GWSummConfigParser()>, segmentcache=None, segdb_error='raise', datacache=None, datafind_error='raise', nproc=1, nds=None, **kwargs)[source]

Finalise this state by fetching its defining segments, either from global memory, or from the segment database

classmethod from_ini(config, section)[source]

Create a new SummaryState from a section in a ConfigParser.

Parameters:
config:class:`~gwsumm.config.GWConfigParser`

customised configuration parser containing given section

sectionstr

name of section to parse

Returns:
SummaryState

a new state, with attributes set from the options in the configuration

property key

The registry key for this SummaryState.

Type:

str

property name

Name of this state

property start

GPS start time of this state’s validity.

property tag

File tag for images generated using this state

gwsumm.state.registry module

Registry for states <SummaryState>.

gwsumm.state.registry.get_state(key)[source]

Query the registry for the SummaryState registered to the given key

Parameters:
keystr

registered key of desired SummaryState. This may not match the ~SummaryState.name attribute` if the state was registered with a different key.

Returns:
stateSummaryState

the SummaryState registered with the given key

Raises:
ValueError:

if the key doesn’t map to a registered SummaryState

gwsumm.state.registry.get_states(keys={})[source]

Query the registry for a list of states (defaults to all)

Parameters:
keysset of str

the set of state keys to query in the registry

Returns:
statesdict

a dict of (key, SummaryState) pairs

Raises:
ValueError:

if any of the keys doesn’t map to a registered SummaryState

gwsumm.state.registry.register_state(state, key=None, force=False)[source]

Register a new SummaryState to the given key

Parameters:
stateSummaryState

defining Class for this state type.

keystr, optional

unique descriptive name for the SummaryState to be registered. If key=None, the :attr:`~SummaryState.key` attribute of the given state will be used.

forcebool

overwrite existing registration for this key

Raises:
ValueError

if key is already registered and force not given as True

Module contents

A SummaryState defines a sub-set of time over which a ~gwsumm.tabs.Tab should be processed. Each SummaryState is normally tied to one or more data-quality flags marking times during which each of the LIGO instruments was operating in a certain configuration, or was subject to a known noise interference.

The state registry

GWSumm defines a state ‘registry’, simply a record of all SummaryState objects that have been defined (and registered) so far in a given program. The registry just makes remembering states in complicated programs a little easier.

Any SummaryState can be registered with an arbitrary name as follows:

>>> from gwsumm.state.registry import register_state
>>> register_state(mystate, 'my state')

and can be recovered later:

>>> from gwsumm.state.registry import get_state
>>> mystate = get_state('my state')
API reference

SummaryState(name[, known, active, ...])

An operating state over which to process a ~gwsumm.tabs.DataTab.

get_state(key)

Query the registry for the SummaryState registered to the given key

get_states([keys])

Query the registry for a list of states (defaults to all)

register_state(state[, key, force])

Register a new SummaryState to the given key

class gwsumm.state.SummaryState(name, known=[], active=[], description=None, definition=None, hours=None, key=None, filename=None, url=None)[source]

Bases: DataQualityFlag

An operating state over which to process a ~gwsumm.tabs.DataTab.

Parameters:
namestr

name for this state

known~gwpy.segments.SegmentList, optional

list of known segments

active~gwpy.segments.SegmentList, optional

list of active segments

descriptionstr, optional

text describing what this state means

definitionstr, optional

logical combination of flags that define known and active segments for this state (see :attr:`documentation <SummaryState.definition>` for details)

keystr, optional

registry key for this state, defaults to :attr:`~SummaryState.name`

MATH_DEFINITION = re.compile('(<|<=|=|>=|>|==|!=)')
copy()[source]

Build an exact copy of this flag.

Returns:
flag2DataQualityFlag

a copy of the original flag, but with a fresh memory address.

property definition

The combination of data-quality flags that define this SummaryState

For example:

>>> state = SummaryState(definition='L1:DMT-SCIENCE:1')

would define a SummaryState based on the validity and activity of the single flag 'L1:DMT-SCIENCE:1' (the science-mode flag for the LIGO Livingston Observatory interferometer). Similarly:

>>> state = SummaryState(
        definition='L1:DMT-SCIENCE:1&!L1:DMT-LIGHTDIP_10_PERCENT:1')

would define a SummaryState as active when the 'L1:DMT-SCIENCE:1' flag was active and the 'L1:DMT-LIGHTDIP_10_PERCENT:1' flag was not active.

The following logical identifiers are acceptable:

&

Union (i.e. flag1 and flag2 must be active)

|

Intersection (i.e. flag1 or flag2 must be active)

&!

One-sided difference (i.e. flag1 is active and flag2 is notactive)

!=

Two-sided difference (i.e. flag1 is active and flag2 is not ORflag2 is active and flag2 is not)

Type:

str

property end

GPS end time of this state’s validity

fetch(config=<GWSummConfigParser()>, segmentcache=None, segdb_error='raise', datacache=None, datafind_error='raise', nproc=1, nds=None, **kwargs)[source]

Finalise this state by fetching its defining segments, either from global memory, or from the segment database

classmethod from_ini(config, section)[source]

Create a new SummaryState from a section in a ConfigParser.

Parameters:
config:class:`~gwsumm.config.GWConfigParser`

customised configuration parser containing given section

sectionstr

name of section to parse

Returns:
SummaryState

a new state, with attributes set from the options in the configuration

property key

The registry key for this SummaryState.

Type:

str

property name

Name of this state

property start

GPS start time of this state’s validity.

property tag

File tag for images generated using this state

gwsumm.state.generate_all_state(start, end, register=True, **kwargs)[source]

Build a new SummaryState for the given [start, end) interval.

Parameters:
start~gwpy.time.LIGOTimeGPS, float

the GPS start time of the current analysis

end~gwpy.time.LIGOTimeGPS, float

the GPS end time of the current analysis

registerbool, optional

should the new SummaryState be registered, default True

**kwargs

other keyword arguments passed to the SummaryState constructor

Returns:
allstateSummaryState

the newly created ‘All’ SummaryState

gwsumm.state.get_state(key)[source]

Query the registry for the SummaryState registered to the given key

Parameters:
keystr

registered key of desired SummaryState. This may not match the ~SummaryState.name attribute` if the state was registered with a different key.

Returns:
stateSummaryState

the SummaryState registered with the given key

Raises:
ValueError:

if the key doesn’t map to a registered SummaryState

gwsumm.state.get_states(keys={})[source]

Query the registry for a list of states (defaults to all)

Parameters:
keysset of str

the set of state keys to query in the registry

Returns:
statesdict

a dict of (key, SummaryState) pairs

Raises:
ValueError:

if any of the keys doesn’t map to a registered SummaryState

gwsumm.state.register_state(state, key=None, force=False)[source]

Register a new SummaryState to the given key

Parameters:
stateSummaryState

defining Class for this state type.

keystr, optional

unique descriptive name for the SummaryState to be registered. If key=None, the :attr:`~SummaryState.key` attribute of the given state will be used.

forcebool

overwrite existing registration for this key

Raises:
ValueError

if key is already registered and force not given as True

gwsumm.tabs package
Submodules
gwsumm.tabs.builtin module

This module defines a number of Tab subclasses.

The builtin classes provide interfaces for simple operations including

  • ExternalTab: embedding an existing webpage

  • PlotTab: scaffolding a collection of existing images

  • StateTab: scaffolding plots split into a number of states, with a button to switch between states in the HTML

class gwsumm.tabs.builtin.ExternalTab(*args, **kwargs)[source]

Bases: Tab

A simple tab to link HTML from an external source

Parameters:
namestr

name of this tab (required)

urlstr

URL of the external content to be linked into this tab.

indexstr

HTML file in which to write. By default each tab is written to an index.html file in its own directory. Use :attr:`~Tab.index` to find out the default index, if not given.

shortnamestr

shorter name for this tab to use in the navigation bar. By default the regular name is used

parent:class:`~gwsumm.tabs.Tab`

parent of this tab. This is used to position this tab in the navigation bar.

childrenlist

list of child :class:`Tabs <~gwsumm.tabs.Tab>` of this one. This is used to position this tab in the navigation bar.

groupstr

name of containing group for this tab in the navigation bar dropdown menu. This is only relevant if this tab has a parent.

pathstr

base output directory for this tab (should be the same directory for all tabs in this run).

classmethod from_ini(cp, section, *args, **kwargs)[source]

Configure a new ExternalTab from a ConfigParser section

Parameters:
cp:class:`~gwsumm.config.ConfigParser`

configuration to parse.

sectionstr

name of section to read

See also

:obj:`Tab.from_ini`

for documentation of the standard configuration options

Notes

On top of the standard configuration options, the ExternalTab can be configured with the url option, specifying the URL of the external content to be included:

[tab-external]
name = External data
type = external
url = https://www.example.org/index.html
html_content(content)[source]

Build the #main div for this tab.

Parameters:
contentstr, ~MarkupPy.markup.page

HTML content to be wrapped

Returns:
#main~MarkupPy.markup.page

A new page with the input content wrapped as

type = 'external'
property url
write_html(**kwargs)[source]

Write the HTML page for this tab.

See also

:obj:`gwsumm.tabs.Tab.write_html`

for details of all valid keyword

:obj:`arguments`
class gwsumm.tabs.builtin.PlotTab(*args, **kwargs)[source]

Bases: Tab

A simple tab to layout some figures in the #main div.

Parameters:
namestr

name of this tab (required)

plotslist, optional

list of plots to display on this tab. More plots can be added at any time via :meth:`PlotTab.add_plot`

layoutint, list, optional

the number of plots to display in each row, or a list of numbers to define each row individually. If the number of plots defined by the layout is less than the total number of plots, the layout for the final row will be repeated as necessary.

For example layout=[1, 2, 3] will display a single plot on the top row, two plots on the second, and 3 plots on each row thereafter.

foreword~MarkupPy.markup.page, str, optional

content to include in the #main HTML before the plots

afterword~MarkupPy.markup.page, str, optional

content to include in the #main HTML after the plots

indexstr, optional

HTML file in which to write. By default each tab is written to an index.html file in its own directory. Use :attr:`~Tab.index` to find out the default index, if not given.

shortnamestr, optional

shorter name for this tab to use in the navigation bar. By default the regular name is used

parent:class:`~gwsumm.tabs.Tab`, optional

parent of this tab. This is used to position this tab in the navigation bar.

childrenlist, optional

list of child :class:`Tabs <~gwsumm.tabs.Tab>` of this one. This is used to position this tab in the navigation bar.

groupstr, optional

name of containing group for this tab in the navigation bar dropdown menu. This is only relevant if this tab has a parent.

pathstr, optional,

base output directory for this tab (should be the same directory for all tabs in this run).

add_plot(plot)[source]

Add a plot to this tab.

Parameters:
plotstr, :class:`~gwsumm.plot.SummaryPlot`

either the URL of a plot to embed, or a formatted SummaryPlot object.

property afterword

HTML content to be included after the plots

property foreword

HTML content to be included before the plots

classmethod from_ini(cp, section, *args, **kwargs)[source]

Define a new tab from a :class:`~gwsumm.config.GWConfigParser`

Parameters:
cp:class:`~ConfigParser.GWConfigParser`

customised configuration parser containing given section

sectionstr

name of section to parse

Returns:
tabPlotTab

a new tab defined from the configuration

html_content(content)[source]

Build the #main div for this tab.

Parameters:
contentstr, ~MarkupPy.markup.page

HTML content to be wrapped

Returns:
#main~MarkupPy.markup.page

A new page with the input content wrapped as

property layout

List of how many plots to display on each row in the output.

By default this is 1 if the tab contains only 1 or 3 plots, or 2 if otherwise. The final number given in the list will be repeated as necessary.

Type:

list of ints <int>

scaffold_plots(plots=None, state=None, layout=None, aclass='fancybox', **fbkw)[source]

Build a grid of plots using bootstrap’s scaffolding.

Returns:
page:class:`~MarkupPy.markup.page`

formatted markup with grid of plots

set_layout(layout)[source]

Set the plot scaffolding layout for this tab

Parameters:
lint, list of int

the desired scaffold layout, one of

  • an int, indicating the number of plots on every row, or

  • a list, indicating the number of plots on each row, with the final int repeated for any remaining rows; each entry should be an int or a pair of int indicating the number of plots on this row AND the desired the scaling of this row, see the examples…

Examples

To layout 2 plots on each row

>>> tab.set_layout(2)

or

>>> tab.set_layout([2])

To layout 2 plots on the first row, and 3 on all other rows

>>> tab.set_layout((2, 3))

To layout 2 plots on the first row, and 1 on the second row BUT have it the same size as plots on a 2-plot row

>>> tab.set_layout((2, (1, 2))
type = 'plots'
write_html(foreword=None, afterword=None, **kwargs)[source]

Write the HTML page for this tab.

Parameters:
forewordstr, :class:`~MarkupPy.markup.page`, optional

content to place above the plot grid, defaults to :attr:`PlotTab.foreword`

afterwordstr, :class:`~MarkupPy.markup.page`, optional

content to place below the plot grid, defaults to :attr:`PlotTab.afterword`

**kwargs

other keyword arguments to be passed through :meth:`~Tab.write_html`

See also

:obj:`gwsumm.tabs.Tab.write_html`

for details of all valid unnamed keyword arguments

class gwsumm.tabs.builtin.StateTab(*args, **kwargs)[source]

Bases: PlotTab

Tab with multiple content pages defined via ‘states’

Each state is printed to its own HTML file which is loaded via javascript upon request into the #main div of the index for the tab.

Parameters:
namestr

name of this tab (required)

stateslist

a list of states for this tab. Each state can take any form, but must be castable to a str in order to be printed.

plotslist

list of plots to display on this tab. More plots can be added at any time via :meth:`PlotTab.add_plot`

layoutint, list

the number of plots to display in each row, or a list of numbers to define each row individually. If the number of plots defined by the layout is less than the total number of plots, the layout for the final row will be repeated as necessary.

For example layout=[1, 2, 3] will display a single plot on the top row, two plots on the second, and 3 plots on each row thereafter.

indexstr

HTML file in which to write. By default each tab is written to an index.html file in its own directory. Use :attr:`~Tab.index` to find out the default index, if not given.

shortnamestr

shorter name for this tab to use in the navigation bar. By default the regular name is used

parent:class:`~gwsumm.tabs.Tab`

parent of this tab. This is used to position this tab in the navigation bar.

childrenlist

list of child :class:`Tabs <~gwsumm.tabs.Tab>` of this one. This is used to position this tab in the navigation bar.

groupstr

name of containing group for this tab in the navigation bar dropdown menu. This is only relevant if this tab has a parent.

pathstr

base output directory for this tab (should be the same directory for all tabs in this run).

add_state(state, default=False)[source]

Add a SummaryState to this tab

Parameters:
statestr, :class:`~gwsumm.state.SummaryState`

either the name of a state, or a SummaryState.

registerbool, default: False

automatically register all new states

property defaultstate
property frames
classmethod from_ini(cp, section, *args, **kwargs)[source]

Define a new tab from a :class:`~gwsumm.config.GWConfigParser`

Parameters:
cp:class:`~ConfigParser.GWConfigParser`

customised configuration parser containing given section

sectionstr

name of section to parse

Returns:
tabPlotTab

a new tab defined from the configuration

static html_content(frame)[source]

Build the #main div for this tab.

In this construction, the <div id=”id_”> is empty, with a javascript hook to load the given frame into the div when ready.

html_navbar(help_=None, **kwargs)[source]

Build the navigation bar for this Tab.

The navigation bar will consist of a switch for this page linked to other interferometer servers, followed by the navbar brand, then the full dropdown-based navigation menus configured for the given tabs and their descendents.

Parameters:
help_str, :class:`~MarkupPy.markup.page`

content for upper-right of navbar

ifostr, optional

prefix for this IFO.

ifomapdict, optional

dict of (ifo, {base url}) pairs to map to summary pages for other IFOs.

tabslist, optional

list of parent tabs (each with a list of children) to include in the navigation bar.

Returns:
page~MarkupPy.markup.page

a markup page containing the navigation bar.

property states

The set of :class:`states <gwsumm.state.SummaryState>` over whos times this tab’s data will be processed.

The set of states will be linked in the given order with a switch on the far-right of the HTML navigation bar.

type = 'state'
write_html(title=None, subtitle=None, tabs=[], ifo=None, ifomap={}, help_=None, css={'font-awesome': 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/fontawesome.min.css', 'font-awesome-solid': 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/solid.min.css', 'gwbootstrap': 'https://cdn.jsdelivr.net/npm/gwbootstrap@1.3.6/lib/gwbootstrap.min.css'}, js={'bootstrap': 'https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js', 'datepicker': 'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.min.js', 'fancybox': 'https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/fancybox/fancybox.umd.js', 'gwbootstrap': 'https://cdn.jsdelivr.net/npm/gwbootstrap@1.3.6/lib/gwbootstrap-extra.min.js', 'jquery': 'https://code.jquery.com/jquery-3.7.1.min.js', 'jquery-ui': 'https://code.jquery.com/ui/1.13.2/jquery-ui.min.js', 'moment': 'https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.30.1/moment.min.js'}, about=None, footer=None, **inargs)[source]

Write the HTML page for this state Tab.

Parameters:
maincontentstr, :class:`~MarkupPy.markup.page`

simple string content, or a structured page of markup to embed as the content of the #main div.

titlestr, optional, default: {parent.name}

level 1 heading for this Tab.

subtitlestr, optional, default: {self.name}

level 2 heading for this Tab.

tabs: `list`, optional

list of top-level tabs (with children) to populate navbar

ifostr, optional

prefix for this IFO.

ifomapdict, optional

dict of (ifo, {base url}) pairs to map to summary pages for other IFOs.

help_str, :class:`~MarkupPy.markup.page`, optional

non-menu content for navigation bar, defaults to calendar

csslist, optional

list of resolvable URLs for CSS files. See gwsumm.html.static.CSS for the default list.

jslist, optional

list of resolvable URLs for javascript files. See gwumm.html.JS for the default list.

aboutstr, optional

href for the ‘About’ page

footerstr, ~MarkupPy.markup.page

user-defined content for the footer (placed below everything else)

**inargs

other keyword arguments to pass to the :meth:`~Tab.build_inner_html` method

write_state_html(state, pre=None, post=None, plots=True)[source]

Write the frame HTML for the specific state of this tab

Parameters:
state~gwsumm.state.SummaryState

SummaryState over which to generate inner HTML

gwsumm.tabs.core module

This module defines the core Tab object.

The basic Tab allows for simple embedding of arbitrary text inside a standardised HTML interface. Most real-world applications will use a sub-class of Tab to create more complex HTML output.

The Tab class comes in three flavours:

  • ‘static’, no specific GPS time reference

  • ‘interval’, displaying data in a given GPS [start, stop) interval

  • ‘event’, displaying data around a specific central GPS time

The flavour is dynamically set when each instance is created based on the mode keyword, or the presence of span, start and `end, or gpstime keyword arguments.

class gwsumm.tabs.core.BaseTab(name, index=None, shortname=None, parent=None, children=[], group=None, notes=None, overlay=None, path='.', mode=None, hidden=False)[source]

Bases: object

The core Tab object, defining basic functionality

add_child(tab)[source]

Add a child to this SummaryTab

Parameters:
tabSummaryTab

child tab to record

property children

List of child tabs for this Tab

If this tab is given children, it cannot also have a parent, as it will define its own dropdown menu in the HTML navigation bar, linking to itself and its children.

Type:

list of tabs <Tab>

classmethod from_ini(cp, section, *args, **kwargs)[source]

Define a new tab from a ~gwsumm.config.GWConfigParser

Parameters:
cp~gwsumm.config.GWConfigParser

customised configuration parser containing given section

sectionstr

name of section to parse

*args, **kwargs

other positional and keyword arguments to pass to the class constructor (__init__)

Returns:
tabTab

a new tab defined from the configuration

Notes

This method parses the following configuration options

name

Full name for this Tab

shortname

Short name for this tab

parent

Short name of the parent page for this Tab

group

Dropdown group for this Tab in the navigation bar

notes

Release notes for this Tab

overlay

Boolean switch to enable plot overlay for this Tab

index

The HTML path (relative to the ~Tab.path) for this tab

Sub-classes should parse their own configuration values and then pass these as *args and **kwargs to this method via super:

class MyTab(Tab):
    [...]
    def from_ini(cls, cp, section)
        """Define a new `MyTab`.
        """
        foo = cp.get(section, 'foo')
        bar = cp.get(section, 'bar')
        return super(MyTab, cls).from_ini(cp, section, foo, bar=bar)
get_child(name)[source]

Find a child tab of this SummaryTab by name

Parameters:
namestr

string identifier of child tab to use in search

Returns:
childSummaryTab

the child tab found by name

Raises:
RuntimeError

if no child tab can be found matching the given name

property group

Dropdown group for this Tab in the navigation bar

Type:

str

property href

HTML href (relative to the ~Tab.path) for this tab

This attribute is just a convenience to clean-up the ~Tab.index for a given tab, by removing index.htmls. hierarchy.

Type:

str

html_banner(title=None, subtitle=None)[source]

Build the HTML headline banner for this tab.

Parameters:
titlestr

title for this page

subtitlestr

sub-title for this page

Returns:
banner~MarkupPy.markup.page

formatter markup page for the banner

static html_content(content)[source]

Build the #main div for this tab.

Parameters:
contentstr, ~MarkupPy.markup.page

HTML content to be wrapped

Returns:
#main~MarkupPy.markup.page

A new page with the input content wrapped as

html_navbar(help_=None, calendar=[], tabs=[], ifo=None, ifomap={}, **kwargs)[source]

Build the navigation bar for this tab.

Parameters:
help_str, ~MarkupPy.markup.page

content to place on the upper-right side of the navbar

calendarlist, optional

datepicker calendar objects for navigation

tabslist, optional

list of parent tabs (each with a list of children) to include in the navigation bar.

ifostr, optional

prefix for this IFO.

ifomapdict, optional

dict of (ifo, {base url}) pairs to map to summary pages for other IFOs.

**kwargs

other keyword arguments to pass to :meth:`gwsumm.html.navbar`

Returns:
page~MarkupPy.markup.page

a markup page containing the navigation bar.

property index

The HTML path (relative to the ~Tab.path) for this tab

property mode

The date-time mode of this tab.

Type:

int

See also

:obj:`gwsumm.mode`

for details on the modes

property name

Full name for this Tab

Type:

str

property notes

Release notes for this Tab

property overlay

Boolean switch to enable plot overlay for this Tab

property parent

Short name of the parent page for this Tab

A given tab can either be a parent for a set of child tabs, or can have a parent, it cannot be both. In this system, the parent attribute defines the heading under which this tab will be linked in the HTML navigation bar.

Type:

str

set_parent(p)[source]

Set the parent Tab for this tab

Parameters:
pTab

the parent tab for this one

property shortname

Short name for this tab

This will be displayed in the navigation bar.

Type:

str

property shorttitle

Page title for this tab

property title

Page title for this tab

write_html(maincontent, title=None, subtitle=None, tabs=[], ifo=None, ifomap={}, help_=None, base=None, css=None, js=None, about=None, footer=None, issues=True, **inargs)[source]

Write the HTML page for this Tab.

Parameters:
maincontentstr, ~MarkupPy.markup.page

simple string content, or a structured page of markup to embed as the content of the #main div.

titlestr, optional, default: {parent.name}

level 1 heading for this Tab.

subtitlestr, optional, default: {self.name}

level 2 heading for this Tab.

tabs: `list`, optional

list of top-level tabs (with children) to populate navbar

ifostr, optional

prefix for this IFO.

ifomapdict, optional

dict of (ifo, {base url}) pairs to map to summary pages for other IFOs.

help_str, ~MarkupPy.markup.page, optional

non-menu content for navigation bar

csslist, optional

list of resolvable URLs for CSS files. See gwsumm.html.CSS for the default list.

jslist, optional

list of resolvable URLs for javascript files. See gwumm.html.JS for the default list.

aboutstr, optional

href for the ‘About’ page

footerstr, ~MarkupPy.markup.page

external link, if applicable (linked from an icon in the footer)

issuesbool or str, default: True

print link to github.com issue tracker for this package

**inargs

other keyword arguments to pass to the :meth:`~Tab.build_inner_html` method

class gwsumm.tabs.core.Tab(*args, **kwargs)[source]

Bases: BaseTab

A Simple HTML tab.

This class provides a mechanism to generate a full-formatted HTML page including banner, navigation-bar, content, and a footer, without the user worrying too much about the details.

For example:

>>> # import Tab and make a new one with a given title and HTML file
>>> from gwsumm.tabs import Tab
>>> tab = Tab('My new tab', 'mytab.html')
>>> # write the Tab to disk with some simple content
>>> tab.write_html('This is my content', brand='Brand name')
Parameters:
namestr

name of this tab (required)

indexstr

HTML file in which to write. By default each tab is written to an index.html file in its own directory. Use ~Tab.index to find out the default index, if not given.

shortnamestr

shorter name for this tab to use in the navigation bar. By default the regular name is used

parent~gwsumm.tabs.Tab

parent of this tab. This is used to position this tab in the navigation bar.

childrenlist

list of child Tabs <~gwsumm.tabs.Tab> of this one. This is used to position this tab in the navigation bar.

groupstr

name of containing group for this tab in the navigation bar dropdown menu. This is only relevant if this tab has a parent.

pathstr

base output directory for this tab (should be the same directory for all tabs in this run)

Notes

A Tab cannot have both a ~Tab.parent and ~tab.Children. This is a limitation imposed by the twitter bootstrap navigation bar implementation, which does not allow nested dropdown menus. In order to collect child tabs in a given place, assign them all the same ~Tab.group.

type = 'basic'
class gwsumm.tabs.core.TabList(entries=[])[source]

Bases: list

Custom list of Tab objects with sorting and parsing

classmethod from_ini(config, tag='tab[_-]', match=[], path='.', plotdir='plots')[source]
get_hierarchy()[source]
sort(key=None, reverse=False)[source]

Sort this TabList in place

gwsumm.tabs.data module

This module defines tabs for generating plots from data on-the-fly.

This module also provides the ProcessedTab mixin, which should be used to declare that a tab has a process() method that should be executed as part of a workflow, see the gw_summary executable as an example.

class gwsumm.tabs.data.DataTab(*args, **kwargs)[source]

Bases: ProcessedTab, StateTab

A tab where plots and data summaries are built upon request

This is the ‘default’ tab for the command-line gw_summary executable.

All *args and **kwargs are passed up-stream to the base class constructor, excepting the following:

Parameters:
namestr

name of this tab (required)

startLIGOTimeGPS, str

start time of this DataTab, anything that can be parsed by ~gwpy.time.to_gps is fine

endLIGOTimeGPS, str

end time of this DataTab, format as for start

stateslist of states <gwsumm.state.SummaryState>

the list of states (~gwsumm.state.SummaryState) over which this DataTab should be processed. More states can be added later (but before running :meth:`~DataTab.process`) via :meth:`~DataTab.add_state`.

ismetabool, optional, default: False

indicates that this tab only contains data already by others and so doesn’t need to be processed.

noplotsbool, optional, default: False

indicates that this tab only exists to trigger data access, and shouldn’t actually generate any figures

**kwargs

other keyword arguments

See also

:obj:`gwsumm.tabs.StateTab`

for details on the other keyword arguments (**kwargs) accepted by the constructor for the DataTab.

finalize_states(config=<configparser.ConfigParser object>, segdb_error='raise', **kwargs)[source]

Fetch the segments for each state for this SummaryTab

classmethod from_ini(cp, section, plotdir='plots', **kwargs)[source]

Define a new SummaryTab from the given section of the ConfigParser.

Parameters:
cp:class:`~gwsumm.config.GWConfigParser`

customised configuration parser containing given section

sectionstr

name of section to parse

plotdirstr, optional, default: 'plots'

output path for plots, relative to current directory

Returns:
tabDataTab

a new DataTab defined from the configuration

get_channels(*types, **kwargs)[source]

Return the set of data channels required for plots of the given types.

Parameters:
*typeslist of str

list of plot data type strings whose channel sets to return

newbool, default: True

only include plots whose ‘new’ attribute is True

Returns:
channelslist

an alphabetically-sorted list of channels

get_flags(*types, **kwargs)[source]

Return the set of data-quality flags required for plots of the given types.

Parameters:
*typeslist of str

list of plot type strings whose flag sets to return

Returns:
flagslist

an alphabetically-sorted list of flags

get_triggers(*types, **kwargs)[source]

Return the set of data-quality flags required for plots of the given types.

Parameters:
*typeslist of str

list of plot type strings whose flag sets to return

Returns:
flagslist

an alphabetically-sorted list of flags

html_content(frame)[source]

Build the #main div for this tab.

In this construction, the <div id=”id_”> is empty, with a javascript hook to load the given frame into the div when ready.

static print_segments(flag, table=False, caption=None)[source]

Print the contents of a SegmentList in HTML

process(config=<configparser.ConfigParser object>, nproc=1, **stateargs)[source]

Process data for this tab

Parameters:
configConfigParser.ConfigParser, optional

job configuration to pass to \(~DataTab.finalize_states\)

**stateargs

all other keyword arguments are passed directly onto the :meth:`~DataTab.process_state` method.

process_state(state, nds=None, nproc=1, config=<GWSummConfigParser()>, datacache=None, trigcache=None, segmentcache=None, segdb_error='raise', datafind_error='raise')[source]

Process data for this tab in a given state

Parameters:
state~gwsumm.state.SummaryState

the state to process. Can give None to process ALLSTATE with no plots, useful to load all data for other states

ndsbool, optional

True to use NDS to read data, otherwise read from frames. Use None to read from frames if possible, otherwise using NDS.

nprocint, optional

number of parallel cores to use when reading data and making plots, default: 1

configConfigParser, optional

configuration for this analysis

datacache~glue.lal.Cache, optional

Cache of files from which to read time-series data

trigcache~glue.lal.Cache, optional

Cache of files from which to read event triggers

segmentcache~glue.lal.Cache, optional

Cache of files from which to read segments

segdb_errorstr, optional

if 'raise': raise exceptions when the segment database reports exceptions, if 'warn''`, print warnings but continue, otherwise ``'ignore' them completely and carry on.

type = 'data'
write_html(*args, **kwargs)[source]

Write the HTML page for this state Tab.

Parameters:
maincontentstr, :class:`~MarkupPy.markup.page`

simple string content, or a structured page of markup to embed as the content of the #main div.

titlestr, optional, default: {parent.name}

level 1 heading for this Tab.

subtitlestr, optional, default: {self.name}

level 2 heading for this Tab.

tabs: `list`, optional

list of top-level tabs (with children) to populate navbar

ifostr, optional

prefix for this IFO.

ifomapdict, optional

dict of (ifo, {base url}) pairs to map to summary pages for other IFOs.

help_str, :class:`~MarkupPy.markup.page`, optional

non-menu content for navigation bar, defaults to calendar

csslist, optional

list of resolvable URLs for CSS files. See gwsumm.html.static.CSS for the default list.

jslist, optional

list of resolvable URLs for javascript files. See gwumm.html.JS for the default list.

aboutstr, optional

href for the ‘About’ page

footerstr, ~MarkupPy.markup.page

user-defined content for the footer (placed below everything else)

**inargs

other keyword arguments to pass to the :meth:`~Tab.build_inner_html` method

write_state_html(state)[source]

Write the ‘#main’ HTML content for this tab.

For now, this function just links all the plots in a 2-column format.

write_state_information(state)[source]
write_state_placeholder(state)[source]

Write a placeholder ‘#main’ content for this tab

class gwsumm.tabs.data.ProcessedTab[source]

Bases: object

Abstract base class to detect necessity to run Tab.process()

process()[source]

This method must be overridden by all subclasses

type = '_processed'
gwsumm.tabs.etg module

Custom SummaryTab for the output of an ETG.

class gwsumm.tabs.etg.EventTriggerTab(*args, **kwargs)[source]

Bases: DataTab

Custom DataTab displaying a summary of event trigger generation

Parameters:
namestr

name of this tab (required)

startLIGOTimeGPS, str

start time of this DataTab, anything that can be parsed by ~gwpy.time.to_gps is fine

endLIGOTimeGPS, str

end time of this DataTab, format as for start

channelstr

name of the channel of interest

etgstr, optional

name of this event trigger generator (ETG), defaults to the name of this EventTriggerTab

stateslist of states <gwsumm.state.SummaryState>

the list of states (~gwsumm.state.SummaryState) over which this DataTab should be processed. More states can be added later (but before running :meth:`~DataTab.process`) via :meth:`~DataTab.add_state`.

tabletype, str, optional

LIGO_LW ~glue.ligolw.table.Table class to use for this ETG, e.g. use ~glue.ligolw.lsctables.SnglBurstTable for Omicron, or ~glue.ligolw.lsctables.SnglInspiralTable for CBC

cache~glue.lal.Cache, str, optional

Cache object, or path to a LAL-format cache file on disk, from which to read the event triggers. If no cache is given, the gwtrigfind module will be used to automatically locate the trigger files.

urlstr, optional

URL for linking to more details results for this tab.

**kwargs

all other keyword arguments accepted by the DataTab

See also

:obj:`gwsumm.tabs.DataTab`

for details on the other keyword arguments (**kwargs) accepted by the constructor for this EventTriggerTab.

finalize_states(config=None, **kwargs)[source]

Fetch the segments for each state for this SummaryTab

classmethod from_ini(config, section, **kwargs)[source]

Define a new EventTriggerTab from a ConfigParser.

Parameters:
cp:class:`~gwsumm.config.GWConfigParser`

customised configuration parser containing given section

sectionstr

name of section to parse

*args, **kwargs

other positional and keyword arguments to pass to the class constructor (__init__)

See also

:obj:`DataTab.from_ini`

the parent parsing method that handles parsing plot defintions, amongst other things

Notes

In addition to those attributes parsed by the parent DataTab.from_ini method, this method will parse the following attributes from a ConfigParser:

.. autosummary::

~EventTriggerTab.channel ~EventTriggerTab.etg ~EventTriggerTab.url ~EventTriggerTab.cache ~EventTriggerTab.table

Additionally, the loudest events table is configured by giving the following options

—————– ——————————————— loudest the number of events to include in the table loudest-rank the statistic to use in sorting the table loudest-dt the minimum time separation for unique events loudest-columns the columns to print in the table loudest-labels the labels for each of the given columns —————– ———————————————

process(*args, **kwargs)[source]

Process data for this tab

Parameters:
configConfigParser.ConfigParser, optional

job configuration to pass to \(~DataTab.finalize_states\)

**stateargs

all other keyword arguments are passed directly onto the :meth:`~DataTab.process_state` method.

process_state(state, *args, **kwargs)[source]

Process data for this tab in a given state

Parameters:
state~gwsumm.state.SummaryState

the state to process. Can give None to process ALLSTATE with no plots, useful to load all data for other states

ndsbool, optional

True to use NDS to read data, otherwise read from frames. Use None to read from frames if possible, otherwise using NDS.

nprocint, optional

number of parallel cores to use when reading data and making plots, default: 1

configConfigParser, optional

configuration for this analysis

datacache~glue.lal.Cache, optional

Cache of files from which to read time-series data

trigcache~glue.lal.Cache, optional

Cache of files from which to read event triggers

segmentcache~glue.lal.Cache, optional

Cache of files from which to read segments

segdb_errorstr, optional

if 'raise': raise exceptions when the segment database reports exceptions, if 'warn''`, print warnings but continue, otherwise ``'ignore' them completely and carry on.

type = 'triggers'
write_state_html(state, pre=None)[source]

Write the ‘#main’ HTML content for this EventTriggerTab.

gwsumm.tabs.fscan module

Custom SummaryTab for the output of the FScan algorithm.

class gwsumm.tabs.fscan.FscanTab(*args, **kwargs)[source]

Bases: DataTab

Custom tab displaying a summary of Fscan results.

classmethod from_ini(config, section, **kwargs)[source]

Define a new FscanTab from a ConfigParser.

process(config=<GWSummConfigParser()>, **kwargs)[source]

Process data for this tab

Parameters:
configConfigParser.ConfigParser, optional

job configuration to pass to \(~DataTab.finalize_states\)

**stateargs

all other keyword arguments are passed directly onto the :meth:`~DataTab.process_state` method.

type = 'fscan'
write_state_html(state)[source]

Write the ‘#main’ HTML content for this FscanTab.

gwsumm.tabs.gracedb module

Custom SummaryTab to display events queried from the Gravitational-wave Candidate Event Database (GraceDb)

class gwsumm.tabs.gracedb.GraceDbTab(*args, **kwargs)[source]

Bases: DataTab

Custom tab displaying a summary of GraceDb results.

classmethod from_ini(config, section, **kwargs)[source]

Define a new GraceDbTab from a ConfigParser.

process(config=<GWSummConfigParser()>, **kwargs)[source]

Process data for this tab

Parameters:
configConfigParser.ConfigParser, optional

job configuration to pass to \(~DataTab.finalize_states\)

**stateargs

all other keyword arguments are passed directly onto the :meth:`~DataTab.process_state` method.

process_state(state, **kwargs)[source]

Process data for this tab in a given state

Parameters:
state~gwsumm.state.SummaryState

the state to process. Can give None to process ALLSTATE with no plots, useful to load all data for other states

ndsbool, optional

True to use NDS to read data, otherwise read from frames. Use None to read from frames if possible, otherwise using NDS.

nprocint, optional

number of parallel cores to use when reading data and making plots, default: 1

configConfigParser, optional

configuration for this analysis

datacache~glue.lal.Cache, optional

Cache of files from which to read time-series data

trigcache~glue.lal.Cache, optional

Cache of files from which to read event triggers

segmentcache~glue.lal.Cache, optional

Cache of files from which to read segments

segdb_errorstr, optional

if 'raise': raise exceptions when the segment database reports exceptions, if 'warn''`, print warnings but continue, otherwise ``'ignore' them completely and carry on.

type = 'gracedb'
write_state_html(state)[source]

Write the ‘#main’ HTML content for this GraceDbTab.

gwsumm.tabs.guardian module

Definition of the GuardianTab

class gwsumm.tabs.guardian.GuardianTab(*args, **kwargs)[source]

Bases: DataTab

Summarises the data recorded by an Advanced LIGO Guardian node.

Each guardian node controls and monitors state transitions for a specific subsystem of the Advanced LIGO interferometer. The GuardianTab summarises those data with a state segments plot, a transitions summary table, and a detailed list of transitions and segments for each listed state.

classmethod from_ini(config, section, plotdir='plots', **kwargs)[source]

Define a new GuardianTab.

process(nds=None, nproc=1, config=<GWSummConfigParser()>, datacache=None, segmentcache=[], datafind_error='raise', **kwargs)[source]

Process data for the given state.

type = 'guardian'
write_state_html(state)[source]

Write the HTML for the given state of this GuardianTab

gwsumm.tabs.management module

Definition of the AccountingTab

class gwsumm.tabs.management.AccountingTab(*args, **kwargs)[source]

Bases: DataTab

Summarise the data recorded by the operating mode channels

classmethod from_ini(config, section, plotdir='plots', **kwargs)[source]

Define a new SummaryTab from the given section of the ConfigParser.

Parameters:
cp:class:`~gwsumm.config.GWConfigParser`

customised configuration parser containing given section

sectionstr

name of section to parse

plotdirstr, optional, default: 'plots'

output path for plots, relative to current directory

Returns:
tabDataTab

a new DataTab defined from the configuration

process(nds=None, nproc=1, config=<GWSummConfigParser()>, datacache=None, datafind_error='raise', **kwargs)[source]

Process time accounting data

type = 'accounting'
write_state_html(state)[source]

Write the HTML for the given state of this GuardianTab

gwsumm.tabs.misc module

This module defines some utility Tab subclasses, including HTTP error handlers.

class gwsumm.tabs.misc.AboutTab(*args, **kwargs)[source]

Bases: Tab

Page describing how the containing HTML pages were generated

type = 'about'
write_html(config=[], prog=None, **kwargs)[source]

Write the HTML page for this Tab.

Parameters:
maincontentstr, ~MarkupPy.markup.page

simple string content, or a structured page of markup to embed as the content of the #main div.

titlestr, optional, default: {parent.name}

level 1 heading for this Tab.

subtitlestr, optional, default: {self.name}

level 2 heading for this Tab.

tabs: `list`, optional

list of top-level tabs (with children) to populate navbar

ifostr, optional

prefix for this IFO.

ifomapdict, optional

dict of (ifo, {base url}) pairs to map to summary pages for other IFOs.

help_str, ~MarkupPy.markup.page, optional

non-menu content for navigation bar

csslist, optional

list of resolvable URLs for CSS files. See gwsumm.html.CSS for the default list.

jslist, optional

list of resolvable URLs for javascript files. See gwumm.html.JS for the default list.

aboutstr, optional

href for the ‘About’ page

footerstr, ~MarkupPy.markup.page

external link, if applicable (linked from an icon in the footer)

issuesbool or str, default: True

print link to github.com issue tracker for this package

**inargs

other keyword arguments to pass to the :meth:`~Tab.build_inner_html` method

class gwsumm.tabs.misc.Error404Tab(*args, **kwargs)[source]

Bases: Tab

Custom HTTP 404 error page

type = '404'
write_html(config=[], top=None, **kwargs)[source]

Write the HTML page for this Tab.

Parameters:
maincontentstr, ~MarkupPy.markup.page

simple string content, or a structured page of markup to embed as the content of the #main div.

titlestr, optional, default: {parent.name}

level 1 heading for this Tab.

subtitlestr, optional, default: {self.name}

level 2 heading for this Tab.

tabs: `list`, optional

list of top-level tabs (with children) to populate navbar

ifostr, optional

prefix for this IFO.

ifomapdict, optional

dict of (ifo, {base url}) pairs to map to summary pages for other IFOs.

help_str, ~MarkupPy.markup.page, optional

non-menu content for navigation bar

csslist, optional

list of resolvable URLs for CSS files. See gwsumm.html.CSS for the default list.

jslist, optional

list of resolvable URLs for javascript files. See gwumm.html.JS for the default list.

aboutstr, optional

href for the ‘About’ page

footerstr, ~MarkupPy.markup.page

external link, if applicable (linked from an icon in the footer)

issuesbool or str, default: True

print link to github.com issue tracker for this package

**inargs

other keyword arguments to pass to the :meth:`~Tab.build_inner_html` method

gwsumm.tabs.registry module

Registry for GWSumm data tabs.

All Tabs should be registered for easy identification from the configuration INI files

gwsumm.tabs.registry.get_tab(name)[source]

Query the registry for the tab class registered to the given name

gwsumm.tabs.registry.register_tab(tab, name=None, force=False)[source]

Register a new summary Tab to the given name

Parameters:
tabtype

defining Class for this tab type.

namestr, optional

unique descriptive name for this type of tab, must not contain any spaces, e.g. ‘hveto’. If name=None, the Tab.type class attribute of the given tab will be used.

forcebool

overwrite existing registration for this type

Raises:
ValueError

if name is already registered and force not given as True

gwsumm.tabs.sei module

SummaryTab for seismic watchdog monitoring

class gwsumm.tabs.sei.SEIWatchDogTab(*args, **kwargs)[source]

Bases: DataTab

Summarise the WatchDog trips recorded from the SEI system.

classmethod from_ini(config, section, plotdir='plots', **kwargs)[source]

Define a new SEIWatchDogTab.

process(nds=None, nproc=1, config=<GWSummConfigParser()>, datacache=None, trigcache=None, datafind_error='raise', **kwargs)[source]

Process data for the given state.

type = 'seismic-watchdog'
window = 5
write_state_html(state)[source]

Build HTML summary of watchdog trips

gwsumm.tabs.stamp module

Custom SummaryTab for the output of the FScan algorithm.

class gwsumm.tabs.stamp.StampPEMTab(*args, **kwargs)[source]

Bases: DataTab

Custom tab displaying a summary of StampPEM results.

classmethod from_ini(config, section, **kwargs)[source]

Define a new StampPEMTab from a ConfigParser.

process(config=<GWSummConfigParser()>, **kwargs)[source]

Process data for this tab

Parameters:
configConfigParser.ConfigParser, optional

job configuration to pass to \(~DataTab.finalize_states\)

**stateargs

all other keyword arguments are passed directly onto the :meth:`~DataTab.process_state` method.

type = 'stamp'
write_state_html(state)[source]

Write the ‘#main’ HTML content for this StampPEMTab.

Module contents

This module defines the Tab API, and all of the built-in tab objects

gwsumm.tests package
Submodules
gwsumm.tests.common module

Compatibility module

gwsumm.tests.common.empty_globalv_CHANNELS(f)[source]
gwsumm.tests.test_archive module

Tests for gwsumm.archive

gwsumm.tests.test_archive.create(data, **metadata)[source]
gwsumm.tests.test_archive.empty_globalv()[source]
gwsumm.tests.test_archive.test_archive_load_table()[source]
gwsumm.tests.test_archive.test_read_archive()[source]
gwsumm.tests.test_archive.test_write_archive(delete=True)[source]
gwsumm.tests.test_batch module

Tests for the gwsumm.batch command-line interface

gwsumm.tests.test_batch.test_main(krb, x509, tmpdir, caplog)[source]
gwsumm.tests.test_batch.test_main_invalid_modes(capsys)[source]
gwsumm.tests.test_batch.test_main_loop_over_modes(tmpdir, caplog, mode)[source]
gwsumm.tests.test_channels module

Test suite

gwsumm.tests.test_channels.teardown_module()[source]

Undo any set_mode() operations from this module

gwsumm.tests.test_channels.test_get_channel()[source]

Test :func:`gwsumm.channels.get_channel`

gwsumm.tests.test_channels.test_get_channel_trend()[source]

Test get_channel for trends

get_channel should query for the trend and the underlying raw channel

gwsumm.tests.test_channels.test_get_channels()[source]
gwsumm.tests.test_channels.test_split(cstr, clist)[source]
gwsumm.tests.test_channels.test_split_combination(cstr, clist)[source]
gwsumm.tests.test_channels.test_update_missing_channel_params()[source]
gwsumm.tests.test_config module

Tests for :mod:`gwsumm.config`

class gwsumm.tests.test_config.TestGWSummConfigParser[source]

Bases: object

PARSER

alias of GWSummConfigParser

classmethod cnfg()[source]
classmethod new()[source]
test_configdir()[source]
test_finalize()[source]
test_from_configparser(cnfg)[source]
test_get_css()[source]
test_get_javascript()[source]
test_init()[source]
test_interpolate_section_names(cnfg)[source]
test_load_channels()[source]
test_load_plugins(cnfg)[source]
test_load_rcParams()[source]
test_load_states()[source]
test_load_units(cnfg)[source]
test_nditems(cnfg)[source]
test_ndoptions(cnfg)[source]
test_read()[source]
test_set_date_options()[source]
test_set_ifo_options(ifo, obs, exp)[source]
gwsumm.tests.test_config.assert_configparser_equal(a, b)[source]
gwsumm.tests.test_data module

Tests for gwsumm.data

class gwsumm.tests.test_data.TestData[source]

Bases: object

Tests for :mod:`gwsumm.data`:

classmethod setup_class()[source]
classmethod teardown_class()[source]
test_add_timeseries()[source]
test_find_frame_type()[source]
test_get_channel_type()[source]
test_get_coherence_spectrogram()[source]
test_get_coherence_spectrum()[source]
test_get_fftparams()[source]
test_get_spectrogram()[source]
test_get_spectrum()[source]
test_get_timeseries()[source]
test_make_globalv_key()[source]
test_parse_math_definition(definition, math)[source]
gwsumm.tests.test_data.download(remote, target=None)[source]

Download a file

gwsumm.tests.test_mode module

Test suite for the mode module

gwsumm.tests.test_mode.teardown_module()[source]

Undo any set_mode() operations from this module

gwsumm.tests.test_mode.test_get_base(m, basestr)[source]
gwsumm.tests.test_mode.test_get_mode()[source]
gwsumm.tests.test_mode.test_set_mode()[source]
gwsumm.tests.test_plot module

Tests for gwsumm.plot

class gwsumm.tests.test_plot.TestDataPlot[source]

Bases: TestSummaryPlot

DEFAULT_ARGS = [['X1:TEST-CHANNEL', 'Y1:TEST-CHANNEL2'], 0, 100]
TYPE = 'data'
test_add_channel()[source]
test_allchannels(plot)[source]
test_apply_parameters(plot)[source]
test_channels(plot)[source]
test_end(plot)[source]
test_finalize(plot)[source]
test_from_ini()[source]
test_get_channel_groups()[source]
test_href(plot)[source]
test_ifos(plot)[source]
test_init()[source]
test_outputfile(plot)[source]
test_parse_legend_kwargs(plot)[source]
test_parse_plot_kwargs(plot)[source]
test_parse_plot_kwargs_labels(plot, usetex, result)[source]
test_parse_rcParams(plot)[source]
test_span(plot)[source]
test_start(plot)[source]
test_state(plot)[source]
test_tag(plot)[source]
class gwsumm.tests.test_plot.TestSummaryPlot[source]

Bases: object

DEFAULT_ARGS = []
DEFAULT_KWARGS = {}
TYPE = None
classmethod create(*args, **kwargs)[source]
classmethod plot()[source]
classmethod setup_class()[source]
test_eq(plot)[source]
test_href(plot, url, href)[source]
test_init()[source]
test_new(plot, isnew, new)[source]
test_repr(plot)[source]
test_src(plot)[source]
test_str(plot)[source]
gwsumm.tests.test_plot.test_get_column_label(column, label)[source]
gwsumm.tests.test_plot.test_get_plot(name, plot)[source]
gwsumm.tests.test_plot.test_registry_plot()[source]
gwsumm.tests.test_tabs module

Tests for gwsumm.tabs

class gwsumm.tests.test_tabs.TestExternalTab[source]

Bases: TestTab

DEFAULT_ARGS = ['Test', '//test.com']
TYPE = 'external'
test_init()[source]
class gwsumm.tests.test_tabs.TestPlotTab[source]

Bases: TestTab

TYPE = 'plots'
test_add_plot()[source]
test_init()[source]
test_layout()[source]
class gwsumm.tests.test_tabs.TestTab[source]

Bases: object

DEFAULT_ARGS = ['Test']
TYPE = 'basic'
create(*args, **kwargs)[source]
classmethod setup_class()[source]
test_index()[source]
test_init()[source]
test_shortname()[source]
gwsumm.tests.test_tabs.test_get_tab(name, tab)[source]
gwsumm.tests.test_tabs.test_register_tab()[source]
gwsumm.tests.test_utils module

Tests for gwsumm.utils

gwsumm.tests.test_utils.test_elapsed_time()[source]
gwsumm.tests.test_utils.test_get_default_ifo(ifo, host)[source]
gwsumm.tests.test_utils.test_get_odc_bitmask(chan, mask)[source]
gwsumm.tests.test_utils.test_mkdir()[source]
gwsumm.tests.test_utils.test_nat_sorted()[source]
gwsumm.tests.test_utils.test_safe_eval(value, out)[source]
gwsumm.tests.test_utils.test_safe_eval_2()[source]
gwsumm.tests.test_utils.test_vprint(capsys)[source]
Module contents

Test suite

Submodules
gwsumm.archive module

This module handles HDF archiving of data.

In production for LIGO, the LIGO Summary Pages (LSP) Service runs at regular intervals (about every 10 minutes), so an HDF5 file is used to archive the data read and produced from one instance so that the next instance doesn’t have to re-read and re-produce the same data.

All data products are stored just using the ‘standard’ gwpy .write() method for that object.

gwsumm.archive.archive_table(table, key, parent)[source]

Add a table to the given HDF5 group

Warning

If the input table is empty, it will not be archived

Parameters:
table~astropy.table.Table

the data to archive

keystr

the path (relative to parent) at which to store the table

parenth5py.Group

the h5py group in which to add this dataset

gwsumm.archive.find_daily_archives(start, end, ifo, tag, basedir='.')[source]

Find the daily archives spanning the given GPS [start, end) interval

Parameters:
startfloat, ~datetime.datetime, ~astropy.time.Time, str

start time of the archive file to find, any object that can be converted into a LIGOTimeGPS, ~astropy.time.Time, or ~datetime.datetime is acceptable

endfloat, ~datetime.datetime, ~astropy.time.Time, str

end time of the archive file to find, any object that can be converted into a LIGOTimeGPS, ~astropy.time.Time, or ~datetime.datetime is acceptable

ifostr

interferometer string, ex. ‘H1’

tagstr

tag string for the archive file

basedirpath-like, optional

base path to archive files, default: ‘.’

Returns:
archiveslist

list of matching archive files

Notes

This will only search the day directories with the format YYYYMMDD

gwsumm.archive.load_table(dataset)[source]

Read table from the given HDF5 group

The EventTable is read, stored in the memory archive, then returned

Parameters:
dataseth5py.Dataset

n-dimensional table to load from hdf5

Returns:
table~gwpy.table.EventTable

the table of events loaded from hdf5

gwsumm.archive.read_data_archive(sourcefile, rm_source_on_fail=True)[source]

Read archived data from an HDF5 archive source

This method reads all found data into the data containers defined by the gwsumm.globalv module, then returns nothing.

Parameters:
sourcefilestr

path to source HDF5 file

rm_source_on_failbool, optional

remove the source HDF5 file if there was an OSError when opening the file

gwsumm.archive.segments_from_array(array)[source]

Convert a 2-dimensional numpy.ndarray to a SegmentList

Parameters:
arrayfloat numpy.ndarray

input numpy array to convert into a segment list

Returns:
out~gwpy.segments.SegmentList

output segment list

gwsumm.archive.segments_to_array(segmentlist)[source]

Convert a SegmentList to a 2-dimensional numpy.ndarray

Parameters:
segmentlist~gwpy.segments.SegmentList

input segment list to convert

Returns:
outfloat numpy.ndarray

output segment list as a numpy array

gwsumm.archive.write_data_archive(outfile, channels=True, timeseries=True, spectrogram=True, segments=True, triggers=True)[source]

Build and save an HDF archive of data processed in this job.

Parameters:
outfilestr

path to target HDF5 file

timeseriesbool, optional

include TimeSeries data in archive

spectrogrambool, optional

include Spectrogram data in archive

segmentsbool, optional

include DataQualityFlag data in archive

triggersbool, optional

include EventTable data in archive

gwsumm.batch module

Pipeline generator for the Gravitational-wave interferometer summary information system (gwsumm)

This module constructs a directed acyclic graph (DAG) that defines a workflow to be submitted via the HTCondor scheduler.

class gwsumm.batch.GWHelpFormatter(*args, **kwargs)[source]

Bases: HelpFormatter

class gwsumm.batch.GWSummaryDAGNode(job)[source]

Bases: CondorDAGNode

get_cmd_line()[source]

Return the full command line that will be used when this node is run by DAGman.

class gwsumm.batch.GWSummaryJob(universe, tag='gw_summary', subdir=None, logdir=None, **cmds)[source]

Bases: CondorDAGJob

Job representing a configurable instance of gw_summary.

add_opt(opt, value='')[source]

Add a command line option to the executable. The order that the arguments will be appended to the command line is not guaranteed, but they will always be added before any command line arguments. The name of the option is prefixed with double hyphen and the program is expected to parse it with getopt_long(). @param opt: command line option to add. @param value: value to pass to the option (None for no argument).

get_command()[source]
logtag = '$(cluster)-$(process)'
set_command(command)[source]
write_sub_file()[source]

Write a submit file for this Condor job.

gwsumm.batch.create_parser()[source]

Create a command-line parser for this entry point

gwsumm.batch.main(args=None)[source]

Run the command-line Omega scan tool in batch mode

gwsumm.channels module

Utilities for channel access

gwsumm.channels.get_channel(channel, find_parent=True, timeout=5)[source]

Find (or create) a :class:`~gwpy.detector.Channel`.

If channel has already been created, the cached copy will be returned, otherwise a new ~gwpy.detector.Channel object will be created.

Parameters:
channelstr

name of new channel

find_parentbool, optional, default: True

query for raw version of trend channel (trends not in CIS)

timeoutfloat, optional, default: 5

number of seconds to wait before connection times out

Returns:
Channel:class:`~gwpy.detector.Channel`

new channel.

gwsumm.channels.get_channels(channels, **kwargs)[source]

Find (or create) multiple channels calling get_channel()

Parameters:
channelslist

list of channels as str or ~gwpy.detector.Channel objects

**kwargs

keyword arguments applied to each channel in the list

Returns:
ChannelList~gwpy.detector.ChannelList

a list of channels

gwsumm.channels.split(channelstring)[source]

Split a comma-separated list of channels that may, or may not contain NDS2 channel types as well

Parameters:
channelstringstr

comma-separated string of channels

Returns:
outlist

list of strings for each channel

gwsumm.channels.split_combination(channelstring)[source]

Split a math-combination of channels

Parameters:
channelstringstr
Returns:
ChannelList~gwpy.detector.ChannelList
gwsumm.channels.update_channel_params()[source]

Update the globalv.CHANNELS list based on internal parameter changes

This is required to update Channel.type based on Channel.frametype, and similar.

gwsumm.channels.update_missing_channel_params(channel, **kwargs)[source]

Update empty channel parameters using the given input

This method will only set parameters in the channel if the target parameter is None.

Parameters:
channel~gwpy.detector.Channel

channel to update

**kwargs

(key, value) pairs to set

Returns:
target~gwpy.detector.Channel

the channel after updating parameters

gwsumm.globalv module

Set of global memory variables for GWSumm package

gwsumm.io module

Input/output utilities

gwsumm.io.read_frequencyseries(filename)[source]

Read a ~gwpy.frequencyseries.FrequencySeries from a file

IF using HDF5, the filename can be given as a combined filename/path, i.e. test.hdf5/path/to/dataset.

Parameters:
filenamestr

path of file to read

Returns:
series~gwpy.frequencyseries.FrequencySeries

the data as read

Raises:
astropy.io.registry.IORegistryError

if the input format cannot be identified or is not registered

gwsumm.mode module

Job modes

class gwsumm.mode.Mode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: OrderedEnum

Enumeration of valid processing ‘modes’

Each mode provides an association with a particular GPS interval

day = 10
dir_format()[source]
event = 1
gps = 2
is_calendar()[source]
month = 12
static = 0
week = 11
year = 13
class gwsumm.mode.OrderedEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

gwsumm.mode.get_base(date, mode=None)[source]

Determine the correct base attribute for the given date and mode.

Parameters:
date:class:`datetime.datetime`

formatted date

modeint, str

enumerated interger code (or name) for the required mode

Returns:
basestr

the recommended base URL to have a correctly linked calendar

gwsumm.mode.get_mode(m=None)[source]

Return the enum for the given mode, defaults to the current mode.

gwsumm.mode.set_mode(m)[source]

Set the current mode.

gwsumm.segments module

Utilities for segment handling and display

gwsumm.segments.format_padding(flags, padding)[source]

Format an arbitrary collection of paddings into a dict

gwsumm.segments.get_segments(flag, validity=None, config=<configparser.ConfigParser object>, cache=None, query=True, return_=True, coalesce=True, padding=None, ignore_undefined=False, segdb_error='raise', url=None, **read_kw)[source]

Retrieve the segments for a given flag

Segments will be loaded from global memory if already defined, otherwise they will be loaded from the given :class:`~glue.lal.Cache`, or finally from the segment database

Parameters:
flagstr, list

either the name of one flag, or a list of names

validity~gwpy.segments.SegmentList

the segments over which to search for other segments

querybool, optional, default: True

actually execute a read/query operation (if needed), otherwise just retrieve segments that have already been cached

config~configparser.ConfigParser, optional

the configuration for your analysis, if you have one. If present the [segment-database] section will be queried for the following options

  • gps-start-time, and gps-end-time, if validity is not given

  • url (the remote hostname for the segment database) if the url keyword is not given

cache:class:`glue.lal.Cache`, optional

a cache of files from which to read segments, otherwise segments will be downloaded from the segment database

coalescebool, optional, default: True

coalesce all segmentlists before returning, otherwise just return segments as they were downloaded/read

paddingtuple, or dict of tuples, optional

(start, end) padding with which to pad segments that are downloaded/read

ignore_undefinedbool, optional, default: False

Special case needed for network calculation compound flags so that when this is True, DataQualityFlag.known values are set to the same value as validity

segdb_errorstr, optional, default: 'raise'

how to handle errors returned from the segment database, one of

  • 'raise' (default) : raise the exception as normal

  • 'warn' : print the exception as a warning, but return no segments

  • 'ignore' : silently ignore the error and return no segments

urlstr, optional

the remote hostname for the target segment database

return_bool, optional, default: True

internal flag to enable (True) or disable (False) actually returning anything. This is useful if you want to download/read segments now but not use them until later (e.g. plotting)

**read_kwdict, optional

additional keyword arguments to ~gwpy.segments.DataQualityDict.read or ~gwpy.segments.DataQualityFlag.read

Returns:
flag~gwpy.segments.DataQualityFlag

the flag object representing segments for the given single flag, OR

flagdict~gwpy.segments.DataQualityDict

the dict of ~gwpy.segments.DataQualityFlag objects for multiple flags, if flag is given as a list, OR

None

if return_=False

gwsumm.segments.not_equal(a, b, f)[source]
gwsumm.segments.split_compound_flag(compound)[source]

Parse the configuration for this state.

Returns:
flagstuple

a 2-tuple containing lists of flags defining required ON and OFF segments respectively for this state

gwsumm.triggers module

Read and store transient event triggers

gwsumm.triggers.add_triggers(table, key, segments=None)[source]

Add a EventTable to the global memory cache

gwsumm.triggers.get_etg_read_kwargs(etg, config=None, exclude=['columns'])[source]

Read keyword arguments to pass to the trigger reader for a given etg

gwsumm.triggers.get_etg_table(etg)[source]

Find which table should be used for the given etg

Parameters:
etgstr

name of Event Trigger Generator for which to query

Returns:
tabletype, subclass of ~ligo.lw.table.Table

LIGO_LW table registered to the given ETG

Raises:
KeyError

if the ETG is not registered

gwsumm.triggers.get_time_column(table, etg)[source]

Get the time column name for this table

gwsumm.triggers.get_times(table, etg)[source]

Get the time data for this table

gwsumm.triggers.get_triggers(channel, etg, segments, config=<GWSummConfigParser()>, cache=None, columns=None, format=None, query=True, nproc=1, ligolwtable=None, filter=None, timecolumn=None, verbose=False, return_=True)[source]

Read a table of transient event triggers for a given channel.

gwsumm.triggers.keep_in_segments(table, segmentlist, etg=None)[source]

Return a view of the table containing only those rows in the segmentlist

gwsumm.triggers.read_cache(cache, segments, etg, nproc=1, timecolumn=None, **kwargs)[source]

Read a table of events from a cache

This function is mainly meant for use from the get_triggers method

Parameters:
cache:class:`glue.lal.Cache`

the formatted list of files to read

segments~gwpy.segments.SegmentList

the list of segments to read

etgstr

the name of the trigger generator that created the files

nprocint, optional

the number of parallel processes to use when reading

**kwargs

other keyword arguments are passed to the EventTable.read or {tableclass}.read methods

Returns:
table~gwpy.table.EventTable, None

a table of events, or None if the cache has no overlap with the segments

gwsumm.units module

Extra units for GW data processing

gwsumm.utils module

Utilities for GWSumm

gwsumm.utils.elapsed_time()[source]

Return the time (seconds) since this job started

gwsumm.utils.get_default_ifo(fqdn='build-24124212-project-416166-gwsumm')[source]

Find the default interferometer prefix (IFO) for the given host

Parameters:
fqdnstr

the fully-qualified domain name (FQDN) of the host on which you wish to find the default IFO

Returns:
IFOstr

the upper-case X1-style prefix for the default IFO, if found, e.g. L1

Raises:
ValueError

if not default interferometer prefix can be parsed

gwsumm.utils.get_odc_bitmask(odcchannel)[source]
gwsumm.utils.mkdir(*paths)[source]

Conditional mkdir operation, for convenience

gwsumm.utils.nat_sorted(iterable, key=None)[source]

Sorted a list in the way that humans expect.

Parameters:
iterableiterable

iterable to sort

keycallable

sorting key

Returns:
lsortedlist

sorted() version of input l

gwsumm.utils.safe_eval(val, strict=False, globals_=None, locals_=None)[source]

Evaluate the given string as a line of python, if possible

If the :meth:`eval` fails, a str is returned instead, unless strict=True is given.

Parameters:
valstr

input text to evaluate

strictbool, optional, default: False

raise an exception when the eval call fails (True) otherwise return the input as a str (False, default)

globals_dict, optional

dict of global variables to pass to eval, defaults to current globals

locals_dict, optional

dict of local variables to pass to eval, defaults to current locals

Note

Note the trailing underscore on the globals_ and locals_ kwargs, this is required to not clash with the builtin globals and locals methods`.

Raises:
ValueError

if the input string is considered unsafe to evaluate, normally meaning it contains something that might interact with the filesystem (e.g. os.path calls)

NameError
SyntaxError

if the input cannot be evaluated, and strict=True is given

See also

:obj:`eval`

for more documentation on the underlying evaluation method

gwsumm.utils.vprint(message, verbose=True, stream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, profile=True)[source]

Prints the given message to the stream.

Parameters:
messagestr

string to print

verbosebool, optional, default: True

flag to print or not, default: print

streamfile, optional, default: stdout

file object stream in which to print, default: stdout

profilebool, optional, default: True

flag to print timestamp for debugging and profiling purposes

Module contents

Gravitational-wave interferometer summary information system

EventTab
IntervalTab
StaticTab
gwsumm