Example #1
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)
Example #2
0
 def create_processing_preferences(self):
     ''' Create the processing preferences.
     '''
     proc_page = self.pref_manager.add_page('Processing')
     ps_group = proc_page.add_group('processing stack')
     item = psy_pm.CustomPrefItem(name = 'processing_stack',
                                  label = 'processing stack',
                                  value = None,
                                  gui_class = PStackEditField,
                                  tool_tip = 'Edit the processing stack nodes.')
     ps_group.add_item(item)
Example #3
0
    def create_processing_stack_preferences(self):
        ''' Create the preference items of the processing stack section.
        '''
        self.pref_manager.add_page('processing stack')

        item = psy_pm.CustomPrefItem(
            name='processing_stack',
            label='processing stack',
            group='event processing',
            value=None,
            gui_class=PStackEditField,
            tool_tip='Edit the processing stack nodes.')
        self.pref_manager.add_item(pagename='processing stack', item=item)
Example #4
0
    def create_processing_prefs(self):
        ''' Create the processing preference items.
        '''
        pagename = '3 processing'
        self.pref_manager.add_page(pagename)

        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 = pagename,
                                   item = item)
Example #5
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)