[revision] cleaned up unclean code: tabs -> spaces

This commit is contained in:
Marcel Paffrath 2021-03-30 16:39:44 +02:00
parent f11ffc67ff
commit 07e7ef3efa
4 changed files with 19 additions and 19 deletions

View File

@ -1501,11 +1501,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 +1523,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 +3023,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 +3756,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 +3765,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.

View File

@ -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)

View File

@ -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

View File

@ -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,