예제 #1
0
    def __init__(self):
        ''' The constructor.

        '''
        InteractivePlugin.__init__(self,
                                   name = 'zoom',
                                   category = 'view',
                                   tags = None
                                  )
        # Create the logging logger instance.
        loggerName = __name__ + "." + self.__class__.__name__
        self.logger = logging.getLogger(loggerName)

        self.icons['active'] = icons.zoom_icon_16
        self.cursor = wx.CURSOR_MAGNIFIER
        #self.cursor = icons.zoom_icon_16
        #self.cursor_hotspot = (0.5, 0.5)

        self.bg = {}
        self.startTime = None
        self.endTime = None

        # Add the plugin preferences.
        pref_page = self.pref_manager.add_page('Preferences')
        resp_group = pref_page.add_group('response')

        item = preferences_manager.IntegerSpinPrefItem(name = 'zoom ratio',
                                                       value = 20,
                                                       limit = (1, 99))
        resp_group.add_item(item)
예제 #2
0
    def create_parameters_prefs(self):
        ''' Create the preference items of the parameters section.
        '''
        pagename = '2 parameters'
        self.pref_manager.add_page(pagename)

        pref_item = psy_pm.FloatSpinPrefItem(
            name='ppsd_length',
            label='ppsd length [s]',
            group='PPSD',
            value=3600,
            limit=[0, 1e10],
            increment=1,
            digits=3,
            tool_tip='Length of data segments passed to psd [s].')
        self.pref_manager.add_item(pagename=pagename, item=pref_item)

        pref_item = psy_pm.IntegerSpinPrefItem(
            name='ppsd_overlap',
            label='ppsd overlap [%]',
            group='PPSD',
            value=50,
            limit=[0, 99],
            tool_tip='Overlap of segments passed to psd [%].')
        self.pref_manager.add_item(pagename=pagename, item=pref_item)

        pref_item = psy_pm.SingleChoicePrefItem(
            name='plot_interval',
            label='plot interval',
            group='PPSD',
            limit=('day', 'week', 'complete'),
            value='week',
            tool_tip='The length of the PPSD plots.')
        self.pref_manager.add_item(pagename=pagename, item=pref_item)
예제 #3
0
    def create_general_prefs(self):
        ''' Create the general preference items.

        '''
        general_page = self.pref_manager.add_page('General')
        id_group = general_page.add_group('identification')

        # The station nearest to the quarry site.
        item = psy_pm.MultiChoicePrefItem(name = 'nearest_station',
                                          label = 'nearest station',
                                          limit = (),
                                          value = [],
                                          tool_tip = 'The stations nearest to the quarry.')
        id_group.add_item(item)

        # The minimum number of stations with detections.
        item = psy_pm.IntegerSpinPrefItem(name = 'n_stations',
                                          label = 'num. stations',
                                          value = 3,
                                          limit = (1, 1000000),
                                          tool_tip = 'The minimum number of stations with detections.')
        id_group.add_item(item)

        # The ground velocity threshold.
        item = psy_pm.FloatSpinPrefItem(name = 'vel_threshold',
                                        label = 'vel. threshold',
                                        value = 0.1,
                                        limit = (0, 1000000),
                                        digits = 2,
                                        tool_tip = 'The minimum velocity amplitude in mm/s.')
        id_group.add_item(item)
예제 #4
0
    def create_parameters_prefs(self):
        ''' Create the preference items of the parameters section.
        '''
        pagename = '2 parameters'
        self.pref_manager.add_page(pagename)

        self.pref_manager.add_page(pagename)

        item = psy_pm.DirBrowsePrefItem(name = 'data_dir',
                                        label = 'psd data directory',
                                        group = 'parameters',
                                        value = '',
                                        tool_tip = 'Specify a directory where the PSD data files are located.'
                                       )
        self.pref_manager.add_item(pagename = pagename,
                                   item = item)


        pref_item = psy_pm.IntegerSpinPrefItem(name = 'plot_length',
                                             label = 'plot length [days]',
                                             group = 'parameters',
                                             value = 7,
                                             limit = [1, 365],
                                             tool_tip = 'The length of PSD plots [days].'
                                             )
        self.pref_manager.add_item(pagename = pagename,
                                   item = pref_item)
예제 #5
0
    def create_parameters_prefs(self):
        ''' Create the preference items of the parameters section.
        '''
        pagename = '2 parameters'
        self.pref_manager.add_page(pagename)

        pref_item = psy_pm.FloatSpinPrefItem(name = 'window_length',
                                             label = 'window length [s]',
                                             group = 'FFT',
                                             value = 300,
                                             limit = [0, 1e10],
                                             increment = 1,
                                             digits = 3,
                                             tool_tip = 'The length of the computation window [s].'
                                             )
        self.pref_manager.add_item(pagename = pagename,
                                   item = pref_item)

        pref_item = psy_pm.IntegerSpinPrefItem(name = 'window_overlap',
                                             label = 'window overlap [%]',
                                             group = 'FFT',
                                             value = 50,
                                             limit = [0, 99],
                                             tool_tip = 'The overlap of the computation windows [%].'
                                             )
        self.pref_manager.add_item(pagename = pagename,
                                   item = pref_item)

        pref_item = psy_pm.IntegerSpinPrefItem(name = 'psd_nfft',
                                             label = 'nfft',
                                             group = 'FFT',
                                             value = 8192,
                                             limit = [0, 1000000],
                                             tool_tip = 'The length of the fft window [samples].'
                                             )
        self.pref_manager.add_item(pagename = pagename,
                                   item = pref_item)

        pref_item = psy_pm.IntegerSpinPrefItem(name = 'psd_overlap',
                                             label = 'fft overlap [%]',
                                             group = 'FFT',
                                             value = 50,
                                             limit = [0, 99],
                                             tool_tip = 'The overlap of the fft windows [%].'
                                             )
        self.pref_manager.add_item(pagename = pagename,
                                   item = pref_item)
예제 #6
0
    def create_parameters_prefs(self):
        ''' Create the preference items of the parameters section.
        '''
        par_page = self.pref_manager.add_page('parameters')
        psd_group = par_page.add_group('fft')

        pref_item = psy_pm.IntegerSpinPrefItem(name = 'psd_nfft',
                                             label = 'nfft',
                                             value = 8192,
                                             limit = [0, 1000000],
                                             tool_tip = 'The length of the fft window [samples].'
                                             )
        psd_group.add_item(pref_item)

        pref_item = psy_pm.IntegerSpinPrefItem(name = 'psd_overlap',
                                             label = 'fft overlap [%]',
                                             value = 50,
                                             limit = [0, 99],
                                             tool_tip = 'The overlap of the fft windows [%].'
                                             )
        psd_group.add_item(pref_item)
예제 #7
0
    def create_preferences(self):
        ''' Create the psysmon preferences items.
        '''
        logging_page = self.pref_manager.add_page('logging')
        log_levels_group = logging_page.add_group('log levels')
        status_group = logging_page.add_group('status')

        # The log levels group items.
        pref_item = pm.SingleChoicePrefItem(
            name='main_loglevel',
            label='main log level',
            limit=('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'),
            value='INFO',
            tool_tip='The level of the main logger.')
        log_levels_group.add_item(item=pref_item)

        pref_item = pm.SingleChoicePrefItem(
            name='shell_loglevel',
            label='shell log level',
            limit=('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'),
            value='INFO',
            tool_tip='The level of the logger writing to the shell.')
        log_levels_group.add_item(item=pref_item)

        pref_item = pm.SingleChoicePrefItem(
            name='gui_status_loglevel',
            label='status log level',
            limit=('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'),
            value='INFO',
            tool_tip=
            'The level of the logger writing to the psysmon status logging area.'
        )
        log_levels_group.add_item(item=pref_item)

        pref_item = pm.SingleChoicePrefItem(
            name='collection_loglevel',
            label='collection log level',
            limit=('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'),
            value='INFO',
            tool_tip=
            'The level of the logger writing to a log file when executing a collection.'
        )
        log_levels_group.add_item(item=pref_item)

        # The status group items.
        pref_item = pm.IntegerSpinPrefItem(
            name='n_status_messages',
            label='# status messages',
            limit=(10, 1000),
            value=100,
            tool_tip='The number of messages to show in the log area status.')
        status_group.add_item(item=pref_item)
예제 #8
0
    def __init__(self):
        ''' Initialize the instance.

        '''
        psysmon.core.plugins.CommandPlugin.__init__(
            self,
            name='circle method',
            category='localize',
            tags=['localize', 'circle'])

        # 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'] = psysmon.artwork.icons.iconsBlack16.localize_graphical_icon_16

        # Add the plugin preferences.
        pref_page = self.pref_manager.add_page('Preferences')
        ps_group = pref_page.add_group('phase selection')
        vm_group = pref_page.add_group('velocity model')

        item = psysmon.core.preferences_manager.MultiChoicePrefItem(
            name='p_phases',
            label='P phases',
            value=[],
            limit=[],
            tool_tip='Select the P phases to use for the localization.')
        ps_group.add_item(item)

        item = psysmon.core.preferences_manager.MultiChoicePrefItem(
            name='s_phases',
            label='S phases',
            value=[],
            limit=[],
            tool_tip='Select the S phases to use for the localization.')
        ps_group.add_item(item)

        item = preferences_manager.IntegerSpinPrefItem(
            name='p_velocity',
            label='P velocity [m/s]',
            value=5000,
            limit=(1, 100000),
            tool_tip='The P-wave velocity in m/s.')
        vm_group.add_item(item)

        # The plotted circles.
        self.circles = []
예제 #9
0
    def create_parameters_prefs(self):
        ''' Create the preference items of the parameters section.
        '''
        par_page = self.pref_manager.add_page('plot parameters')
        plot_group = par_page.add_group('plot')

        pref_item = psy_pm.IntegerSpinPrefItem(
            name='plot_length',
            label='plot length [days]',
            value=7,
            limit=[1, 365],
            tool_tip='The length of PSD plots [days].')
        plot_group.add_item(pref_item)

        pref_item = psy_pm.CheckBoxPrefItem(
            name='with_average_plot',
            label='with average plot',
            value=False,
            tool_tip=
            'Add the temporal average with noise models to the PSD plot.')
        plot_group.add_item(pref_item)

        pref_item = psy_pm.FloatSpinPrefItem(
            name='lower_frequ',
            label='lower frequency [Hz]',
            value=0.1,
            limit=[1e-6, 1e9],
            tool_tip='The lower frequency limit of the plot.')
        plot_group.add_item(pref_item)

        pref_item = psy_pm.CheckBoxPrefItem(
            name='use_upper_frequ',
            label='use upper frequency',
            value=False,
            tool_tip=
            'Use the upper frequency value to set the upper frequency limit of the plot.',
            hooks={'on_value_change': self.on_use_upper_frequ_changed})
        plot_group.add_item(pref_item)

        pref_item = psy_pm.FloatSpinPrefItem(
            name='upper_frequ',
            label='upper frequency [Hz]',
            value=100,
            limit=[1e-6, 1e9],
            tool_tip='The upper frequency limit of the plot.')
        plot_group.add_item(pref_item)
예제 #10
0
    def create_output_prefs(self):
        ''' Create the output preference items.
        '''
        out_page = self.pref_manager.add_page('output')
        folder_group = out_page.add_group('folder')
        img_group = out_page.add_group('image')

        item = psy_pm.DirBrowsePrefItem(
            name='output_dir',
            label='output directory',
            value='',
            tool_tip='Specify a directory where to save the PPSD files.')
        folder_group.add_item(item)

        item = psy_pm.FloatSpinPrefItem(
            name='img_width',
            label='width [cm]',
            value=16.,
            increment=1,
            digits=1,
            limit=[1, 1000],
            tool_tip='The width of the PPSD image in cm.')
        img_group.add_item(item)

        item = psy_pm.FloatSpinPrefItem(
            name='img_height',
            label='height [cm]',
            value=12.,
            increment=1,
            digits=1,
            limit=[1, 1000],
            tool_tip='The height of the PPSD image in cm.')
        img_group.add_item(item)

        item = psy_pm.IntegerSpinPrefItem(
            name='img_resolution',
            label='resolution [dpi]',
            value=300.,
            limit=[1, 10000],
            tool_tip='The resolution of the PPSD image in dpi.')
        img_group.add_item(item)
예제 #11
0
    def create_processing_preferences(self):
        ''' Create the preference items of the processing stack section.
        '''
        ps_page = self.pref_manager.add_page('processing')
        ch_group = ps_page.add_group('chunked')

        item = psy_pm.CheckBoxPrefItem(
            name='process_chunked',
            label='use chunked processing',
            value=False,
            tool_tip=
            'For large time windows splitting the time window into smaller chunks is more memory efficient. Not all looper child nodes support chunked processing.'
        )
        ch_group.add_item(item)

        item = psy_pm.IntegerSpinPrefItem(
            name='chunk_win_length',
            label='chunk window length [s]',
            value=3600,
            limit=[0, 1209600],
            tool_tip='The length of the chunked window.')
        ch_group.add_item(item)
예제 #12
0
    def create_parameters_prefs(self):
        ''' Create the preference items of the parameters section.
        '''
        par_page = self.pref_manager.add_page('parameters')
        ppsd_group = par_page.add_group('ppsd')

        pref_item = psy_pm.FloatSpinPrefItem(
            name='ppsd_length',
            label='ppsd length [s]',
            value=3600,
            limit=[0, 1e10],
            increment=1,
            digits=3,
            tool_tip='Length of data segments passed to psd [s].')
        ppsd_group.add_item(pref_item)

        pref_item = psy_pm.IntegerSpinPrefItem(
            name='ppsd_overlap',
            label='ppsd overlap [%]',
            value=50,
            limit=[0, 99],
            tool_tip='Overlap of segments passed to psd [%].')
        ppsd_group.add_item(pref_item)
예제 #13
0
    def __init__(self):
        ''' Initialize the instance.

        '''
        plugins.CommandPlugin.__init__(self,
                                       name='graphical localization',
                                       category='localize',
                                       tags=[
                                           'localize', 'circle', 'hyperble',
                                           'tdoa', 'time difference of arrival'
                                       ])

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

        self.icons['active'] = icons.iconsBlack16.localize_graphical_icon_16

        # Add the plugin preferences.
        item = preferences_manager.IntegerSpinPrefItem(name='zoom ratio',
                                                       value=20,
                                                       limit=(1, 99))
        self.pref_manager.add_item(item=item)
예제 #14
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)
예제 #15
0
    def create_preferences(self):
        ''' Create the collection node preferences.
        '''
        pref_page = self.pref_manager.add_page('Preferences')
        cat_group = pref_page.add_group('catalog')
        bind_group = pref_page.add_group('binding')

        # The detection catalog to process.
        item = preferences_manager.SingleChoicePrefItem(
            name='detection_catalog',
            label='detection catalog',
            limit=[],
            value=None,
            tool_tip='The detection catalog to use for binding.')
        cat_group.add_item(item)

        # The event catalog to which to write the new events.
        item = preferences_manager.SingleChoicePrefItem(
            name='event_catalog',
            label='event catalog',
            limit=[],
            value=None,
            tool_tip='The event catalog for new events.')
        cat_group.add_item(item)

        # The minimum length of the detecions used for binding.
        item = preferences_manager.FloatSpinPrefItem(
            name='min_detection_length',
            label='min. detection length',
            value=0.1,
            limit=(0, 1000000),
            tool_tip=
            'The minimum length of the detections used for the binding [s].')
        bind_group.add_item(item)

        # The number of nearest neighbors used for searching neighboring
        # detections.
        item = preferences_manager.IntegerSpinPrefItem(
            name='n_neighbors',
            label='neighbors to search',
            value=2,
            limit=(0, 100),
            tool_tip=
            'The number of nearest neighbors used to search for corresponding detections.'
        )
        bind_group.add_item(item)

        # The minimum number of matching neighbors needed to declare an event.
        item = preferences_manager.IntegerSpinPrefItem(
            name='min_match_neighbors',
            label='match neighbors',
            value=2,
            limit=(0, 100),
            tool_tip=
            'The minimum number of matching neighbors needed to declare an event.'
        )
        bind_group.add_item(item)

        # The velocity used for search window computation.
        item = preferences_manager.IntegerSpinPrefItem(
            name='search_win_vel',
            label='search window velocity',
            value=1000,
            limit=(1, 100000),
            tool_tip=
            'The velocity used to compute the search window lengths [m/s].')
        bind_group.add_item(item)

        # The lenght of the search window extension.
        item = preferences_manager.FloatSpinPrefItem(
            name='search_win_extend',
            label='search window extend',
            value=0.1,
            limit=(0, 100000),
            tool_tip=
            'The lenght of the time window added to the search windwo [s].')
        bind_group.add_item(item)