def create_input_preferences(self):
        ''' Create the input preferences.
        '''
        input_page = self.pref_manager.add_page('Input/Output')
        rd_group = input_page.add_group('report data')
        rr_group = input_page.add_group('report results')

        # The report data directory.
        item = psy_pm.DirBrowsePrefItem(
            name='report_data_dir',
            label='report data directory',
            value='',
            tool_tip='The directory holding the quarry blast report data.')
        rd_group.add_item(item)

        # The quarry blast information file.
        item = psy_pm.FileBrowsePrefItem(
            name='blast_file',
            label='blast file',
            value='',
            filemask='json (*.json)|*.json',
            tool_tip=
            'The quarry blast information file created with the quarry blast validation collection node.'
        )
        rd_group.add_item(item)

        # The report results directory.
        item = psy_pm.DirBrowsePrefItem(
            name='report_results_dir',
            label='report results directory',
            value='',
            tool_tip='The directory where to save the report result files.')
        rr_group.add_item(item)
    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)
Beispiel #3
0
    def __init__(self):
        ''' Initialize the instance.

        '''
        psysmon.core.plugins.CommandPlugin.__init__(
            self,
            name='export result',
            category='localize',
            tags=['export', 'localization result'])

        # 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.export_icon_16

        # Add the plugin preferences.
        item = preferences_manager.DirBrowsePrefItem(
            name='output_dir',
            label='output directory',
            value='',
            tool_tip='Specify a directory where the PSD data files are located.'
        )
        self.pref_manager.add_item(item=item)
Beispiel #4
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)
Beispiel #5
0
    def __init__(self):
        ''' Initialize the instance.

        '''
        plugins.CommandPlugin.__init__(self,
                                       name = 'export',
                                       category = 'export',
                                       tags = ['export']
                                       )

        # 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.iconsBlack16.export_icon_16


        # Add the plugin preferences.
        item = preferences_manager.SingleChoicePrefItem(name = 'source',
                                                        label = 'source',
                                                        value = 'visible',
                                                        limit = ['original', 'visible'],
                                                        tool_tip = 'The data to export.')
        self.pref_manager.add_item(item = item)

        obspy_export_formats = ['GSE2', 'MSEED', 'PICKLE', 'Q',
                                'SAC', 'SACXY', 'SEGY', 'SH_ASC', 'SLIST',
                                'SU', 'TSPAIR']
        self.export_format_ext = {'GSE2' : 'gse2',
                                  'MSEED' : 'msd',
                                  'PICKLE' : 'pkl',
                                  'Q' : 'q',
                                  'SAC' : 'sac',
                                  'SACYX' : 'sacyx',
                                  'SEGY' : 'segy',
                                  'SH_ASC' : 'asc',
                                  'SLIST' : 'asc',
                                  'SU' : 'su',
                                  'TSPAIR' : 'asc'}
        item = preferences_manager.SingleChoicePrefItem(name = 'export_format',
                                                        label = 'export format',
                                                        value = 'TSPAIR',
                                                        limit = obspy_export_formats,
                                                        tool_tip = 'The available export file formats. See the obspy documentation for further details on specific formats.')
        self.pref_manager.add_item(item = item)


        item = preferences_manager.DirBrowsePrefItem(name = 'export_dir',
                                                     label = 'export directory',
                                                     value = '',
                                                     tool_tip = 'The directory where to save the exported files.')
        self.pref_manager.add_item(item = item)
    def create_output_prefs(self):
        ''' Create the output preference items.
        '''
        out_page = self.pref_manager.add_page('output')
        out_group = out_page.add_group('output')

        item = psy_pm.DirBrowsePrefItem(
            name='output_dir',
            label='output directory',
            value='',
            tool_tip='Specify a directory where to save the MiniSeed files.')
        out_group.add_item(item)
Beispiel #7
0
    def create_output_preferences(self):
        ''' Create the output preferences.
        '''
        input_page = self.pref_manager.add_page('Output')
        res_group = input_page.add_group('result')

        # The quarry blast information file.
        item = psy_pm.DirBrowsePrefItem(name = 'result_dir',
                                         label = 'result directory',
                                         value = '',
                                         tool_tip = 'The directory where to store the result file.')
        res_group.add_item(item)
Beispiel #8
0
    def create_output_prefs(self):
        ''' Create the output preference items.
        '''
        pagename = '4 output'
        self.pref_manager.add_page(pagename)

        item = psy_pm.DirBrowsePrefItem(
            name='output_dir',
            label='output directory',
            group='output',
            value='',
            tool_tip='Specify a directory where to save the PPSD files.')
        self.pref_manager.add_item(pagename=pagename, item=item)
    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)
    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)
Beispiel #11
0
    def create_output_preferences(self):
        ''' Create the preference items of the output section.

        '''
        output_page = self.pref_manager.add_page('output')
        output_group = output_page.add_group('output')

        item = psy_pm.DirBrowsePrefItem(
            name='output_dir',
            label='output directory',
            value='',
            tool_tip='Specify a directory where to save the processing results.'
        )
        output_group.add_item(item)
Beispiel #12
0
    def __init__(self, **args):
        CollectionNode.__init__(self, **args)

        pref_item = pref_manager.TextEditPrefItem(name='filter_name',
                                                  label='filter name',
                                                  value='test filter')
        self.pref_manager.add_item(item=pref_item)

        pref_item = pref_manager.DirBrowsePrefItem(name='directory_browse',
                                                   label='browse',
                                                   value='',
                                                   start_directory='/home')
        self.pref_manager.add_item(item=pref_item)

        pref_item = pref_manager.FloatSpinPrefItem(name='filter_cutoff',
                                                   label='filter cutoff',
                                                   value='4.5')
        self.pref_manager.add_item(item=pref_item)
    def create_output_preferences(self):
        ''' Create the preference items of the output section.

        '''
        output_page = self.pref_manager.add_page('output')
        output_group = output_page.add_group('output')

        item = psy_pm.DirBrowsePrefItem(name = 'output_dir',
                                        label = 'output directory',
                                        value = '',
                                        tool_tip = 'Specify a directory where to save the processing results.'
                                       )
        output_group.add_item(item)

        item = psy_pm.SingleChoicePrefItem(name = 'output_interval',
                                          label = 'output interval',
                                          limit = ('hour', 'day', 'week', 'month', 'whole'),
                                          value = 'day',
                                          tool_tip = 'The interval for which the output should be grouped.')
        output_group.add_item(item)
Beispiel #14
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)
Beispiel #15
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)
    def create_output_prefs(self):
        ''' Create the output preferences.
        '''
        output_page = self.pref_manager.add_page('output')
        files_group = output_page.add_group('files')

        # The output folder.
        item = psy_pm.DirBrowsePrefItem(
            name='output_dir',
            label='output directory',
            value='',
            tool_tip='The directory where the resulting files are saved.')
        files_group.add_item(item=item)

        # The file prefix.
        item = psy_pm.TextEditPrefItem(
            name='prefix',
            label='prefix',
            value='',
            tool_tip='The string prepended to the filename.')
        files_group.add_item(item=item)
Beispiel #17
0
    def create_output_prefs(self):
        ''' Create the output preference items.
        '''
        pagename = '3 output'
        self.pref_manager.add_page(pagename)

        item = psy_pm.DirBrowsePrefItem(name = 'output_dir',
                                        label = 'output directory',
                                        group = 'output',
                                        value = '',
                                        tool_tip = 'Specify a directory where to save the PSD images.'
                                       )
        self.pref_manager.add_item(pagename = pagename,
                                   item = item)

        item = psy_pm.CheckBoxPrefItem(name = 'with_average_plot',
                                       label = 'with average plot',
                                       group = 'output',
                                       value = False,
                                       tool_tip = 'Add the temporal average with noise models to the PSD plot.')
        self.pref_manager.add_item(pagename = pagename,
                                   item = item)
Beispiel #18
0
    def create_output_preferences(self):
        ''' Create the preference items of the output section.

        '''
        self.pref_manager.add_page('output')

        item = psy_pm.DirBrowsePrefItem(
            name='output_dir',
            label='output directory',
            group='output',
            value='',
            tool_tip='Specify a directory where to save the processing results.'
        )
        self.pref_manager.add_item(pagename='output', item=item)

        item = psy_pm.SingleChoicePrefItem(
            name='output_interval',
            label='output interval',
            group='output',
            limit=('daily', 'weekly', 'monthly'),
            value='monthly',
            tool_tip='The interval for which to save the results.')
        self.pref_manager.add_item(pagename='output', item=item)