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
- 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
- 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
- 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 = ['imshow', 'origin', 'vmin', 'vmax', 'alpha', 'color', 'normed', 'log', 'weights', 'orientation', 'marker', 'density', 'bottom', 'label', 'interpolation', 'rwidth', 'aspect', 'cmap', 'range', 'histtype', 'zorder', 'norm', 's', 'linestyle', 'cumulative', 'linewidth', 'stacked', 'extent', 'bins', 'rasterized', 'logbins', 'align', 'known', 'height', 'y', 'facecolor', 'edgecolor']¶
list of parameters parsed for plot() calls
- 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
- 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
- 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
- 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 = ['imshow', 'origin', 'vmin', 'vmax', 'alpha', 'color', 'normed', 'log', 'weights', 'orientation', 'marker', 'density', 'bottom', 'label', 'interpolation', 'rwidth', 'aspect', 'cmap', 'range', 'histtype', 'zorder', 'norm', 's', 'linestyle', 'cumulative', 'linewidth', 'stacked', 'extent', 'bins', 'rasterized', 'logbins', 'align', '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
- 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.