Esempio n. 1
0
    def loadWaveformChoices(self):
        """
        Fill the selectionTable with all SNCL-Event combinations selected in the MainWindow.
        This function is triggered whenever the "Get Waveforms" button in the MainWindow is clicked.
        """

        LOGGER.debug('Loading waveform choices...')

        self.resetDownload()

        self.waveforms_handler.create_waveforms(self.pyweed)

        # Add events to the eventComboBox -------------------------------

        self.eventComboBox.clear()

        self.eventComboBox.addItem('All events')
        for event in self.pyweed.iter_selected_events():
            self.eventComboBox.addItem(get_event_name(event))

        # Add networks/stations to the networkComboBox and stationsComboBox ---------------------------

        self.networkComboBox.clear()
        self.networkComboBox.addItem('All networks')

        self.stationComboBox.clear()
        self.stationComboBox.addItem('All stations')

        foundNetworks = set()
        foundStations = set()
        for (network, station,
             _channel) in self.pyweed.iter_selected_stations():
            if network.code not in foundNetworks:
                foundNetworks.add(network.code)
                self.networkComboBox.addItem(network.code)
            netstaCode = '.'.join((network.code, station.code))
            if netstaCode not in foundStations:
                foundStations.add(netstaCode)
                self.stationComboBox.addItem(netstaCode)

        self.loadSelectionTable()

        # Start downloading data
        self.downloadWaveformData()

        LOGGER.debug('Finished loading waveform choices')
Esempio n. 2
0
 def applyFilter(self, waveform):
     """
     Apply self.filters to the given waveform
     @return True iff the waveform should be included
     """
     # Get the values from the waveform to match against the filter value
     sncl_parts = waveform.sncl.split('.')
     net_code = sncl_parts[0]
     netsta_code = '.'.join(sncl_parts[:2])
     filter_values = {
         'event': get_event_name(waveform.event_ref()),
         'network': net_code,
         'station': netsta_code
     }
     for (fname, fval) in self.filters.items():
         if not fval.startswith('All') and fval != filter_values[fname]:
             return False
     return True
Esempio n. 3
0
 def applyFilter(self, waveform):
     """
     Apply self.filters to the given waveform
     @return True iff the waveform should be included
     """
     # Possibly hide rows with no data
     if waveform.error == NO_DATA_ERROR and self.hideNoDataCheckBox.isChecked():
         return False
     # Get the values from the waveform to match against the filter value
     sncl_parts = waveform.sncl.split('.')
     net_code = sncl_parts[0]
     netsta_code = '.'.join(sncl_parts[:2])
     filter_values = {
         'event': get_event_name(waveform.event_ref()),
         'network': net_code,
         'station': netsta_code
     }
     for (fname, fval) in self.filters.items():
         if not fval.startswith('All') and fval != filter_values[fname]:
             return False
     return True