Exemplo n.º 1
0
    def create_time_and_component_prefs(self):
        ''' Create the preference items of the collection node.
        '''
        pagename = '1 time and components'
        self.pref_manager.add_page(pagename)

        # The start time
        pref_item = psy_pm.DateTimeEditPrefItem(name = 'start_time',
                                                      label = 'start time',
                                                      value = UTCDateTime('2012-07-09T00:00:00'),
                                                      group = 'time range',
                                                      tool_tip = 'The start time of the interval to process.')
        self.pref_manager.add_item(pagename = pagename,
                                   item = pref_item)

        # The end time
        pref_item = psy_pm.DateTimeEditPrefItem(name = 'end_time',
                                                      label = 'end time',
                                                      value = UTCDateTime('2012-07-09T00:00:00'),
                                                      group = 'time range',
                                                      tool_tip = 'The end time of the interval to process.')
        self.pref_manager.add_item(pagename = pagename,
                                   item = pref_item)

        # The SCNL list
        pref_item = psy_pm.ListCtrlEditPrefItem(name = 'scnl_list',
                                           label = 'SCNL',
                                           value = [],
                                           column_labels = ['station', 'channel', 'network', 'location'],
                                           group = 'component selection',
                                           tool_tip = 'Select the components to process.'
                                          )
        self.pref_manager.add_item(pagename = pagename,
                                   item = pref_item)
Exemplo n.º 2
0
    def create_selector_preferences(self):
        ''' Create the preference items of the event selection section.
        '''
        events_page = self.pref_manager.add_page('events')
        time_group = events_page.add_group('time span')
        event_group = events_page.add_group('event selection')

        item = psy_pm.DateTimeEditPrefItem(
            name='start_time',
            label='start time',
            value=UTCDateTime('2015-01-01T00:00:00'),
            tool_tip=
            'The start time of the selection time span (UTCDateTime string format YYYY-MM-DDTHH:MM:SS).'
        )
        time_group.add_item(item)

        item = psy_pm.DateTimeEditPrefItem(
            name='end_time',
            label='end time',
            value=UTCDateTime('2015-01-01T00:00:00'),
            tool_tip=
            'The end time of the selection time span (UTCDateTime string format YYYY-MM-DDTHH:MM:SS).'
        )
        time_group.add_item(item)

        item = psy_pm.SingleChoicePrefItem(
            name='event_catalog',
            label='event catalog',
            value='',
            limit=[],
            tool_tip='Select an event catalog for which to load the events.')
        event_group.add_item(item)

        item = psy_pm.CheckBoxPrefItem(
            name='select_individual',
            label='select individual events',
            value=False,
            tool_tip='Do a manual selection of the events to process.',
            hooks={'on_value_change': self.on_select_individual})
        event_group.add_item(item)

        item = psy_pm.ActionItem(name='load_events',
                                 label='load events',
                                 mode='button',
                                 action=self.on_load_events,
                                 tool_tip='Load events from the database.')
        event_group.add_item(item)

        item = psy_pm.CustomPrefItem(
            name='events',
            label='events',
            value=[],
            gui_class=EventListField,
            tool_tip=
            'The available events. Selected events will be used for processing.'
        )
        event_group.add_item(item)
Exemplo n.º 3
0
    def create_archive_prefs(self):
        ''' Create the archive input preference items.
        '''
        pagename = '1 archive'
        self.pref_manager.add_page(pagename)

        # The archive directory
        pref_item = psy_pm.DirBrowsePrefItem(name = 'archive_dir',
                                             label = 'archive directory',
                                             group = 'archive',
                                             value = '',
                                             hooks = {'on_value_change': self.on_archive_dir_changed},
                                             tool_tip = 'The root directory of the Reftek raw data archive.'
                                            )
        self.pref_manager.add_item(pagename = pagename, item = pref_item)

        # Scan archive button.
        item = psy_pm.ActionItem(name = 'acan_archive',
                                 label = 'scan archive',
                                 group = 'archive',
                                 mode = 'button',
                                 action = self.on_scan_archive,
                                 tool_tip = 'Scan the reftek raw data archive.')
        self.pref_manager.add_item(pagename = pagename,
                                   item = item)

        # The start time
        pref_item = psy_pm.DateTimeEditPrefItem(name = 'start_time',
                                                      label = 'start time',
                                                      value = utcdatetime.UTCDateTime('2012-07-09T00:00:00'),
                                                      group = 'time range',
                                                      tool_tip = 'The start time of the interval to process.')
        self.pref_manager.add_item(pagename = pagename,
                                   item = pref_item)

        # The end time
        pref_item = psy_pm.DateTimeEditPrefItem(name = 'end_time',
                                                      label = 'end time',
                                                      value = utcdatetime.UTCDateTime('2012-07-09T00:00:00'),
                                                      group = 'time range',
                                                      tool_tip = 'The end time of the interval to process.')
        self.pref_manager.add_item(pagename = pagename,
                                   item = pref_item)

        # The SCNL list
        pref_item = psy_pm.ListCtrlEditPrefItem(name = 'unit_list',
                                           label = 'units',
                                           value = [],
                                           column_labels = ['unit id', 'stream', 'first data', 'last data'],
                                           limit = [],
                                           group = 'unit selection',
                                           tool_tip = 'Select the units to process.'
                                          )
        self.pref_manager.add_item(pagename = pagename,
                                   item = pref_item)
Exemplo n.º 4
0
    def create_time_and_component_prefs(self):
        ''' Create the preference items of the collection node.
        '''
        tc_page = self.pref_manager.add_page('select input')
        input_group = tc_page.add_group('input')
        tr_group = tc_page.add_group('time range')
        comp_group = tc_page.add_group('component selection')

        # The input data directory.
        pref_item = psy_pm.DirBrowsePrefItem(
            name='data_dir',
            label='psd data directory',
            value='',
            tool_tip='Specify a directory where the PSD data files are located.'
        )
        input_group.add_item(pref_item)

        # The start time
        pref_item = psy_pm.DateTimeEditPrefItem(
            name='start_time',
            label='start time',
            value=UTCDateTime('2012-07-09T00:00:00'),
            tool_tip='The start time of the interval to process.')
        tr_group.add_item(pref_item)

        # The end time
        pref_item = psy_pm.DateTimeEditPrefItem(
            name='end_time',
            label='end time',
            value=UTCDateTime('2012-07-09T00:00:00'),
            tool_tip='The end time of the interval to process.')
        tr_group.add_item(pref_item)

        # The SCNL list
        pref_item = psy_pm.ListCtrlEditPrefItem(
            name='scnl_list',
            label='SCNL',
            value=[],
            column_labels=['station', 'channel', 'network', 'location'],
            tool_tip='Select the components to process.')
        comp_group.add_item(pref_item)
Exemplo n.º 5
0
    def create_general_prefs(self):
        ''' Create the general preferences.
        '''
        general_page = self.pref_manager.add_page('General')
        dts_group = general_page.add_group('detection time span')
        ctp_group = general_page.add_group('components to process')

        # The start_time.
        item = psy_pm.DateTimeEditPrefItem(name = 'start_time',
                                           label = 'start time',
                                           value = UTCDateTime('2015-01-01T00:00:00'),
                                           tool_tip = 'The start time of the detection time span (UTCDateTime string format YYYY-MM-DDTHH:MM:SS).')
        dts_group.add_item(item)

        # The end time.
        item = psy_pm.DateTimeEditPrefItem(name = 'end_time',
                                           label = 'end time',
                                           value = UTCDateTime('2015-01-01T00:00:00'),
                                           tool_tip = 'The end time of the detection time span (UTCDateTime string format YYYY-MM-DDTHH:MM:SS).')
        dts_group.add_item(item)



        # The stations to process.
        item = psy_pm.MultiChoicePrefItem(name = 'stations',
                                          label = 'stations',
                                          limit = ('value 1', 'value 2', 'value 3', 'value 4', 'value 5'),
                                          value = [],
                                          tool_tip = 'The stations which should be used for the detection.')
        ctp_group.add_item(item)

        # The channels to process.
        item = psy_pm.MultiChoicePrefItem(name = 'channels',
                                          label = 'channels',
                                          limit = ('value 1', 'value 2', 'value 3', 'value 4', 'value 5'),
                                          value = [],
                                          tool_tip = 'The channels which should be used for the detection.')
        ctp_group.add_item(item)
Exemplo n.º 6
0
    def create_timespan_prefs(self):
        ''' Create the time-span preference items.
        '''
        timespan_page = self.pref_manager.add_page('time-span')
        time_group = timespan_page.add_group('time-span')

        pref_item = psy_pm.DateTimeEditPrefItem(
            name='start_time',
            label='start time',
            value=utcdatetime.UTCDateTime('2012-07-09T00:00:00'),
            tool_tip=
            'The start time overriding the start time preference values of all collection nodes in the collection.'
        )
        time_group.add_item(pref_item)

        pref_item = psy_pm.DateTimeEditPrefItem(
            name='end_time',
            label='end time',
            value=utcdatetime.UTCDateTime('2012-07-09T00:00:00'),
            tool_tip=
            'The end time overriding the start time preference values of all collection nodes in the collection.'
        )
        time_group.add_item(pref_item)
Exemplo n.º 7
0
    def __init__(self):
        ''' Initialize the instance.

        '''
        OptionPlugin.__init__(self,
                              name='select event',
                              category='select',
                              tags=['event', 'select'])

        # Create the logging logger instance.
        logger_prefix = psysmon.logConfig['package_prefix']
        loggerName = logger_prefix + "." + __name__ + "." + self.__class__.__name__
        self.logger = logging.getLogger(loggerName)

        self.icons['active'] = icons.flag_icon_16

        # The events library.
        self.library = ev_core.Library(name=self.rid)

        # The currently selected event.
        self.selected_event = {}

        # The plot colors used by the plugin.
        self.colors = {}

        # Setup the pages of the preference manager.
        select_page = self.pref_manager.add_page('Select')
        dts_group = select_page.add_group('detection time span')
        es_group = select_page.add_group('event selection')

        item = psy_pm.DateTimeEditPrefItem(
            name='start_time',
            label='start time',
            value=UTCDateTime('2015-01-01T00:00:00'),
            tool_tip=
            'The start time of the detection time span (UTCDateTime string format YYYY-MM-DDTHH:MM:SS).'
        )
        dts_group.add_item(item)

        item = psy_pm.FloatSpinPrefItem(
            name='window_length',
            label='window length [s]',
            value=3600,
            limit=(0, 86400),
            digits=1,
            tool_tip=
            'The length of the time window for which events should be loaded.')
        dts_group.add_item(item)

        item = psy_pm.SingleChoicePrefItem(
            name='event_catalog',
            label='event catalog',
            value='',
            limit=[],
            tool_tip='Select an event catalog for which to load the events.')
        es_group.add_item(item)

        item = psy_pm.ActionItem(name='load_events',
                                 label='load events',
                                 mode='button',
                                 action=self.on_load_events)
        es_group.add_item(item)

        column_labels = [
            'db_id', 'start_time', 'length', 'public_id', 'description',
            'agency_uri', 'author_uri', 'comment'
        ]
        item = psy_pm.ListCtrlEditPrefItem(
            name='events',
            label='events',
            value=[],
            column_labels=column_labels,
            limit=[],
            hooks={'on_value_change': self.on_event_selected},
            tool_tip='The available events.')
        es_group.add_item(item)
Exemplo n.º 8
0
    def __init__(self):
        ''' Initialize the instance.

        '''
        OptionPlugin.__init__(self,
                              name='show events',
                              category='view',
                              tags=['show', 'events'])

        # Create the logging logger instance.
        logger_prefix = psysmon.logConfig['package_prefix']
        loggerName = logger_prefix + "." + __name__ + "." + self.__class__.__name__
        self.logger = logging.getLogger(loggerName)

        self.icons['active'] = icons.flag_icon_16

        # The currently selected event.
        self.selected_event = {}

        # The plot colors used by the plugin.
        self.colors = {}
        self.colors['event_vspan'] = '0.9'

        # Setup the pages of the preference manager.
        self.pref_manager.add_page('Select')
        self.pref_manager.add_page('Display')

        item = psy_pm.DateTimeEditPrefItem(
            name='start_time',
            label='start time',
            group='detection time span',
            value=UTCDateTime('2015-01-01T00:00:00'),
            tool_tip=
            'The start time of the detection time span (UTCDateTime string format YYYY-MM-DDTHH:MM:SS).'
        )
        self.pref_manager.add_item(pagename='Select', item=item)

        item = psy_pm.FloatSpinPrefItem(
            name='window_length',
            label='window length [s]',
            group='detection time span',
            value=3600,
            limit=(0, 86400),
            digits=1,
            tool_tip=
            'The length of the time window for which events should be loaded.')
        self.pref_manager.add_item(pagename='Select', item=item)

        item = psy_pm.SingleChoicePrefItem(
            name='event_catalog',
            label='event catalog',
            group='event selection',
            value='',
            limit=[],
            tool_tip='Select an event catalog for which to load the events.')
        self.pref_manager.add_item(pagename='Select', item=item)

        #        item = psy_pm.CustomPrefItem(name = 'events',
        #                                     label = 'events',
        #                                     group = 'event selection',
        #                                     value = [],
        #                                     gui_class = EventListField,
        #                                     tool_tip = 'The start time of the detection time span (UTCDateTime string format YYYY-MM-DDTHH:MM:SS).')
        column_labels = [
            'db_id', 'start_time', 'length', 'public_id', 'description',
            'agency_uri', 'author_uri', 'comment'
        ]
        item = psy_pm.ListCtrlEditPrefItem(
            name='events',
            label='events',
            group='event selection',
            value=[],
            column_labels=column_labels,
            limit=[],
            hooks={'on_value_change': self.on_event_selected},
            tool_tip='The available events.')
        self.pref_manager.add_item(pagename='Select', item=item)

        item = psy_pm.ActionItem(name='load_events',
                                 label='load events',
                                 group='detection time span',
                                 mode='button',
                                 action=self.on_load_events)
        self.pref_manager.add_item(pagename='Select', item=item)

        item = psy_pm.FloatSpinPrefItem(
            name='pre_et',
            label='pre event time [s]',
            group='display range',
            value=5,
            limit=(0, 86400),
            digits=1,
            tool_tip=
            'The length of the time window to show before the event start.')
        self.pref_manager.add_item(pagename='Display', item=item)

        item = psy_pm.FloatSpinPrefItem(
            name='post_et',
            label='post event time [s]',
            group='display range',
            value=10,
            limit=(0, 86400),
            digits=1,
            tool_tip=
            'The length of the time window to show after the event end.')
        self.pref_manager.add_item(pagename='Display', item=item)

        item = psy_pm.CheckBoxPrefItem(
            name='show_event_limits',
            label='show event limits',
            value=True,
            hooks={'on_value_change': self.on_show_event_limits_changed},
            tool_tip='Show the limits of the selected event in the views.')
        self.pref_manager.add_item(pagename='Display', item=item)
Exemplo n.º 9
0
    def create_component_selector_preferences(self):
        ''' Create the preference items of the component selection section.

        '''
        components_page = self.pref_manager.add_page('components')
        comp_to_process_group = components_page.add_group(
            'components to process')
        process_time_span_group = components_page.add_group(
            'process time span')

        item = psy_pm.DateTimeEditPrefItem(
            name='start_time',
            label='start time',
            value=UTCDateTime('2015-01-01T00:00:00'),
            tool_tip=
            'The start time of the selection time span (UTCDateTime string format YYYY-MM-DDTHH:MM:SS).'
        )
        process_time_span_group.add_item(item)

        item = psy_pm.DateTimeEditPrefItem(
            name='end_time',
            label='end time',
            value=UTCDateTime('2015-01-01T00:00:00'),
            tool_tip=
            'The end time of the selection time span (UTCDateTime string format YYYY-MM-DDTHH:MM:SS).'
        )
        process_time_span_group.add_item(item)

        item = psy_pm.SingleChoicePrefItem(
            name='window_mode',
            label='window mode',
            limit=('free', 'daily', 'weekly', 'monthly'),
            value='free',
            hooks={'on_value_change': self.on_window_mode_selected},
            tool_tip='The mode of the window computation.')
        process_time_span_group.add_item(item)

        item = psy_pm.IntegerSpinPrefItem(
            name='window_length',
            label='window length [s]',
            value=300,
            limit=[0, 1209600],
            tool_tip='The sliding window length in seconds.')
        process_time_span_group.add_item(item)

        # The stations to process.
        item = psy_pm.MultiChoicePrefItem(
            name='stations',
            label='stations',
            limit=(),
            value=[],
            tool_tip='The stations which should be used for the processing.')
        comp_to_process_group.add_item(item)

        # The channels to process.
        item = psy_pm.MultiChoicePrefItem(
            name='channels',
            label='channels',
            limit=(),
            value=[],
            tool_tip='The channels which should be used for the processing.')
        comp_to_process_group.add_item(item)
Exemplo n.º 10
0
    def __init__(self, **args):
        CollectionNode.__init__(self, **args)

        # Setup the pages of the preference manager.
        self.pref_manager.add_page('General')
        self.pref_manager.add_page('STA/LTA')
        self.pref_manager.add_page('Processing')

        # The start_time.
        item = psy_pm.DateTimeEditPrefItem(name = 'start_time',
                                           label = 'start time',
                                           group = 'detection time span',
                                           value = UTCDateTime('2015-01-01T00:00:00'),
                                           tool_tip = 'The start time of the detection time span (UTCDateTime string format YYYY-MM-DDTHH:MM:SS).')
        self.pref_manager.add_item(pagename = 'General',
                                   item = item)

        # The end time.
        item = psy_pm.DateTimeEditPrefItem(name = 'end_time',
                                           label = 'end time',
                                           group = 'detection time span',
                                           value = UTCDateTime('2015-01-01T00:00:00'),
                                           tool_tip = 'The end time of the detection time span (UTCDateTime string format YYYY-MM-DDTHH:MM:SS).')
        self.pref_manager.add_item(pagename = 'General',
                                   item = item)

        # The stations to process.
        item = psy_pm.MultiChoicePrefItem(name = 'stations',
                                          label = 'stations',
                                          group = 'components to process',
                                          limit = ('value 1', 'value 2', 'value 3', 'value 4', 'value 5'),
                                          value = [],
                                          tool_tip = 'The stations which should be used for the detection.')
        self.pref_manager.add_item(pagename = 'General',
                                   item = item)

        # The channels to process.
        item = psy_pm.MultiChoicePrefItem(name = 'channels',
                                          label = 'channels',
                                          group = 'components to process',
                                          limit = ('value 1', 'value 2', 'value 3', 'value 4', 'value 5'),
                                          value = [],
                                          tool_tip = 'The channels which should be used for the detection.')
        self.pref_manager.add_item(pagename = 'General',
                                   item = item)

        # The STA/LTA parameters
        item = psy_pm.SingleChoicePrefItem(name = 'cf_type',
                                           label = 'characteristic function',
                                           group = 'detection',
                                           limit = ('abs', 'square'),
                                           value = 'square',
                                           tool_tip = 'The type of the characteristic function used to compute the STA and LTA.')
        self.pref_manager.add_item(pagename = 'STA/LTA',
                                   item = item)

        item = psy_pm.FloatSpinPrefItem(name = 'sta_len',
                                        label = 'STA length [s]',
                                        group = 'detection',
                                        value = 1,
                                        limit = (0, 1000),
                                        digits = 1,
                                        tool_tip = 'The length of the STA in seconds.')
        self.pref_manager.add_item(pagename = 'STA/LTA',
                                   item = item)

        item = psy_pm.FloatSpinPrefItem(name = 'lta_len',
                                        label = 'LTA length [s]',
                                        group = 'detection',
                                        value = 10,
                                        limit = (0, 1000),
                                        digits = 1,
                                        tool_tip = 'The length of the LTA in seconds.')
        self.pref_manager.add_item(pagename = 'STA/LTA',
                                   item = item)

        item = psy_pm.FloatSpinPrefItem(name = 'thr',
                                        label = 'threshold',
                                        group = 'detection',
                                        value = 3,
                                        limit = (0, 1000),
                                        digits = 1,
                                        tool_tip = 'The threshold of STA/LTA when to trigger an event.')
        self.pref_manager.add_item(pagename = 'STA/LTA',
                                   item = item)

        item = psy_pm.FloatSpinPrefItem(name = 'pre_et',
                                        label = 'pre-event time [s]',
                                        group = 'detection',
                                        value = 1,
                                        limit = (0, 1000),
                                        digits = 1,
                                        tool_tip = 'The time window to add before the detected event start [s].')
        self.pref_manager.add_item(pagename = 'STA/LTA',
                                   item = item)

        item = psy_pm.FloatSpinPrefItem(name = 'post_et',
                                        label = 'post-event time [s]',
                                        group = 'detection',
                                        value = 1,
                                        limit = (0, 1000),
                                        digits = 1,
                                        tool_tip = 'The time window to add after the detected event end [s].')
        self.pref_manager.add_item(pagename = 'STA/LTA',
                                   item = item)

        item = psy_pm.CustomPrefItem(name = 'processing_stack',
                                     label = 'processing stack',
                                     group = 'signal processing',
                                     value = None,
                                     gui_class = PStackEditField,
                                     tool_tip = 'Edit the processing stack nodes.')
        self.pref_manager.add_item(pagename = 'Processing',
                                   item = item)