Ejemplo 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)
Ejemplo n.º 2
0
    def __init__(self, **args):
        psysmon.core.packageNodes.CollectionNode.__init__(self, **args)

        select_page = self.pref_manager.add_page('Select')
        source_group = select_page.add_group('source')

        # The waveclient to work with.
        item = psy_pm.SingleChoicePrefItem(
            name='waveclient',
            label='waveclient',
            limit=(),
            value='',
            tool_tip='The available database waveclients.',
            hooks={'on_value_change': self.on_waveclient_selected})
        source_group.add_item(item)

        # The waveform directories of the waveclient.
        column_labels = [
            'db_id', 'waveclient', 'waveform dir', 'alias', 'description',
            'data file extension', 'first import', 'last scan'
        ]
        item = psy_pm.ListCtrlEditPrefItem(
            name='wf_dir',
            label='waveform directory',
            value=[],
            column_labels=column_labels,
            limit=[],
            tool_tip='The available waveform directories.',
            hooks={'on_value_change': self.on_wf_dir_selected})

        source_group.add_item(item)
Ejemplo 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)
Ejemplo n.º 4
0
    def __init__(self, **args):
        # Initialize the instance.
        psysmon.core.packageNodes.CollectionNode.__init__(self, **args)

        logger_prefix = psysmon.logConfig['package_prefix']
        loggerName = logger_prefix + "." + __name__ + "." + self.__class__.__name__
        self.logger = logging.getLogger(loggerName)
        
        select_page = self.pref_manager.add_page('Select')
        wfdir_group = select_page.add_group('waveform directory')
        import_group = select_page.add_group('import options')


        item = psy_pm.SingleChoicePrefItem(name = 'waveclient',
                                           label = 'waveclient',
                                           limit = (),
                                           value = '',
                                           tool_tip = 'The available database waveclients.',
                                           hooks = {'on_value_change': self.on_waveclient_selected})
        wfdir_group.add_item(item)


        column_labels = ['db_id', 'waveclient', 'waveform dir', 'alias', 'description',
                         'data file extension', 'first import', 'last scan']
        item = psy_pm.ListCtrlEditPrefItem(name = 'wf_dir',
                                           label = 'waveform directory',
                                           value = [],
                                           column_labels = column_labels,
                                           limit = [],
                                           tool_tip = 'The available waveform directories.',
                                           hooks = {'on_value_change': self.on_wf_dir_selected})
        wfdir_group.add_item(item)


        item = psy_pm.CheckBoxPrefItem(name = 'import_new_only',
                                       label = 'import new files only',
                                       value = True,
                                       tool_tip = 'Import only files not yet imported to the database. New files are detected based on the file name and file size. If unchecked all existing data associated with the selected waveform directory is deleted from the database before importing the new files in the waveform directory.')
        import_group.add_item(item)

        item = psy_pm.CheckBoxPrefItem(name = 'restrict_search_path',
                                       label = 'restrict search path',
                                       value = False,
                                       tool_tip = 'Restrict the search within the waveform directory to the directory specified below.')
        import_group.add_item(item)

        item = psy_pm.DirBrowsePrefItem(name = 'search_path',
                                        label = 'search path',
                                        value = '',
                                        tool_tip = 'The search path used to restrict the search.')
        import_group.add_item(item)
Ejemplo n.º 5
0
    def create_output_preferences(self):
        ''' Create the output preferences.
        '''
        output_page = self.pref_manager.add_page('Output')
        dest_group = output_page.add_group('destination')
        folder_group = output_page.add_group('folder')
        ds_group = output_page.add_group('data source')

        # The destination option.
        item = psy_pm.SingleChoicePrefItem(
            name='destination',
            label='destination',
            limit=('folder', 'data source'),
            value='folder',
            hooks={'on_value_change': self.on_destination_changed},
            tool_tip='The location where the exported data files will be saved.'
        )
        dest_group.add_item(item)

        # The destination folder.
        item = psy_pm.DirBrowsePrefItem(
            name='folder',
            value='',
            tool_tip='The folder where the data files will be saved.')
        folder_group.add_item(item)

        # The waveclient to work with.
        item = psy_pm.SingleChoicePrefItem(
            name='waveclient',
            label='waveclient',
            limit=(),
            value='',
            tool_tip='The available database waveclients.',
            hooks={'on_value_change': self.on_waveclient_selected})
        ds_group.add_item(item)

        # The waveform directories of the waveclient.
        column_labels = [
            'db_id', 'waveclient', 'waveform dir', 'alias', 'description',
            'data file extension', 'first import', 'last scan'
        ]
        item = psy_pm.ListCtrlEditPrefItem(
            name='wf_dir',
            label='waveform directory',
            value=[],
            column_labels=column_labels,
            limit=[],
            tool_tip='The available waveform directories.',
            hooks={'on_value_change': self.on_wf_dir_selected})

        ds_group.add_item(item)
Ejemplo n.º 6
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')

        # 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_to_process_group.add_item(pref_item)
Ejemplo n.º 7
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)
Ejemplo n.º 8
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)
Ejemplo n.º 9
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)