rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
print "Mouse wheel zooming activated" | msg = "Mouse wheel zooming activated" appendTextview(self.textviewStdOut, msg) | def switchWheelZoom(self,event): if event.key==self.dictKeybindings['switchWheelZoom']: self.flagWheelZoom=not self.flagWheelZoom if self.flagWheelZoom: print "Mouse wheel zooming activated" else: print "Mouse wheel zooming deactivated" |
print "Mouse wheel zooming deactivated" | msg = "Mouse wheel zooming deactivated" appendTextview(self.textviewStdOut, msg) | def switchWheelZoom(self,event): if event.key==self.dictKeybindings['switchWheelZoom']: self.flagWheelZoom=not self.flagWheelZoom if self.flagWheelZoom: print "Mouse wheel zooming activated" else: print "Mouse wheel zooming deactivated" |
print "Switching pan mode" | msg = "Switching pan mode" appendTextview(self.textviewStdOut, msg) | def switchPan(self,event): if event.key==self.dictKeybindings['switchPan']: self.fig.canvas.toolbar.pan() self.fig.canvas.widgetlock.release(self.fig.canvas.toolbar) self.redraw() print "Switching pan mode" |
print "Switching Phase button" | msg = "Switching Phase button" appendTextview(self.textviewStdOut, msg) | def switchPhase(self, event): if event.key==self.dictKeybindings['switchPhase']: self.funcSwitchPhase() print "Switching Phase button" |
self.delSliders() self.addSliders() | def switchStream(self, event): if event.key==self.dictKeybindings['prevStream']: self.stPt=(self.stPt-1)%self.stNum xmin, xmax = self.axs[0].get_xlim() self.delAxes() self.drawAxes() self.drawSavedPicks() self.delSliders() self.addSliders() self.multicursorReinit() self.axs[0].set_xlim(xmin, xmax) self.updatePlot() pri... | |
print "Going to previous stream" | msg = "Going to previous stream" appendTextview(self.textviewStdOut, msg) | def switchStream(self, event): if event.key==self.dictKeybindings['prevStream']: self.stPt=(self.stPt-1)%self.stNum xmin, xmax = self.axs[0].get_xlim() self.delAxes() self.drawAxes() self.drawSavedPicks() self.delSliders() self.addSliders() self.multicursorReinit() self.axs[0].set_xlim(xmin, xmax) self.updatePlot() pri... |
print "Going to next stream" | msg = "Going to next stream" appendTextview(self.textviewStdOut, msg) | def switchStream(self, event): if event.key==self.dictKeybindings['prevStream']: self.stPt=(self.stPt-1)%self.stNum xmin, xmax = self.axs[0].get_xlim() self.delAxes() self.drawAxes() self.drawSavedPicks() self.delSliders() self.addSliders() self.multicursorReinit() self.axs[0].set_xlim(xmin, xmax) self.updatePlot() pri... |
print 'Phases for 3Dloc:' | msg = 'Phases for 3Dloc:' appendTextview(self.textviewStdOut, msg) | def do3dLoc(self): self.setXMLEventID() subprocess.call(self.threeDlocPreCall, shell = True) f = open(self.threeDlocInfile, 'w') network = "BW" fmt = "%04s %s %s %5.3f -999.0 0.000 -999. 0.000 T__DR_ %9.6f %9.6f %8.6f\n" self.coords = [] for i in range(len(self.streams)): lon = self.dicts[i]['StaLon'] lat = sel... |
print '--> 3dloc finished' | msg = '--> 3dloc finished' appendTextview(self.textviewStdOut, msg) | def do3dLoc(self): self.setXMLEventID() subprocess.call(self.threeDlocPreCall, shell = True) f = open(self.threeDlocInfile, 'w') network = "BW" fmt = "%04s %s %s %5.3f -999.0 0.000 -999. 0.000 T__DR_ %9.6f %9.6f %8.6f\n" self.coords = [] for i in range(len(self.streams)): lon = self.dicts[i]['StaLon'] lat = sel... |
print 'Phases for focmec: %i' % count | msg = 'Phases for focmec: %i' % count appendTextview(self.textviewStdOut, msg) | def doFocmec(self): f = open(self.focmecPhasefile, 'w') f.write("\n") #first line is ignored! #Fortran style! 1: Station 2: Azimuth 3: Incident 4: Polarity #fmt = "ONTN 349.00 96.00C" fmt = "%4s %6.2f %6.2f%1s\n" count = 0 for d in self.dicts: if 'PAzim' not in d or 'PInci' not in d or 'PPol' not in d: continue st... |
print "Error: focmec did not find a suitable solution" | err = "Error: focmec did not find a suitable solution!" appendTextview(self.textviewStdErr, err) | def doFocmec(self): f = open(self.focmecPhasefile, 'w') f.write("\n") #first line is ignored! #Fortran style! 1: Station 2: Azimuth 3: Incident 4: Polarity #fmt = "ONTN 349.00 96.00C" fmt = "%4s %6.2f %6.2f%1s\n" count = 0 for d in self.dicts: if 'PAzim' not in d or 'PInci' not in d or 'PPol' not in d: continue st... |
print '--> focmec finished' | msg = '--> focmec finished' appendTextview(self.textviewStdOut, msg) | def doFocmec(self): f = open(self.focmecPhasefile, 'w') f.write("\n") #first line is ignored! #Fortran style! 1: Station 2: Azimuth 3: Incident 4: Polarity #fmt = "ONTN 349.00 96.00C" fmt = "%4s %6.2f %6.2f%1s\n" count = 0 for d in self.dicts: if 'PAzim' not in d or 'PInci' not in d or 'PPol' not in d: continue st... |
print '%i suitable solutions found:' % len(lines) | msg = '%i suitable solutions found:' % len(lines) appendTextview(self.textviewStdOut, msg) | def doFocmec(self): f = open(self.focmecPhasefile, 'w') f.write("\n") #first line is ignored! #Fortran style! 1: Station 2: Azimuth 3: Incident 4: Polarity #fmt = "ONTN 349.00 96.00C" fmt = "%4s %6.2f %6.2f%1s\n" count = 0 for d in self.dicts: if 'PAzim' not in d or 'PInci' not in d or 'PPol' not in d: continue st... |
print "Dip: %6.2f Strike: %6.2f Rake: %6.2f Errors: %i/%i" % \ | msg = "Dip: %6.2f Strike: %6.2f Rake: %6.2f Errors: %i/%i" % \ | def doFocmec(self): f = open(self.focmecPhasefile, 'w') f.write("\n") #first line is ignored! #Fortran style! 1: Station 2: Azimuth 3: Incident 4: Polarity #fmt = "ONTN 349.00 96.00C" fmt = "%4s %6.2f %6.2f%1s\n" count = 0 for d in self.dicts: if 'PAzim' not in d or 'PInci' not in d or 'PPol' not in d: continue st... |
print "selecting Focal Mechanism No. 1 of %2i:" % self.focMechCount | msg = "selecting Focal Mechanism No. 1 of %2i:" % self.focMechCount appendTextview(self.textviewStdOut, msg) | def doFocmec(self): f = open(self.focmecPhasefile, 'w') f.write("\n") #first line is ignored! #Fortran style! 1: Station 2: Azimuth 3: Incident 4: Polarity #fmt = "ONTN 349.00 96.00C" fmt = "%4s %6.2f %6.2f%1s\n" count = 0 for d in self.dicts: if 'PAzim' not in d or 'PInci' not in d or 'PPol' not in d: continue st... |
print "selecting Focal Mechanism No. %2i of %2i:" % \ | msg = "selecting Focal Mechanism No. %2i of %2i:" % \ | def nextFocMec(self): if not self.focMechCount: return self.focMechCurrent = (self.focMechCurrent + 1) % self.focMechCount self.dictFocalMechanism = self.focMechList[self.focMechCurrent] print "selecting Focal Mechanism No. %2i of %2i:" % \ (self.focMechCurrent + 1, self.focMechCount) print "Dip: %6.2f Strike: %6.2f ... |
print "Dip: %6.2f Strike: %6.2f Rake: %6.2f Errors: %i%i" % \ | appendTextview(self.textviewStdOut, msg) msg = "Dip: %6.2f Strike: %6.2f Rake: %6.2f Errors: %i%i" % \ | def nextFocMec(self): if not self.focMechCount: return self.focMechCurrent = (self.focMechCurrent + 1) % self.focMechCount self.dictFocalMechanism = self.focMechList[self.focMechCurrent] print "selecting Focal Mechanism No. %2i of %2i:" % \ (self.focMechCurrent + 1, self.focMechCount) print "Dip: %6.2f Strike: %6.2f ... |
print "no focal mechanism data." | err = "Error: No focal mechanism data!" appendTextview(self.textviewStdErr, err) | def showFocMec(self): if self.dictFocalMechanism == {}: print "no focal mechanism data." return # make up the figure: fig = plt.figure(1002, figsize=(2, 2)) fig.clear() fig.subplots_adjust(left=0, bottom=0, right=1, top=1) # plot the selected solution Beachball([self.dictFocalMechanism['Strike'], self.dictFocalMechani... |
msg = "Trying to print a hypo2000 phase file " + \ "with S phase without P phase.\n" + \ | err = "Warning: Trying to print a Hypo2000 phase file " + \ "with an S phase without P phase.\n" + \ | def doHyp2000(self): """ Writes input files for hyp2000 and starts the hyp2000 program via a system call. Information on the file formats can be found at: http://geopubs.wr.usgs.gov/open-file/of02-171/of02-171.pdf p.30 |
warnings.warn(msg) | appendTextview(self.textviewStdErr, err) | def doHyp2000(self): """ Writes input files for hyp2000 and starts the hyp2000 program via a system call. Information on the file formats can be found at: http://geopubs.wr.usgs.gov/open-file/of02-171/of02-171.pdf p.30 |
print 'Phases for Hypo2000:' | msg = 'Phases for Hypo2000:' appendTextview(self.textviewStdOut, msg) | def doHyp2000(self): """ Writes input files for hyp2000 and starts the hyp2000 program via a system call. Information on the file formats can be found at: http://geopubs.wr.usgs.gov/open-file/of02-171/of02-171.pdf p.30 |
print 'Stations for Hypo2000:' | msg = 'Stations for Hypo2000:' appendTextview(self.textviewStdOut, msg) | def doHyp2000(self): """ Writes input files for hyp2000 and starts the hyp2000 program via a system call. Information on the file formats can be found at: http://geopubs.wr.usgs.gov/open-file/of02-171/of02-171.pdf p.30 |
print '--> hyp2000 finished' | msg = '--> hyp2000 finished' appendTextview(self.textviewStdOut, msg) | def doHyp2000(self): """ Writes input files for hyp2000 and starts the hyp2000 program via a system call. Information on the file formats can be found at: http://geopubs.wr.usgs.gov/open-file/of02-171/of02-171.pdf p.30 |
print line.rstrip() | msg += line appendTextview(self.textviewStdOut, msg) | def catFile(self, file): lines = open(file).readlines() for line in lines: print line.rstrip() |
print "Error: Did not find Hypo2000 output file" | err = "Error: Hypo2000 output file (%s) does not exist!" % \ self.hyp2000Summary appendTextview(self.textviewStdErr, err) | def loadHyp2000Data(self): #self.load3dlocSyntheticPhases() lines = open(self.hyp2000Summary).readlines() if lines == []: print "Error: Did not find Hypo2000 output file" return # goto origin info line while True: try: line = lines.pop(0) except: break if line.startswith(" YEAR MO DA --ORIGIN--"): break try: line = li... |
print "Error: No location in Hypo2000 Outputfile." | err = "Error: No location info found in Hypo2000 outputfile " + \ "(%s)!" % self.hyp2000Summary appendTextview(self.textviewStdErr, err) | def loadHyp2000Data(self): #self.load3dlocSyntheticPhases() lines = open(self.hyp2000Summary).readlines() if lines == []: print "Error: Did not find Hypo2000 output file" return # goto origin info line while True: try: line = lines.pop(0) except: break if line.startswith(" YEAR MO DA --ORIGIN--"): break try: line = li... |
self.dictOrigin['Used Model'] = model | self.dictOrigin['Depth Type'] = "from location program" self.dictOrigin['Earth Model'] = model | def loadHyp2000Data(self): #self.load3dlocSyntheticPhases() lines = open(self.hyp2000Summary).readlines() if lines == []: print "Error: Did not find Hypo2000 output file" return # goto origin info line while True: try: line = lines.pop(0) except: break if line.startswith(" YEAR MO DA --ORIGIN--"): break try: line = li... |
self.dictOrigin['Used Model'] = "STAUFEN" | self.dictOrigin['Depth Type'] = "from location program" self.dictOrigin['Earth Model'] = "STAUFEN" | def load3dlocData(self): #self.load3dlocSyntheticPhases() event = open(self.threeDlocOutfile).readline().split() self.dictOrigin['Longitude'] = float(event[8]) self.dictOrigin['Latitude'] = float(event[9]) self.dictOrigin['Depth'] = float(event[10]) self.dictOrigin['Longitude Error'] = float(event[11]) self.dictOrigin[... |
print "updating network magnitude..." | msg = "updating network magnitude..." appendTextview(self.textviewStdOut, msg) | def updateNetworkMag(self): print "updating network magnitude..." self.dictMagnitude['Station Count'] = 0 self.dictMagnitude['Magnitude'] = 0 staMags = [] for i in range(len(self.streams)): if self.dicts[i]['MagUse'] and self.dicts[i].has_key('Mag'): print self.dicts[i]['Station'] self.dictMagnitude['Station Count'] +=... |
print self.dicts[i]['Station'] | msg = "%s: %.1f" % (self.dicts[i]['Station'], self.dicts[i]['Mag']) appendTextview(self.textviewStdOut, msg) | def updateNetworkMag(self): print "updating network magnitude..." self.dictMagnitude['Station Count'] = 0 self.dictMagnitude['Magnitude'] = 0 staMags = [] for i in range(len(self.streams)): if self.dicts[i]['MagUse'] and self.dicts[i].has_key('Mag'): print self.dicts[i]['Station'] self.dictMagnitude['Station Count'] +=... |
print "new network magnitude: %.2f (Variance: %.2f)" % (self.dictMagnitude['Magnitude'], self.dictMagnitude['Uncertainty']) | msg = "new network magnitude: %.2f (Variance: %.2f)" % \ (self.dictMagnitude['Magnitude'], self.dictMagnitude['Uncertainty']) appendTextview(self.textviewStdOut, msg) | def updateNetworkMag(self): print "updating network magnitude..." self.dictMagnitude['Station Count'] = 0 self.dictMagnitude['Magnitude'] = 0 staMags = [] for i in range(len(self.streams)): if self.dicts[i]['MagUse'] and self.dicts[i].has_key('Mag'): print self.dicts[i]['Station'] self.dictMagnitude['Station Count'] +=... |
print 'calculated new magnitude for %s: %0.2f (channels: %s)' \ | msg = 'calculated new magnitude for %s: %0.2f (channels: %s)' \ | def calculateStationMagnitudes(self): for i in range(len(self.streams)): if (self.dicts[i].has_key('MagMin1') and self.dicts[i].has_key('MagMin2') and self.dicts[i].has_key('MagMax1') and self.dicts[i].has_key('MagMax2')): amp = self.dicts[i]['MagMax1'] - self.dicts[i]['MagMin1'] timedelta = abs(self.dicts[i]['MagMax1... |
import rpy | try: import rpy except: err = "Error: Package rpy could not be imported!\n" + \ "(We should switch to scipy polyfit, anyway!)" appendTextview(self.textviewStdErr, err) return | def showWadati(self): """ Shows a Wadati diagram plotting P time in (truncated) Julian seconds against S-P time for every station and doing a linear regression using rpy. An estimate of Vp/Vs is given by the slope + 1. """ import rpy pTimes = [] spTimes = [] stations = [] for i in range(len(self.dicts)): if self.dicts[... |
print "Error: Got less than 2 P-S Pairs." | err = "Error: Less than 2 P-S Pairs!" appendTextview(self.textviewStdErr, err) | def showWadati(self): """ Shows a Wadati diagram plotting P time in (truncated) Julian seconds against S-P time for every station and doing a linear regression using rpy. An estimate of Vp/Vs is given by the slope + 1. """ import rpy pTimes = [] spTimes = [] stations = [] for i in range(len(self.dicts)): if self.dicts[... |
print "no hypocenter data." | err = "Error: No hypocenter data!" appendTextview(self.textviewStdErr, err) | def showEventMap(self): if self.dictOrigin == {}: print "no hypocenter data." return #print self.dicts[0] self.figEventMap = plt.figure(1000) self.figEventMap.canvas.set_window_title("Event Map") self.axEventMap = self.figEventMap.add_subplot(111) self.axEventMap.scatter([self.dictOrigin['Longitude']], [self.dictOrigin... |
Sub(event_type, "public").text = "%s" % self.flagPublicEvent | Sub(event_type, "public").text = "%s" % \ self.checkbuttonPublicEvent.get_active() | def dicts2XML(self): """ Returns information of all dictionaries as xml file """ xml = Element("event") Sub(Sub(xml, "event_id"), "value").text = self.dictEvent['xmlEventID'] event_type = Sub(xml, "event_type") Sub(event_type, "value").text = "manual" Sub(event_type, "user").text = self.username Sub(event_type, "publi... |
if self.dictOrigin['Program'] == "hyp2000": | if self.dictOrigin['Program'] == "hyp2000" and \ 'PsynthWeight' in d: | def dicts2XML(self): """ Returns information of all dictionaries as xml file """ xml = Element("event") Sub(Sub(xml, "event_id"), "value").text = self.dictEvent['xmlEventID'] event_type = Sub(xml, "event_type") Sub(event_type, "value").text = "manual" Sub(event_type, "user").text = self.username Sub(event_type, "publi... |
if self.dictOrigin['Program'] == "hyp2000": | if self.dictOrigin['Program'] == "hyp2000" and \ 'SsynthWeight' in d: | def dicts2XML(self): """ Returns information of all dictionaries as xml file """ xml = Element("event") Sub(Sub(xml, "event_id"), "value").text = self.dictEvent['xmlEventID'] event_type = Sub(xml, "event_type") Sub(event_type, "value").text = "manual" Sub(event_type, "user").text = self.username Sub(event_type, "publi... |
Sub(origin, "depth_type").text = "from location program" Sub(origin, "earth_mod").text = dO['Used Model'] | if 'Depth Type' in dO: Sub(origin, "depth_type").text = str(dO['Depth Type']) else: Sub(origin, "depth_type") if 'Earth Model' in dO: Sub(origin, "earth_mod").text = dO['Earth Model'] else: Sub(origin, "earth_mod") | def dicts2XML(self): """ Returns information of all dictionaries as xml file """ xml = Element("event") Sub(Sub(xml, "event_id"), "value").text = self.dictEvent['xmlEventID'] event_type = Sub(xml, "event_type") Sub(event_type, "value").text = "manual" Sub(event_type, "user").text = self.username Sub(event_type, "publi... |
print "creating xml..." | msg = "creating xml..." appendTextview(self.textviewStdOut, msg) | def uploadSeishub(self): """ Upload xml file to seishub """ userid = "admin" passwd = "admin" |
print "writing xml as %s (for quick inspection only)" % tmpfile | msg = "writing xml as %s (for debugging purposes only!)" % tmpfile appendTextview(self.textviewStdOut, msg) | def uploadSeishub(self): """ Upload xml file to seishub """ userid = "admin" passwd = "admin" |
print "User: ", self.username print "Name: ", name print "Server: ", self.server['Server'], path print "Response: ", statuscode, statusmessage print "Headers: ", header | msg = "User: %s" % self.username msg += "\nName: %s" % name msg += "\nServer: %s%s" % (self.server['Server'], path) msg += "\nResponse: %s %s" % (statuscode, statusmessage) msg += "\nHeader:" msg += "\n%s" % str(header).strip() appendTextview(self.textviewStdOut, msg) else: err = "Warning/Error: Got HTTP status code 20... | def uploadSeishub(self): """ Upload xml file to seishub """ userid = "admin" passwd = "admin" |
print "Clearing previous data." | msg = "Clearing previous data." appendTextview(self.textviewStdOut, msg) | def clearDictionaries(self): print "Clearing previous data." for i in range(len(self.dicts)): for k in self.dicts[i].keys(): if k != 'Station' and k != 'StaLat' and k != 'StaLon' and \ k != 'StaEle' and k != 'pazZ' and k != 'pazN' and \ k != 'pazE': del self.dicts[i][k] self.dicts[i]['MagUse'] = True self.dictOrigin = ... |
print "Clearing previous event data." | msg = "Clearing previous origin and magnitude data." appendTextview(self.textviewStdOut, msg) | def clearOriginMagnitudeDictionaries(self): print "Clearing previous event data." # we need to delete all station magnitude information from all dicts for i in range(len(self.dicts)): for k in self.dicts[i].keys(): if k != 'Station' and k != 'StaLat' and k != 'StaLon' and \ k != 'StaEle' and k != 'pazZ' and k != 'pazN'... |
print "Clearing previous focal mechanism data." | msg = "Clearing previous focal mechanism data." appendTextview(self.textviewStdOut, msg) | def clearFocmecDictionary(self): print "Clearing previous focal mechanism data." self.dictFocalMechanism = {} self.focMechList = [] self.focMechCurrent = None self.focMechCount = None |
print "%i events are available from Seishub" % self.seishubEventCount | msg = "%i events are available from Seishub" % self.seishubEventCount appendTextview(self.textviewStdOut, msg) | def getNextEventFromSeishub(self, starttime, endtime): """ Updates dictionary with pick data for first event which origin time is between startime and endtime. Warning: * When using the stream starttime an interesting event may not be found because the origin time may be before the stream starttime! * If more than one ... |
print "Fetching event %i of %i (event_id: %s)" % \ (self.seishubEventCurrent + 1, self.seishubEventCount, document_id) | def getNextEventFromSeishub(self, starttime, endtime): """ Updates dictionary with pick data for first event which origin time is between startime and endtime. Warning: * When using the stream starttime an interesting event may not be found because the origin time may be before the stream starttime! * If more than one ... | |
print "Event data from seishub loaded." | msg = "Fetched event %i of %i (event_id: %s, user: %s)" % \ (self.seishubEventCurrent + 1, self.seishubEventCount, document_id, user) appendTextview(self.textviewStdOut, msg) | def getNextEventFromSeishub(self, starttime, endtime): """ Updates dictionary with pick data for first event which origin time is between startime and endtime. Warning: * When using the stream starttime an interesting event may not be found because the origin time may be before the stream starttime! * If more than one ... |
'setSOnsetImpulsive': 'i', 'setSOnsetEmergent': 'e',} | 'setSOnsetImpulsive': 'i', 'setSOnsetEmergent': 'e'} | def __init__(self, streams = None): self.streams = streams #Define some flags, dictionaries and plotting options self.flagFilt=False #False:no filter True:filter self.flagFiltTyp=0 #0: bandpass 1: bandstop 2:lowpass 3: highpass self.dictFiltTyp={'Bandpass':0, 'Bandstop':1, 'Lowpass':2, 'Highpass':3} self.flagFiltZPH=F... |
self.dicts[i]['Station'] = streams[i][0].stats.station.rstrip() | self.dicts[i]['Station'] = streams[i][0].stats.station.strip() | def __init__(self, streams = None): self.streams = streams #Define some flags, dictionaries and plotting options self.flagFilt=False #False:no filter True:filter self.flagFiltTyp=0 #0: bandpass 1: bandstop 2:lowpass 3: highpass self.dictFiltTyp={'Bandpass':0, 'Bandstop':1, 'Lowpass':2, 'Highpass':3} self.flagFiltZPH=F... |
for label in ('do3dloc', 'showMap', 'send2seishub', 'getEventFromSeishub', 'quit'): | for label in ('do3dloc', 'showMap', 'send2seishub', 'getNextEvent', 'quit'): | def __init__(self, streams = None): self.streams = streams #Define some flags, dictionaries and plotting options self.flagFilt=False #False:no filter True:filter self.flagFiltTyp=0 #0: bandpass 1: bandstop 2:lowpass 3: highpass self.dictFiltTyp={'Bandpass':0, 'Bandstop':1, 'Lowpass':2, 'Highpass':3} self.flagFiltZPH=F... |
elif item.labelstr == 'getEventFromSeishub': | elif item.labelstr == 'getNextEvent': | def on_select(item): print '--> ', item.labelstr if item.labelstr == 'quit': plt.close() elif item.labelstr == 'do3dloc': self.do3dLoc() elif item.labelstr == 'showMap': self.load3dlocData() self.show3dlocEventMap() elif item.labelstr == 'send2seishub': self.uploadSeishub() elif item.labelstr == 'getEventFromSeishub': ... |
self.getEventFromSeishub(self.streams[0][0].stats.starttime, | self.getNextEventFromSeishub(self.streams[0][0].stats.starttime, | def on_select(item): print '--> ', item.labelstr if item.labelstr == 'quit': plt.close() elif item.labelstr == 'do3dloc': self.do3dLoc() elif item.labelstr == 'showMap': self.load3dlocData() self.show3dlocEventMap() elif item.labelstr == 'send2seishub': self.uploadSeishub() elif item.labelstr == 'getEventFromSeishub': ... |
def getEventFromSeishub(self, starttime, endtime): | def getNextEventFromSeishub(self, starttime, endtime): | def getEventFromSeishub(self, starttime, endtime): """ Updates dictionary with pick data for first event which origin time is between startime and endtime. Warning: * When using the stream starttime an interesting event may not be found because the origin time may be before the stream starttime! * If more than one even... |
if len(document) > 1: message = "Found more than one event. Using first one only!" warnings.warn(message) for i, node in enumerate(xml.xpath(u".//resource_name")): document_id = document[i].text print "Fetching data for event with event_id: %s" % document_id resource_url = "http://teide:8080/xml/seismology/event/" + \... | if not self.seishubEventCount: self.seishubEventCount = len(xml.xpath(u".//resource_name")) self.seishubEventCurrent = 0 print "%i events are available from Seishub" % self.seishubEventCount else: self.seishubEventCurrent = (self.seishubEventCurrent + 1) % \ self.seishubEventCount document_id = document[self.seishubE... | def getEventFromSeishub(self, starttime, endtime): """ Updates dictionary with pick data for first event which origin time is between startime and endtime. Warning: * When using the stream starttime an interesting event may not be found because the origin time may be before the stream starttime! * If more than one even... |
time = pick.xpath(".//time/value")[0].text uncertainty = pick.xpath(".//time/uncertainty")[0].text try: onset = pick.xpath(".//onset")[0].text except: onset = None try: polarity = pick.xpath(".//polarity")[0].text except: polarity = None try: weight = pick.xpath(".//weight")[0].text except: weight = None time = UTCDat... | else: streamnum = i break if streamnum == None: message = "Did not find matching stream for pick data " + \ "with station id: \"%s\"" % station.strip() warnings.warn(message) continue time = pick.xpath(".//time/value")[0].text uncertainty = pick.xpath(".//time/uncertainty")[0].text try: onset = pick.xpath(".//onset")[... | def getEventFromSeishub(self, starttime, endtime): """ Updates dictionary with pick data for first event which origin time is between startime and endtime. Warning: * When using the stream starttime an interesting event may not be found because the origin time may be before the stream starttime! * If more than one even... |
uncertainty /= 2 if pick.xpath(".//phaseHint")[0].text == "P": self.dicts[streamnum]['P'] = time | def getEventFromSeishub(self, starttime, endtime): """ Updates dictionary with pick data for first event which origin time is between startime and endtime. Warning: * When using the stream starttime an interesting event may not be found because the origin time may be before the stream starttime! * If more than one even... | |
uncertainty = float(uncertainty) uncertainty = int(round(uncertainty * self.streams[streamnum][0].stats.sampling_rate)) uncertainty /= 2 if pick.xpath(".//phaseHint")[0].text == "P": self.dicts[streamnum]['P'] = time if uncertainty: self.dicts[streamnum]['PErr1'] = time - uncertainty self.dicts[streamnum]['PErr2'] = t... | self.dicts[streamnum]['PErr1'] = time - uncertainty self.dicts[streamnum]['PErr2'] = time + uncertainty if onset: self.dicts[streamnum]['POnset'] = onset if polarity: self.dicts[streamnum]['PPol'] = polarity if weight: self.dicts[streamnum]['PWeight'] = weight if pick.xpath(".//phaseHint")[0].text == "S": self.dicts[st... | def getEventFromSeishub(self, starttime, endtime): """ Updates dictionary with pick data for first event which origin time is between startime and endtime. Warning: * When using the stream starttime an interesting event may not be found because the origin time may be before the stream starttime! * If more than one even... |
msg = "Warning: Trying to print a hypo2000 phase file" + \ " with S phase without P phase.\n" + \ | msg = "Trying to print a hypo2000 phase file " + \ "with S phase without P phase.\n" + \ | def doHyp2000(self): self.setXMLEventID() subprocess.call(self.hyp2000PreCall, shell = True) f = open(self.hyp2000Phasefile, 'w') f2 = open(self.hyp2000Stationsfile, 'w') network = "BW" #fmt = "RWMOIP?0 091229124412.22 13.99IS?0" fmtP = "%4s%1sP%1s%1i %15s" fmtS = "%12s%1sS%1s%1i\n" #fmt2 = " BGLD4739.14N01300.7... |
date2 = t2.strftime("%H%M%S") | mindiff = (t2.minute - t.minute + 60) % 60 abs_sec = t2.second + (mindiff * 60) if abs_sec > 99: msg = "Writing a hypo2000 phase file with a S phase " + \ "seconds value greater than 99 seconds. This " + \ "case could be covered incorrectly. Check " + \ "location results carefully. (And give " + \ "feedback... =)" warn... | def doHyp2000(self): self.setXMLEventID() subprocess.call(self.hyp2000PreCall, shell = True) f = open(self.hyp2000Phasefile, 'w') f2 = open(self.hyp2000Stationsfile, 'w') network = "BW" #fmt = "RWMOIP?0 091229124412.22 13.99IS?0" fmtP = "%4s%1sP%1s%1i %15s" fmtS = "%12s%1sS%1s%1i\n" #fmt2 = " BGLD4739.14N01300.7... |
self.dicts[i]['distEpi']) | self.dicts[i]['distHypo']) | def calculateStationMagnitudes(self): for i in range(len(self.streams)): if (self.dicts[i].has_key('MagMin1') and self.dicts[i].has_key('MagMin2') and self.dicts[i].has_key('MagMax1') and self.dicts[i].has_key('MagMax2')): amp = self.dicts[i]['MagMax1'] - self.dicts[i]['MagMin1'] timedelta = abs(self.dicts[i]['MagMax1... |
if self.dictOrigin['Program'] == "hyp2000" and \ 'SsynthWeight' in dict: | if 'SsynthWeight' in dict: | def dicts2XML(self): """ Returns information of all dictionaries as xml file """ xml = Element("event") Sub(Sub(xml, "event_id"), "value").text = self.dictEvent['xmlEventID'] event_type = Sub(xml, "event_type") Sub(event_type, "value").text = "manual" Sub(event_type, "user").text = self.username Sub(event_type, "publi... |
msg = "Writing a hypo2000 phase file with a S phase " + \ "seconds value greater than 99 seconds. This " + \ "case could be covered incorrectly. Check " + \ "location results carefully. (And give " + \ "feedback... =)" | msg = "S phase seconds are greater than 99 which is " + \ "not covered by the hypo phase file format! " + \ "Omitting S phase of station %s!!!" % sta | def doHyp2000(self): self.setXMLEventID() subprocess.call(self.hyp2000PreCall, shell = True) f = open(self.hyp2000Phasefile, 'w') f2 = open(self.hyp2000Stationsfile, 'w') network = "BW" #fmt = "RWMOIP?0 091229124412.22 13.99IS?0" fmtP = "%4s%1sP%1s%1i %15s" fmtS = "%12s%1sS%1s%1i\n" #fmt2 = " BGLD4739.14N01300.7... |
if t2.minute - t.minute < 0 and \ t2.hour - t.hour > 1: msg = "Writing a hypo2000 phase file with a S phase " + \ "over an hour later than the P phase. This case " + \ "is definitely not implemented correctly." warnings.warn(msg) | f.write("\n") continue | def doHyp2000(self): self.setXMLEventID() subprocess.call(self.hyp2000PreCall, shell = True) f = open(self.hyp2000Phasefile, 'w') f2 = open(self.hyp2000Stationsfile, 'w') network = "BW" #fmt = "RWMOIP?0 091229124412.22 13.99IS?0" fmtP = "%4s%1sP%1s%1i %15s" fmtS = "%12s%1sS%1s%1i\n" #fmt2 = " BGLD4739.14N01300.7... |
k != 'SWeight' and k != 'Saxind': | k != 'SWeight' and k != 'Saxind' and \ k != 'MagMin1' and k != 'MagMin2' and \ k != 'MagMax1' and k != 'MagMax2': | def clearOriginMagnitudeDictionaries(self): print "Clearing previous event data." # we need to delete all station magnitude information from all dicts for i in range(len(self.dicts)): for k in self.dicts[i].keys(): if k != 'Station' and k != 'StaLat' and k != 'StaLon' and \ k != 'StaEle' and k != 'pazZ' and k != 'pazN'... |
self.dicts[i]['pazN'] = self.client.station.getPAZ(net, sta, date, channel_id = self.streams[i][1].stats.channel) self.dicts[i]['pazE'] = self.client.station.getPAZ(net, sta, date, channel_id = self.streams[i][2].stats.channel) self.dicts[i]['StaLon'] = lon self.dicts[i]['StaLat'] = lat self.dicts[i]['StaEle'] = ele / ... | def __init__(self, client = None, streams = None, options = None): self.client = client self.streams = streams self.options = options #Define some flags, dictionaries and plotting options self.flagFilt=False #False:no filter True:filter self.flagFiltTyp=0 #0: bandpass 1: bandstop 2:lowpass 3: highpass self.dictFiltTyp... | |
print self.dicts[i]['pazN'] print self.dicts[i]['pazE'] | if len(self.streams[i]) == 3: self.dicts[i]['pazN'] = self.client.station.getPAZ(net, sta, date, channel_id = self.streams[i][1].stats.channel) self.dicts[i]['pazE'] = self.client.station.getPAZ(net, sta, date, channel_id = self.streams[i][2].stats.channel) print self.dicts[i]['pazN'] print self.dicts[i]['pazE'] | def __init__(self, client = None, streams = None, options = None): self.client = client self.streams = streams self.options = options #Define some flags, dictionaries and plotting options self.flagFilt=False #False:no filter True:filter self.flagFiltTyp=0 #0: bandpass 1: bandstop 2:lowpass 3: highpass self.dictFiltTyp... |
self.dicts[streamnum]['PWeight'] = weight | self.dicts[streamnum]['PWeight'] = int(weight) | def getNextEventFromSeishub(self, starttime, endtime): """ Updates dictionary with pick data for first event which origin time is between startime and endtime. Warning: * When using the stream starttime an interesting event may not be found because the origin time may be before the stream starttime! * If more than one ... |
self.dicts[streamnum]['SWeight'] = weight | self.dicts[streamnum]['SWeight'] = int(weight) | def getNextEventFromSeishub(self, starttime, endtime): """ Updates dictionary with pick data for first event which origin time is between startime and endtime. Warning: * When using the stream starttime an interesting event may not be found because the origin time may be before the stream starttime! * If more than one ... |
picktime = st[axind].stats.starttime | picktime = st[0].stats.starttime | def dicts2XML(self): """ Returns information of all dictionaries as xml file """ xml = Element("event") Sub(Sub(xml, "event_id"), "value").text = self.dictEvent['xmlEventID'] event_type = Sub(xml, "event_type") Sub(event_type, "value").text = "manual" Sub(event_type, "user").text = self.username Sub(event_type, "publi... |
print x, y, w, h | def set_extent(self, x, y, w, h): print x, y, w, h self.rect.set_x(x) self.rect.set_y(y) self.rect.set_width(w) self.rect.set_height(h) self.label.ox = x+self.padx self.label.oy = y-self.depth+self.pady/2. self.rect._update_patch_transform() self.hover = False | |
x0 = 10 y0 = 10 | x0 = 5 y0 = 5 y1 = y0 + (self.numitems-1)*(maxh + MenuItem.pady) | def __init__(self, fig, menuitems): self.figure = fig fig.suppressComposite = True self.menuitems = menuitems self.numitems = len(menuitems) maxw = max([item.labelwidth for item in menuitems]) maxh = max([item.labelheight for item in menuitems]) totalh = self.numitems*maxh + (self.numitems+1)*2*MenuItem.pady x0 = 10 y0... |
bottom = y0-maxh-MenuItem.pady | bottom = y1 | def __init__(self, fig, menuitems): self.figure = fig fig.suppressComposite = True self.menuitems = menuitems self.numitems = len(menuitems) maxw = max([item.labelwidth for item in menuitems]) maxh = max([item.labelheight for item in menuitems]) totalh = self.numitems*maxh + (self.numitems+1)*2*MenuItem.pady x0 = 10 y0... |
y0 -= maxh + MenuItem.pady | y1 -= maxh + MenuItem.pady | def __init__(self, fig, menuitems): self.figure = fig fig.suppressComposite = True self.menuitems = menuitems self.numitems = len(menuitems) maxw = max([item.labelwidth for item in menuitems]) maxh = max([item.labelheight for item in menuitems]) totalh = self.numitems*maxh + (self.numitems+1)*2*MenuItem.pady x0 = 10 y0... |
axFilt = fig.add_axes([0.02, 0.02, 0.15, 0.15],frameon=False,axisbg='lightgrey') | axFilt = fig.add_axes([0.22, 0.02, 0.15, 0.15],frameon=False,axisbg='lightgrey') | def addFiltButtons(): global axFilt global check global axFiltTyp global radio #add filter buttons axFilt = fig.add_axes([0.02, 0.02, 0.15, 0.15],frameon=False,axisbg='lightgrey') check = CheckButtons(axFilt, ('Filter','Zero-Phase'),(False,True)) check.on_clicked(funcFilt) axFiltTyp = fig.add_axes([0.20, 0.02, 0.15, 0.... |
axFiltTyp = fig.add_axes([0.20, 0.02, 0.15, 0.15],frameon=False,axisbg='lightgrey') | axFiltTyp = fig.add_axes([0.40, 0.02, 0.15, 0.15],frameon=False,axisbg='lightgrey') | def addFiltButtons(): global axFilt global check global axFiltTyp global radio #add filter buttons axFilt = fig.add_axes([0.02, 0.02, 0.15, 0.15],frameon=False,axisbg='lightgrey') check = CheckButtons(axFilt, ('Filter','Zero-Phase'),(False,True)) check.on_clicked(funcFilt) axFiltTyp = fig.add_axes([0.20, 0.02, 0.15, 0.... |
axPhase = fig.add_axes([0.90, 0.02, 0.10, 0.15],frameon=False,axisbg='lightgrey') | axPhase = fig.add_axes([0.10, 0.02, 0.10, 0.15],frameon=False,axisbg='lightgrey') | def addPhaseButtons(): global axPhase global radioPhase #add phase buttons axPhase = fig.add_axes([0.90, 0.02, 0.10, 0.15],frameon=False,axisbg='lightgrey') radioPhase = RadioButtons(axPhase, ('P', 'S', 'Mag'),activecolor='k') radioPhase.on_clicked(funcPhase) |
axLowcut = fig.add_axes([0.45, 0.05, 0.35, 0.03], xscale='log') axHighcut = fig.add_axes([0.45, 0.10, 0.35, 0.03], xscale='log') | axLowcut = fig.add_axes([0.63, 0.05, 0.30, 0.03], xscale='log') axHighcut = fig.add_axes([0.63, 0.10, 0.30, 0.03], xscale='log') | def addSliders(): global axLowcut global axHighcut global slideLow global slideHigh #add filter slider axLowcut = fig.add_axes([0.45, 0.05, 0.35, 0.03], xscale='log') axHighcut = fig.add_axes([0.45, 0.10, 0.35, 0.03], xscale='log') low = 1.0/ (streams[stPt][0].stats.npts/float(streams[stPt][0].stats.sampling_rate)) h... |
for label in ('open', 'close', 'save', 'save as', 'quit'): | for label in ('save', 'quit'): | def allowRedraw(event): if event.button==1 or event.button==3: multicursor.visible=True fig.canvas.widgetlock.release(fig.canvas.toolbar) |
"E.g. '2010-01-10T05:00:00'") | "E.g. '2010-01-10T05:00:00'", default='2009-07-21T04:33:00') | def main(): usage = "USAGE: %prog -t <datetime> -d <duration> -i <channelids>" parser = OptionParser(usage) parser.add_option("-t", "--time", dest="time", help="Starttime of seismogram to retrieve. It takes a " "string which UTCDateTime can convert. " "E.g. '2010-01-10T05:00:00'") parser.add_option("-d", "--duration", ... |
help="Duration of seismogram in seconds") | help="Duration of seismogram in seconds", default=120) | def main(): usage = "USAGE: %prog -t <datetime> -d <duration> -i <channelids>" parser = OptionParser(usage) parser.add_option("-t", "--time", dest="time", help="Starttime of seismogram to retrieve. It takes a " "string which UTCDateTime can convert. " "E.g. '2010-01-10T05:00:00'") parser.add_option("-d", "--duration", ... |
"'BW.RJOB..EH*,BW.RMOA..EH*'") | "'BW.RJOB..EH*,BW.RMOA..EH*'", default='BW.RJOB..EH*,BW.RMOA..EH*') | def main(): usage = "USAGE: %prog -t <datetime> -d <duration> -i <channelids>" parser = OptionParser(usage) parser.add_option("-t", "--time", dest="time", help="Starttime of seismogram to retrieve. It takes a " "string which UTCDateTime can convert. " "E.g. '2010-01-10T05:00:00'") parser.add_option("-d", "--duration", ... |
axs[i].set_ylabel(streams[stPt][0].stats.station+" "+streams[stPt][0].stats.channel) plts.append(axs[i].plot(t, streams[stPt][i].data, color='k')[0]) | axs[i].set_ylabel(streams[stPt][i].stats.station+" "+streams[stPt][i].stats.channel) plts.append(axs[i].plot(t, streams[stPt][i].data, color='k',zorder=1000)[0]) | def drawAxes(): global axs global t global plts global multicursor global supTit t = np.arange(streams[stPt][0].stats.npts) axs=[] plts=[] trNum=len(streams[stPt].traces) for i in range(trNum): if i==0: axs.append(fig.add_subplot(trNum,1,i+1)) else: axs.append(fig.add_subplot(trNum,1,i+1,sharex=axs[0],sharey=axs[0])) a... |
fig.subplots_adjust(bottom=0.25,hspace=0) | fig.subplots_adjust(bottom=0.25,hspace=0,right=0.999,top=0.95) | def drawAxes(): global axs global t global plts global multicursor global supTit t = np.arange(streams[stPt][0].stats.npts) axs=[] plts=[] trNum=len(streams[stPt].traces) for i in range(trNum): if i==0: axs.append(fig.add_subplot(trNum,1,i+1)) else: axs.append(fig.add_subplot(trNum,1,i+1,sharex=axs[0],sharey=axs[0])) a... |
radio = RadioButtons(axFiltTyp, ('Bandpass', 'Bandstop', 'Lowpass', 'Highpass')) | radio = RadioButtons(axFiltTyp, ('Bandpass', 'Bandstop', 'Lowpass', 'Highpass'),activecolor='k') | def addFiltButtons(): global axFilt global check global axFiltTyp global radio #add filter buttons axFilt = fig.add_axes([0.02, 0.02, 0.15, 0.15],frameon=False,axisbg='lightgrey') check = CheckButtons(axFilt, ('Filter','Zero-Phase'),(False,True)) check.on_clicked(funcFilt) axFiltTyp = fig.add_axes([0.20, 0.02, 0.15, 0.... |
radioPhase = RadioButtons(axPhase, ('P', 'S', 'Mag')) | radioPhase = RadioButtons(axPhase, ('P', 'S', 'Mag'),activecolor='k') | def addPhaseButtons(): global axPhase global radioPhase #add phase buttons axPhase = fig.add_axes([0.90, 0.02, 0.10, 0.15],frameon=False,axisbg='lightgrey') radioPhase = RadioButtons(axPhase, ('P', 'S', 'Mag')) radioPhase.on_clicked(funcPhase) |
slideLow = Slider(axLowcut, 'Lowcut', low, high, valinit=low) slideHigh = Slider(axHighcut, 'Highcut', low, high, valinit=high) | slideLow = Slider(axLowcut, 'Lowcut', low, high, valinit=low, facecolor='darkgrey', edgecolor='k', linewidth=1.7) slideHigh = Slider(axHighcut, 'Highcut', low, high, valinit=high, facecolor='darkgrey', edgecolor='k', linewidth=1.7) | def addSliders(): global axLowcut global axHighcut global slideLow global slideHigh #add filter slider axLowcut = fig.add_axes([0.45, 0.05, 0.35, 0.03], xscale='log') axHighcut = fig.add_axes([0.45, 0.10, 0.35, 0.03], xscale='log') low = 1.0/ (streams[stPt][0].stats.npts/float(streams[stPt][0].stats.sampling_rate)) h... |
for a in axs: a.figure.canvas.draw() | fig.canvas.draw() | def redraw(): #xlims=list(axs[0].get_xlim()) #ylims=list(axs[0].get_ylim()) for a in axs: a.figure.canvas.draw() #axs[0].set_xlim(xlims) #axs[0].set_ylim(ylims) #axs[0].figure.canvas.draw() |
PLines.append(axs[i].axvline(event.xdata,color=dictPhaseColors[flagPhase],linewidth=axvlinewidths)) | PLines.append(axs[i].axvline(event.xdata,color=dictPhaseColors[flagPhase],linewidth=axvlinewidths,label='P')) | def pick(event): global PLines global P global SLines global S global PErr1Lines global PErr1 global PErr2Lines global PErr2 global SErr1Lines global SErr1 global SErr2Lines global SErr2 global MagMin global MagMinT global MagMinCross global MagMax global MagMaxT global MagMaxCross # Set new P Pick if flagPhase==0 and ... |
xlims=list(axs[0].get_xlim()) ylims=list(axs[0].get_ylim()) | def pick(event): global PLines global P global SLines global S global PErr1Lines global PErr1 global PErr2Lines global PErr2 global SErr1Lines global SErr1 global SErr2Lines global SErr2 global MagMin global MagMinT global MagMinCross global MagMax global MagMaxT global MagMaxCross # Set new P Pick if flagPhase==0 and ... | |
redraw() | axs[0].set_xlim(xlims) axs[0].set_ylim(ylims) redraw() | def pick(event): global PLines global P global SLines global S global PErr1Lines global PErr1 global PErr2Lines global PErr2 global SErr1Lines global SErr1 global SErr2Lines global SErr2 global MagMin global MagMinT global MagMinCross global MagMax global MagMaxT global MagMaxCross # Set new P Pick if flagPhase==0 and ... |
if ev.key == 'alt': | if ev.key == self.keys['switchWheelZoomAxis']: | def __mpl_wheelEvent(self, ev): if self.widgets.qToolButton_showMap.isChecked(): return # Calculate and set new axes boundaries from old ones (left, right) = self.axs[0].get_xbound() (bottom, top) = self.axs[0].get_ybound() if ev.key == 'alt': # Zoom in on wheel-up if ev.button == 'down': top *= 2. bottom *= 2. # Zoom ... |
tmp_keys = keys.copy() | tmp_keys = copy.deepcopy(keys) | def check_keybinding_conflicts(keys): """ check for conflicting keybindings. we have to check twice, because keys for setting picks and magnitudes are allowed to interfere... """ for ignored_key_list in [['setMagMin', 'setMagMax', 'delMagMinMax'], ['setPick', 'setPickError', 'delPick']]: tmp_keys = keys.copy() tmp_keys... |
self.axEventMap = self.fig.add_subplot(111) | bbox = matplotlib.transforms.Bbox.from_extents(0.08, 0.08, 0.92, 0.92) self.axEventMap = self.fig.add_axes(bbox, aspect='equal', adjustable='datalim') | def drawEventMap(self): dM = self.dictMagnitude dO = self.dictOrigin if dO == {}: err = "Error: No hypocenter data!" self._write_err(err) return #toolbar.pan() #XXX self.figEventMap.canvas.widgetlock.release(toolbar) self.axEventMap = self.fig.add_subplot(111) axEM = self.axEventMap axEM.set_aspect('equal', adjustable=... |
axEM.set_aspect('equal', adjustable="datalim") self.fig.subplots_adjust(bottom=0.07, top=0.95, left=0.07, right=0.98) | def drawEventMap(self): dM = self.dictMagnitude dO = self.dictOrigin if dO == {}: err = "Error: No hypocenter data!" self._write_err(err) return #toolbar.pan() #XXX self.figEventMap.canvas.widgetlock.release(toolbar) self.axEventMap = self.fig.add_subplot(111) axEM = self.axEventMap axEM.set_aspect('equal', adjustable=... | |
for dict in self.dicts: | for i, dict in enumerate(self.dicts): | def drawEventMap(self): dM = self.dictMagnitude dO = self.dictOrigin if dO == {}: err = "Error: No hypocenter data!" self._write_err(err) return #toolbar.pan() #XXX self.figEventMap.canvas.widgetlock.release(toolbar) self.axEventMap = self.fig.add_subplot(111) axEM = self.axEventMap axEM.set_aspect('equal', adjustable=... |
nofill=True, fig=fig) | nofill=True, fig=fig, edgecolor='k', linewidth=1., alpha=0.3) | def showFocMec(self): if self.dictFocalMechanism == {}: print "no focal mechanism data." return # make up the figure: fig = plt.figure(1002, figsize=(2, 2)) fig.clear() fig.subplots_adjust(left=0, bottom=0, right=1, top=1) # plot the selected solution Beachball([self.dictFocalMechanism['Strike'], self.dictFocalMechani... |
self.dicts[streamnum]['Ssynth'] = synthsamps | def loadHyp2000Data(self): #self.load3dlocSyntheticPhases() lines = open(self.hyp2000Summary).readlines() if lines == []: print "Error: Did not find Hypo2000 output file" return # goto origin info line while True: try: line = lines.pop(0) except: break if line.startswith(" YEAR MO DA --ORIGIN--"): break try: line = li... | |
Sub(event_type, "user").text = "sysop" | Sub(event_type, "account").text = "sysop" | def dicts2XML(self): """ Returns information of all dictionaries as xml file (type string) """ xml = Element("event") Sub(Sub(xml, "event_id"), "value").text = self.dictEvent['xmlEventID'] event_type = Sub(xml, "event_type") Sub(event_type, "value").text = "manual" |
Sub(event_type, "user").text = self.username | Sub(event_type, "account").text = self.server['User'] Sub(event_type, "user").text = self.username | def dicts2XML(self): """ Returns information of all dictionaries as xml file (type string) """ xml = Element("event") Sub(Sub(xml, "event_id"), "value").text = self.dictEvent['xmlEventID'] event_type = Sub(xml, "event_type") Sub(event_type, "value").text = "manual" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.