Skip to content
Snippets Groups Projects
Commit 9e1c278b authored by Jameson Rollins's avatar Jameson Rollins
Browse files

Update internal references to plugins

with a descriptive docstring.
parent cda490c3
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@ from matplotlib import pyplot as plt
from . import __version__, set_signal_handlers
from . import config
from .plugins import FOLLOWUPS
from .plugins import PLUGINS
from .event import LocklossEvent, find_events
from . import condor
......@@ -46,10 +46,10 @@ def analyze_event(event, plugins=None):
logging.info("event url: {}".format(event.url()))
complete = True
for name, func in FOLLOWUPS.items():
for name, func in PLUGINS.items():
if plugins and name not in plugins:
continue
logging.info("executing followup: {}({})".format(
logging.info("executing plugin: {}({})".format(
name, event.id))
try:
func(event)
......@@ -116,7 +116,7 @@ def _parser_add_arguments(parser):
def main(args=None):
"""Analyze event(s)
By default all analysis follow-ups for the specified event will
By default all analysis plugins for the specified event will
exeuted. If the --condor option is given with GPS start and end
times all events within the specified time span will be analyzed.
......
......@@ -23,7 +23,7 @@ def set_thresh_crossing(ax, thresh_crossing, gps, segment):
def set_rcparams():
"""Sets matplotlib parameters for followups.
"""Standard matplotlib plot styling.
"""
plt.rcParams['font.size'] = 30
......
'''locklost followup analysis plugins
The package consists of functions to be run during a locklost event
followup analysis. Plugin functions should take a LocklossEvent as
argument.
Plugins are registerd with the register_plugin() function. Plugins
are currently executed sequentially in a single process, so register
ordering is preserved as a poor-man's dependency tree.
FIXME: figure out better way to express dependencies (e.g. DAG)
'''
import collections
import matplotlib.pyplot as plt
......@@ -5,49 +18,49 @@ from matplotlib import rcParamsDefault
plt.rcParams.update(rcParamsDefault)
FOLLOWUPS = collections.OrderedDict()
def add_follow(mod):
FOLLOWUPS.update([(mod.__name__, mod)])
PLUGINS = collections.OrderedDict()
def register_plugin(func):
PLUGINS.update([(func.__name__, func)])
from .discover import discover_data
add_follow(discover_data)
register_plugin(discover_data)
from .refine import refine_time
add_follow(refine_time)
register_plugin(refine_time)
from .observe import check_observe
add_follow(check_observe)
register_plugin(check_observe)
from .history import find_previous_state
add_follow(find_previous_state)
register_plugin(find_previous_state)
from .saturations import find_saturations
add_follow(find_saturations)
register_plugin(find_saturations)
from .lpy import find_lpy
add_follow(find_lpy)
register_plugin(find_lpy)
from .lsc_asc import plot_lsc_asc
add_follow(plot_lsc_asc)
register_plugin(plot_lsc_asc)
from .glitch import analyze_glitches
add_follow(analyze_glitches)
register_plugin(analyze_glitches)
from .overflows import find_overflows
add_follow(find_overflows)
register_plugin(find_overflows)
from .brs import check_brs
add_follow(check_brs)
register_plugin(check_brs)
from .board_sat import check_boards
add_follow(check_boards)
register_plugin(check_boards)
from .wind import check_wind
add_follow(check_wind)
register_plugin(check_wind)
from .ads_excursion import check_ads
add_follow(check_ads)
register_plugin(check_ads)
# add last since this needs to wait for additional data
from .seismic import check_seismic
add_follow(check_seismic)
register_plugin(check_seismic)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment