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:
- 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