diff --git a/PyLoT.py b/PyLoT.py index f02fd377..c9e67b9c 100755 --- a/PyLoT.py +++ b/PyLoT.py @@ -470,7 +470,8 @@ class MainWindow(QMainWindow): icon=qualities_icon, tip='Histogram of pick qualities') self.qualities_action.setEnabled(False) # MP MP not yet implemented, therefore hide: - self.qualities_action.setVisible(False) + # LK will be implemented soon, basic script has already (03/2021) been finished + self.qualities_action.setVisible(True) printAction = self.createAction(self, "&Print event ...", self.show_event_information, QKeySequence.Print, @@ -1501,11 +1502,11 @@ class MainWindow(QMainWindow): :param outformats: str/list of output formats :return: ''' - if not event: + if not event: event = self.get_current_event() if not type(outformats) == list: outformats = [outformats] - def getSavePath(event, directory, outformats): + def getSavePath(event, directory, outformats): if not directory: title = 'Save event data as {} to directory ...'.format(outformats) directory = QFileDialog.getExistingDirectory(self, @@ -1523,8 +1524,8 @@ class MainWindow(QMainWindow): uppererrorP = self._inputs['timeerrorsP'] uppererrorS = self._inputs['timeerrorsS'] - # Inserted to prevent Bug in Eventlist - self.get_data().setEvtData(event) + # Inserted to prevent Bug in Eventlist + self.get_data().setEvtData(event) try: self.get_data().applyEVTData(event, typ='event') # getPicks()) except OverwriteError: @@ -3023,7 +3024,7 @@ class MainWindow(QMainWindow): outfile = parameter['outpatter'] eventname = self.get_current_event_name() obsdir = os.path.join(self._inputs['rootpath'], self._inputs['datapath'], self._inputs['database'], eventname) - self.saveData(event=self.get_current_event(), directory=obsdir, outformats='.obs') + self.saveData(event=self.get_current_event(), directory=obsdir, outformats='.obs') filename = 'PyLoT_' + eventname locpath = os.path.join(locroot, 'loc', filename) phasefile = os.path.join(obsdir, filename + '.obs') @@ -3756,7 +3757,7 @@ class Project(object): self.search_eventfile_info() def remove_event(self, event): - self.eventlist.remove(event) + self.eventlist.remove(event) def remove_event_by_id(self, eventID): for event in self.eventlist: @@ -3765,7 +3766,7 @@ class Project(object): break def read_eventfile_info(self, filename, separator=','): - ''' + ''' Try to read event information from file (:param:filename) comparing specific event datetimes. File structure (each row): event, date, time, magnitude, latitude, longitude, depth separated by :param:separator each. diff --git a/pylot/core/analysis/magnitude.py b/pylot/core/analysis/magnitude.py index dc5204ed..40e98a48 100644 --- a/pylot/core/analysis/magnitude.py +++ b/pylot/core/analysis/magnitude.py @@ -221,15 +221,15 @@ class LocalMagnitude(Magnitude): power = [np.power(tr.data, 2) for tr in st if tr.stats.channel[-1] not in 'Z3'] - # checking horizontal count and calculating power_sum accordingly - if len(power) == 1: - print ('WARNING: Only one horizontal found for station {0}.'.format(st[0].stats.station)) - power_sum = power[0] - elif len(power) == 2: - power_sum = power[0] + power[1] - else: - raise ValueError('Wood-Anderson aomplitude defintion only valid for' - ' up to two horizontals: {0} given'.format(len(power))) + # checking horizontal count and calculating power_sum accordingly + if len(power) == 1: + print ('WARNING: Only one horizontal found for station {0}.'.format(st[0].stats.station)) + power_sum = power[0] + elif len(power) == 2: + power_sum = power[0] + power[1] + else: + raise ValueError('Wood-Anderson aomplitude defintion only valid for' + ' up to two horizontals: {0} given'.format(len(power))) sqH = np.sqrt(power_sum) diff --git a/pylot/core/io/data.py b/pylot/core/io/data.py index e497783b..87434a3c 100644 --- a/pylot/core/io/data.py +++ b/pylot/core/io/data.py @@ -275,7 +275,7 @@ class Data(object): # check for already existing xml-file if fnext == '.xml': if os.path.isfile(fnout + fnext): - print("xml-file already exists! Check content ...") + print("xml-file already exists! Check content ...") cat = read_events(fnout + fnext) if len(cat) > 1: raise IOError('Ambigious event information in file {}'.format(fnout + fnext)) @@ -287,7 +287,7 @@ class Data(object): return self.checkEvent(event, fcheck) self.setEvtData(event) - + self.get_evt_data().write(fnout + fnext, format=evtformat) # try exporting event diff --git a/pylot/core/io/phases.py b/pylot/core/io/phases.py index 30d26ffc..8442ed7f 100644 --- a/pylot/core/io/phases.py +++ b/pylot/core/io/phases.py @@ -805,7 +805,7 @@ def writephases(arrivals, fformat, filename, parameter=None, eventinfo=None): return stime = eventsource['time'] event = parameter.get('eventID') - hddID = event.split('.')[0][1:5] + hddID = event.split('.')[0][1:5] # write header fid.write('# %d %d %d %d %d %5.2f %7.4f +%6.4f %7.4f %4.2f 0.1 0.5 %4.2f %s\n' % ( stime.year, stime.month, stime.day, stime.hour, stime.minute, stime.second,