rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
'http://ftp.novell.com/pub/%{name}/sources/%{name}/%{name}-%{version}.tar.bz2'
'http://ftp.novell.com/pub/%{name}/sources/%{name}/%{name}-%{version}.tar.bz2', 'patches/mono-runtime-relocation.patch'
def __init__ (self): Package.__init__ (self, 'mono', '2.6.1', sources = [ 'http://ftp.novell.com/pub/%{name}/sources/%{name}/%{name}-%{version}.tar.bz2' ], configure_flags = [ '--with-jit=yes', '--with-ikvm=no', '--with-mcs-docs=no', '--with-moonlight=no', '--enable-quiet-build' ] )
def prep (self): Package.prep (self) self.sh ('patch -p1 < "%{sources[1]}"')
def __init__ (self): Package.__init__ (self, 'mono', '2.6.1', sources = [ 'http://ftp.novell.com/pub/%{name}/sources/%{name}/%{name}-%{version}.tar.bz2' ], configure_flags = [ '--with-jit=yes', '--with-ikvm=no', '--with-mcs-docs=no', '--with-moonlight=no', '--enable-quiet-build' ] )
parser.print_help ()
self.parser.print_help ()
def build (self): packages_to_build = self.cmd_args self.verbose = self.cmd_options.verbose self.run_phases = self.default_run_phases
self.make = 'for((i=0;i<20;i++)); do make && break; done'
def __init__ (self): Package.__init__ (self, 'mono', '2.6.3', sources = [ 'http://ftp.novell.com/pub/%{name}/sources/%{name}/%{name}-%{version}.tar.bz2', 'patches/mono-runtime-relocation.patch' ], configure_flags = [ '--with-jit=yes', '--with-ikvm=no', '--with-mcs-docs=no', '--with-moonlight=no', '--enable-quiet-build'...
DIR_CHANGED = False
DIR_CHANGED = copy_dir_changed
def treewalk(src_dir, dest_dir, callback, dir_updated=None, visit_subdirs=True): '''walk the repository tree, either under overlay/, delete/, or tasks/ and call the callback function for relevant files * if callback is None, no callback function is called * dir_updated is a callback function for directories that have u...
MASTER_OPTS.append(arg)
if arg: MASTER_OPTS.append(arg)
def get_options(): global PASS_ARGS, OPT_SKIP_RSYNC, OPT_AGGREGATE, OPT_VERSION, OPT_CHECK_UPDATE, OPT_DOWNLOAD, MASTER_OPTS
if iorerr.errno == 32:
if ioerr.errno == 32:
def main(): sys.stdout = synctool_unbuffered.Unbuffered(sys.stdout) sys.stderr = synctool_unbuffered.Unbuffered(sys.stderr) (upload_filename, upload_suffix) = get_options() if OPT_VERSION: print synctool_config.VERSION sys.exit(0) if OPT_CHECK_UPDATE: import synctool_update sys.exit(synctool_update.check()) if OPT_...
if host in IGNORE_GROUPS:
if host in ignore_nodes:
def list_all_nodes(): nodes = get_all_nodes() nodes.sort() for host in nodes: if host in IGNORE_GROUPS: if OPT_INTERFACE: host = get_node_interface(host) if not OPT_FILTER_IGNORED: print '%s (ignored)' % host else: if OPT_INTERFACE: host = get_node_interface(host) print host
raise RuntimeError, "node %s is the local node, this is not going to work" % node
run_local_cmd(cmd_args) return
def _run_command(cmd_arr, node, join_char, cmd_args): '''cmd_arr[] is an array that can be passed to e.g. os.execv(), or synctool_lib.popen() cmd_args[] contains the additional arguments to the command The resulting command will be: cmd_arr + node + join_char + cmd_args'''
if groups[-1][:10] == 'interface:':
if len(groups) >= 1 and groups[-1][:10] == 'interface:':
def read_config(): '''read the config file and set a bunch of globals''' global MASTERDIR, MASTER_LEN, DIFF_CMD, SSH_CMD, SCP_CMD, RSYNC_CMD, SYNCTOOL_CMD, LOGFILE, NUM_PROC, SYMLINK_MODE global IGNORE_DOTFILES, IGNORE_DOTDIRS, IGNORE_FILES, IGNORE_GROUPS global ON_UPDATE, ALWAYS_RUN global NODES, INTERFACES, GROUP_DE...
MASTER_OPTS.append(opt) MASTER_OPTS.append(arg)
if opt: MASTER_OPTS.append(opt) if arg: MASTER_OPTS.append(arg)
def get_options(): global NODELIST, GROUPLIST, EXCLUDELIST, EXCLUDEGROUPS, REMOTE_CMD, MASTER_OPTS, OPT_AGGREGATE, OPT_NODENAME if len(sys.argv) <= 1: usage() sys.exit(1) try: opts, args = getopt.getopt(sys.argv[1:], 'hc:vn:g:x:X:aN', ['help', 'conf=', 'verbose', 'node=', 'group=', 'exclude=', 'exclude-group=', 'aggr...
if os.path.isdir(CONF_FILE): filename = os.path.join(filename, CONF_FILE)
def read_config(): '''read the config file and set a bunch of globals''' global MASTERDIR, MASTER_LEN, DIFF_CMD, SSH_CMD, SCP_CMD, RSYNC_CMD, SYNCTOOL_CMD, LOGFILE, NUM_PROC, SYMLINK_MODE global IGNORE_DOTFILES, IGNORE_DOTDIRS, IGNORE_FILES, IGNORE_GROUPS global ON_UPDATE, ALWAYS_RUN global NODES, INTERFACES if os.pa...
`Notes about the com-port`_.
the '``Notes about the com-port``' section in the module docstring.
def __init__(self, com_port, timeout=5): """ initialise OptiCAL
result['authors'] = dict( ( (i,reprAuthor(i,False)) for i in new_authors ) )
result['authors'] = dict( ( (i,db['authors'][i]) for i in new_authors ) )
def addBooks( data, **kwargs ): data = normalizePostData( data, 'books' ) books = {} new_authors = [] for i in data.iteritems(): temp, book = i new_authors.extend( matchBookAuthors( book ) ) book.setdefault('_', {})['version'] = 1 db['last_id'] = db['last_id']+1 book_id = str(db['last_id']) db['books'][book_id] = b...
result['authors'] = dict( ( (i,reprAuthor(i,False)) for i in new_authors ) )
result['authors'] = dict( ( (i,db['authors'][i]) for i in new_authors ) )
def putBook( data, book_id, **kwargs ): if book_id not in db['books']: raise HTTPError( 404, 'Book does not exist' ) new_authors = [] for i in data.iteritems(): path,value = i if path != 'books/' + str(book_id): raise HTTPError( 400, 'Bad PUT data element: ' + path ) if '_' not in value or 'version' not in value['_'...
( (termChar is None) or (accumdata[-1] != termChar)) ):
( (termChar is None) or (not accumdata or (accumdata and accumdata[-1] != chr(termChar)))) ):
def read(self, timeout=None, lock_timeout=0, count=None, termChar=None): """err, reason, result=read([timeout] [,lock_timeout] [,count] [,termChar]) reads up to count bytes from the device, ending on count, EOI or termChar (if specified). See do_timeouts() for semantics of the timeouts. \n the returned reason is an in...
while ( (not err) and (not (reason & 4) ) and ( (count is None) or (accumlen < count)) and ( (termChar is None) or (not accumdata or (accumdata and accumdata[-1] != chr(termChar)))) ):
while ( (not err) and (not (reason & 6) ) and ( (count is None) or (accumlen < count)) ):
def read(self, timeout=None, lock_timeout=0, count=None, termChar=None): """err, reason, result=read([timeout] [,lock_timeout] [,count] [,termChar]) reads up to count bytes from the device, ending on count, EOI or termChar (if specified). See do_timeouts() for semantics of the timeouts. \n the returned reason is an in...
channel.select_timeout_seconds=1.5*max(timeout, lock_timeout)/1000.0
channel.select_timeout_seconds=0.5+1.5*max(timeout, lock_timeout)/1000.0
def do_timeouts(self, timeout, lock_timeout, channel=None): if channel is None: channel=self.core flags=0 if timeout is None: timeout=self.timeout if not lock_timeout and hasattr(self,"default_lock_timeout"): lock_timeout=self.default_lock_timeout if lock_timeout: flags |= 1 # append waitlock bit if channel: c...
millisec = t.microsecond / 1e3 + 0.5
millisec = int(round(t.microsecond / 1e3))
def do3dLoc(self): prog_dict = PROGRAMS['3dloc'] files = prog_dict['files'] self.setXMLEventID() precall = prog_dict['PreCall'] precall(prog_dict)
hundredth = t.microsecond / 1e4 + 0.5
hundredth = int(round(t.microsecond / 1e4))
def dicts2hypo71Phases(self): """ Returns the pick information in self.dicts in hypo71 phase file format as a string. This string can then be written to a file.
t += 1
t_p = UTCDateTime(t) + 1
def dicts2hypo71Phases(self): """ Returns the pick information in self.dicts in hypo71 phase file format as a string. This string can then be written to a file.
date = t.strftime("%y%m%d%H%M%S") + ".%02d" % hundredth
else: t_p = UTCDateTime(t) date = t_p.strftime("%y%m%d%H%M%S") + ".%02d" % hundredth
def dicts2hypo71Phases(self): """ Returns the pick information in self.dicts in hypo71 phase file format as a string. This string can then be written to a file.
hundredth = t2.microsecond / 1e4 + 0.5
hundredth = int(round(t2.microsecond / 1e4))
def dicts2hypo71Phases(self): """ Returns the pick information in self.dicts in hypo71 phase file format as a string. This string can then be written to a file.
if not isinstance(widget, gtk.SpinButton):
if not isinstance(widget, gtk.SpinButton) and \ not isinstance(widget, gtk.Entry):
def nofocus_recursive(widget): # we have to exclude SpinButtons otherwise we cannot put anything into # the spin button if not isinstance(widget, gtk.SpinButton): widget.unset_flags(("GTK_CAN_FOCUS", "GTK_RECEIVES_DEFAULT")) try: children = widget.get_children() except AttributeError: return for widg in children: nofoc...
self.checkbuttonPublicEvent,
self.checkbuttonPublishEvent, self.checkbuttonSysop, self.entrySysopPassword,
def on_togglebuttonShowMap_clicked(self, event): buttons_deactivate = [self.buttonClearAll, self.buttonClearOrigMag, self.buttonClearFocMec, self.buttonDoHyp2000, self.buttonDo3dloc, self.buttonDoNLLoc, self.buttonCalcMag, self.comboboxNLLocModel, self.buttonDoFocmec, self.togglebuttonShowFocMec, self.buttonNextFocMec,...
self.checkbuttonPublicEvent,
self.checkbuttonPublishEvent, self.checkbuttonSysop, self.entrySysopPassword,
def on_togglebuttonShowFocMec_clicked(self, event): buttons_deactivate = [self.buttonClearAll, self.buttonClearOrigMag, self.buttonClearFocMec, self.buttonDoHyp2000, self.buttonDo3dloc, self.buttonDoNLLoc, self.buttonCalcMag, self.comboboxNLLocModel, self.buttonDoFocmec, self.togglebuttonShowMap, self.togglebuttonShowW...
self.checkbuttonPublicEvent,
self.checkbuttonPublishEvent, self.checkbuttonSysop, self.entrySysopPassword,
def on_togglebuttonShowWadati_clicked(self, event): buttons_deactivate = [self.buttonClearAll, self.buttonClearOrigMag, self.buttonClearFocMec, self.buttonDoHyp2000, self.buttonDo3dloc, self.buttonDoNLLoc, self.buttonCalcMag, self.comboboxNLLocModel, self.buttonDoFocmec, self.togglebuttonShowFocMec, self.buttonNextFocM...
def on_checkbuttonPublicEvent_toggled(self, event): newstate = self.checkbuttonPublicEvent.get_active()
def on_checkbuttonPublishEvent_toggled(self, event): newstate = self.checkbuttonPublishEvent.get_active()
def on_checkbuttonPublicEvent_toggled(self, event): newstate = self.checkbuttonPublicEvent.get_active() msg = "Setting \"public\" flag of event to: %s" % newstate self.textviewStdOutImproved.write(msg)
self.checkbuttonPublicEvent = \ self.gla.get_widget("checkbuttonPublicEvent")
self.checkbuttonPublishEvent = \ self.gla.get_widget("checkbuttonPublishEvent")
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.flagWheelZoom = True #Switch use of mousewheel for zooming #this next flag indicates if we zoom on time or amplitude axis self....
Returns information of all dictionaries as xml file
Returns information of all dictionaries as xml file (type string)
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(event_type, "user").text = self.username
if self.checkbuttonSysop.get_active(): Sub(event_type, "user").text = "sysop" else: Sub(event_type, "user").text = self.username
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...
self.checkbuttonPublicEvent.get_active()
self.checkbuttonPublishEvent.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...
userid = "admin" passwd = "admin"
if self.checkbuttonSysop.get_active(): userid = "sysop" passwd = self.entrySysopPassword.get_text() else: userid = "obspyck" passwd = "obspyck"
def uploadSeishub(self): """ Upload xml file to seishub """ userid = "admin" passwd = "admin"
userid = "admin" passwd = "admin"
if self.checkbuttonSysop.get_active(): userid = "sysop" passwd = self.entrySysopPassword.get_text() else: userid = "obspyck" passwd = "obspyck"
def deleteEventInSeishub(self, resource_name): """ Delete xml file from seishub. (Move to seishubs trash folder if this option is activated) """ userid = "admin" passwd = "admin"
auth = base64.encodestring('%s:%s' % ("admin", "admin"))[:-1]
auth = base64.encodestring('%s:%s' % ("obspyck", "obspyck"))[:-1]
def getEventFromSeishub(self, resource_name): #document = xml.xpath(".//document_id") #document_id = document[self.seishubEventCurrent].text # Hack to show xml resource as document id resource_url = self.server['BaseUrl'] + "/xml/seismology/event/" + \ resource_name resource_req = urllib2.Request(resource_url) auth = b...
auth = base64.encodestring('%s:%s' % ("admin", "admin"))[:-1]
auth = base64.encodestring('%s:%s' % ("obspyck", "obspyck"))[:-1]
def updateEventListFromSeishub(self, starttime, endtime): """ Searches for events in the database and stores a list of resource names. All events with at least one pick set in between start- and endtime are returned.
parser.add_option("--user", dest="user", default='admin',
parser.add_option("--user", dest="user", default='obspyck',
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'", default='2009-07-21T04:33:00') parser....
parser.add_option("--password", dest="password", default='admin',
parser.add_option("--password", dest="password", default='obspyck',
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'", default='2009-07-21T04:33:00') parser....
'hyp2000 < bay2000.inp &> /dev/null'
'./hyp2000 < bay2000.inp &> /dev/null'
def __init__(self, streams = None, options = None): 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={'Bandpass':0, 'Bandstop':1, 'Lowpa...
class ItemProperties: def __init__(self, fontsize=12, labelcolor='black', bgcolor='lightgrey', alpha=1.0): self.fontsize = fontsize self.labelcolor = labelcolor self.bgcolor = bgcolor self.alpha = alpha self.labelcolor_rgb = colors.colorConverter.to_rgb(labelcolor) self.bgcolor_rgb = colors.colorConverter.to_rgb(bgcolo...
def __init__(self, canvas, axes, useblit=True, **lineprops): self.canvas = canvas self.axes = axes xmin, xmax = axes[-1].get_xlim() xmid = 0.5*(xmin+xmax) self.lines = [ax.axvline(xmid, visible=False, **lineprops) for ax in axes] self.visible = True self.useblit = useblit self.background = None self.needclear = False s...
def on_buttonDebug_clicked(self, event): self.debug() def on_buttonSetFocusOnPlot_clicked(self, event): self.setFocusToMatplotlib() def on_mplbutton_clicked(event): """callback for a click on the button""" st = read(entry.get_text()) update_graph(fig, ax, st) return st def on_mplopenmenuitem_activate(event): """ca...
def on_togglebuttonFilter_toggled(self, event): self.updatePlot() def on_checkbuttonZeroPhase_toggled(self, event): if self.togglebuttonFilter.get_active(): self.updatePlot() def on_spinbuttonHighpass_value_changed(self, event): if self.spinbuttonLowpass.get_value() < self.spinbuttonHighpass.get_value(): err = "Wa...
def on_buttonDebug_clicked(self, event): self.debug()
self.flagPublicEvent = True
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...
d['on_windowObspyck_destroy'] = self.on_windowObspyck_destroy d['on_buttonQuit_clicked'] = self.on_buttonQuit_clicked d['on_buttonDebug_clicked'] = self.on_buttonDebug_clicked d['on_buttonSetFocusOnPlot_clicked'] = self.on_buttonSetFocusOnPlot_clicked
for func in dir(self): if func.startswith("on_"): exec("d['%s'] = self.%s" % (func, func))
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...
place1 = self.gla.get_widget("vbox2")
place1 = self.gla.get_widget("hboxObspyck")
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...
comboboxPhaseType = self.gla.get_widget("comboboxPhaseType") comboboxPhaseType.set_active(0) comboboxFilterType = self.gla.get_widget("comboboxFilterType") comboboxFilterType.set_active(0)
self.toolbar.zoom() self.canv.widgetlock.release(self.toolbar) self.checkbuttonPublicEvent = \ self.gla.get_widget("checkbuttonPublicEvent") self.comboboxPhaseType = self.gla.get_widget("comboboxPhaseType") self.togglebuttonFilter = self.gla.get_widget("togglebuttonFilter") self.comboboxFilterType = self.gla.get_widg...
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.addFiltButtons()
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.addSliders()
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.fig.subplots_adjust(bottom=0.20, hspace=0.01, right=0.999, top=0.95, left=0.18)
self.fig.subplots_adjust(bottom=0.10, hspace=0.01, right=0.999, top=0.95, left=0.08)
def drawAxes(self): #XXX wanted to change to seconds on x-axis but there is one problem: # during picking it's convenient to round to the nearest sample # with float seconds on the x-axis it's not so easy anymore npts = self.streams[self.stPt][0].stats.npts smprt = self.streams[self.stPt][0].stats.sampling_rate dt = 1....
print "P Pick deleted"
msg = "P Pick deleted" appendTextview(self.textviewStdOut, msg)
def delP(self): try: del self.dicts[self.stPt]['P'] print "P Pick deleted" except: pass
print "synthetic P Pick deleted"
msg = "synthetic P Pick deleted" appendTextview(self.textviewStdOut, msg)
def delPsynth(self): try: del self.dicts[self.stPt]['Psynth'] print "synthetic P Pick deleted" except: pass
print "P Pick weight deleted"
msg = "P Pick weight deleted" appendTextview(self.textviewStdOut, msg)
def delPWeight(self): try: del self.dicts[self.stPt]['PWeight'] print "P Pick weight deleted" except: pass
print "P Pick polarity deleted"
msg = "P Pick polarity deleted" appendTextview(self.textviewStdOut, msg)
def delPPol(self): try: del self.dicts[self.stPt]['PPol'] print "P Pick polarity deleted" except: pass
print "P Pick onset deleted"
msg = "P Pick onset deleted" appendTextview(self.textviewStdOut, msg)
def delPOnset(self): try: del self.dicts[self.stPt]['POnset'] print "P Pick onset deleted" except: pass
print "PErr1 Pick deleted"
msg = "PErr1 Pick deleted" appendTextview(self.textviewStdOut, msg)
def delPErr1(self): try: del self.dicts[self.stPt]['PErr1'] print "PErr1 Pick deleted" except: pass
print "PErr2 Pick deleted"
msg = "PErr2 Pick deleted" appendTextview(self.textviewStdOut, msg)
def delPErr2(self): try: del self.dicts[self.stPt]['PErr2'] print "PErr2 Pick deleted" except: pass
print "S Pick deleted"
msg = "S Pick deleted" appendTextview(self.textviewStdOut, msg)
def delS(self): try: del self.dicts[self.stPt]['S'] del self.dicts[self.stPt]['Saxind'] print "S Pick deleted" except: pass
print "synthetic S Pick deleted"
msg = "synthetic S Pick deleted" appendTextview(self.textviewStdOut, msg)
def delSsynth(self): try: del self.dicts[self.stPt]['Ssynth'] print "synthetic S Pick deleted" except: pass
print "S Pick weight deleted"
msg = "S Pick weight deleted" appendTextview(self.textviewStdOut, msg)
def delSWeight(self): try: del self.dicts[self.stPt]['SWeight'] print "S Pick weight deleted" except: pass
print "S Pick polarity deleted"
msg = "S Pick polarity deleted" appendTextview(self.textviewStdOut, msg)
def delSPol(self): try: del self.dicts[self.stPt]['SPol'] print "S Pick polarity deleted" except: pass
print "S Pick onset deleted"
msg = "S Pick onset deleted" appendTextview(self.textviewStdOut, msg)
def delSOnset(self): try: del self.dicts[self.stPt]['SOnset'] print "S Pick onset deleted" except: pass
print "SErr1 Pick deleted"
msg = "SErr1 Pick deleted" appendTextview(self.textviewStdOut, msg)
def delSErr1(self): try: del self.dicts[self.stPt]['SErr1'] print "SErr1 Pick deleted" except: pass
print "SErr2 Pick deleted"
msg = "SErr2 Pick deleted" appendTextview(self.textviewStdOut, msg)
def delSErr2(self): try: del self.dicts[self.stPt]['SErr2'] print "SErr2 Pick deleted" except: pass
print "Magnitude Minimum Estimation Pick deleted"
msg = "Magnitude Minimum Estimation Pick deleted" appendTextview(self.textviewStdOut, msg)
def delMagMin1(self): try: del self.dicts[self.stPt]['MagMin1'] del self.dicts[self.stPt]['MagMin1T'] print "Magnitude Minimum Estimation Pick deleted" except: pass
print "Magnitude Maximum Estimation Pick deleted"
msg = "Magnitude Maximum Estimation Pick deleted" appendTextview(self.textviewStdOut, msg)
def delMagMax1(self): try: del self.dicts[self.stPt]['MagMax1'] del self.dicts[self.stPt]['MagMax1T'] print "Magnitude Maximum Estimation Pick deleted" except: pass
print "Magnitude Minimum Estimation Pick deleted"
msg = "Magnitude Minimum Estimation Pick deleted" appendTextview(self.textviewStdOut, msg)
def delMagMin2(self): try: del self.dicts[self.stPt]['MagMin2'] del self.dicts[self.stPt]['MagMin2T'] print "Magnitude Minimum Estimation Pick deleted" except: pass
print "Magnitude Maximum Estimation Pick deleted"
msg = "Magnitude Maximum Estimation Pick deleted" appendTextview(self.textviewStdOut, msg)
def delMagMax2(self): try: del self.dicts[self.stPt]['MagMax2'] del self.dicts[self.stPt]['MagMax2T'] print "Magnitude Maximum Estimation Pick deleted" except: pass
self.check = CheckButtons(self.axFilt, ('Filter','Zero-Phase','Spectrogram','Public Event'),(self.flagFilt,self.flagFiltZPH,self.flagSpectrogram,self.flagPublicEvent))
self.check = CheckButtons(self.axFilt, ('Filter','Zero-Phase','Spectrogram','Public Event'),(False,False,self.flagSpectrogram,False))
def addFiltButtons(self): #add filter buttons self.axFilt = self.fig.add_axes([0.22, 0.02, 0.15, 0.15],frameon=False,axisbg='lightgrey') self.check = CheckButtons(self.axFilt, ('Filter','Zero-Phase','Spectrogram','Public Event'),(self.flagFilt,self.flagFiltZPH,self.flagSpectrogram,self.flagPublicEvent)) self.check.on_c...
self.axPhase = self.fig.add_axes([0.10, 0.02, 0.10, 0.15],frameon=False,axisbg='lightgrey')
self.axPhase = self.fig.add_axes([0.05, 0.02, 0.05, 0.05],frameon=False,axisbg='lightgrey')
def addPhaseButtons(self): #add phase buttons self.axPhase = self.fig.add_axes([0.10, 0.02, 0.10, 0.15],frameon=False,axisbg='lightgrey') self.radioPhase = RadioButtons(self.axPhase, ('P', 'S', 'Mag'),activecolor='k') self.radioPhase.on_clicked(self.funcPhase)
if not self.flagFilt or self.flagFiltTyp == 2:
if not self.togglebuttonFilter.get_active() or self.flagFiltTyp == 2:
def updateLow(self,val): if not self.flagFilt or self.flagFiltTyp == 2: return else: self.updatePlot()
if not self.flagFilt or self.flagFiltTyp == 3:
if not self.togglebuttonFilter.get_active() or self.flagFiltTyp == 3:
def updateHigh(self,val): if not self.flagFilt or self.flagFiltTyp == 3: return else: self.updatePlot()
def delSliders(self): self.valFiltHigh = self.slideHigh.val self.valFiltLow = self.slideLow.val try: self.fig.delaxes(self.axHighpass) self.fig.delaxes(self.axLowpass) except: return def addSliders(self): self.axHighpass = self.fig.add_axes([0.63, 0.05, 0.30, 0.03], xscale='log') self.axLowpass = self.fig.add_axes([...
def delSliders(self): self.valFiltHigh = self.slideHigh.val self.valFiltLow = self.slideLow.val try: self.fig.delaxes(self.axHighpass) self.fig.delaxes(self.axLowpass) except: return
if self.flagFilt==True: if self.flagFiltZPH:
if self.togglebuttonFilter.get_active(): if self.checkbuttonZeroPhase.get_active():
def updatePlot(self): filt=[] #filter data if self.flagFilt==True: if self.flagFiltZPH: if self.flagFiltTyp==0: for tr in self.streams[self.stPt].traces: filt.append(bandpassZPHSH(tr.data,self.slideHigh.val,self.slideLow.val,df=tr.stats.sampling_rate)) print "Zero-Phase Bandpass: %.2f-%.2f Hz"%(self.slideHigh.val,self....
filt.append(bandpassZPHSH(tr.data,self.slideHigh.val,self.slideLow.val,df=tr.stats.sampling_rate)) print "Zero-Phase Bandpass: %.2f-%.2f Hz"%(self.slideHigh.val,self.slideLow.val)
filt.append(bandpassZPHSH(tr.data,self.spinbuttonHighpass.get_value(),self.spinbuttonLowpass.get_value(),df=tr.stats.sampling_rate)) msg = "Zero-Phase Bandpass: %.2f-%.2f Hz"%(self.spinbuttonHighpass.get_value(),self.spinbuttonLowpass.get_value()) appendTextview(self.textviewStdOut, msg)
def updatePlot(self): filt=[] #filter data if self.flagFilt==True: if self.flagFiltZPH: if self.flagFiltTyp==0: for tr in self.streams[self.stPt].traces: filt.append(bandpassZPHSH(tr.data,self.slideHigh.val,self.slideLow.val,df=tr.stats.sampling_rate)) print "Zero-Phase Bandpass: %.2f-%.2f Hz"%(self.slideHigh.val,self....
filt.append(bandstopZPHSH(tr.data,self.slideHigh.val,self.slideLow.val,df=tr.stats.sampling_rate)) print "Zero-Phase Bandstop: %.2f-%.2f Hz"%(self.slideHigh.val,self.slideLow.val)
filt.append(bandstopZPHSH(tr.data,self.spinbuttonHighpass.get_value(),self.spinbuttonLowpass.get_value(),df=tr.stats.sampling_rate)) msg = "Zero-Phase Bandstop: %.2f-%.2f Hz"%(self.spinbuttonHighpass.get_value(),self.spinbuttonLowpass.get_value()) appendTextview(self.textviewStdOut, msg)
def updatePlot(self): filt=[] #filter data if self.flagFilt==True: if self.flagFiltZPH: if self.flagFiltTyp==0: for tr in self.streams[self.stPt].traces: filt.append(bandpassZPHSH(tr.data,self.slideHigh.val,self.slideLow.val,df=tr.stats.sampling_rate)) print "Zero-Phase Bandpass: %.2f-%.2f Hz"%(self.slideHigh.val,self....
filt.append(lowpassZPHSH(tr.data,self.slideLow.val,df=tr.stats.sampling_rate)) print "Zero-Phase Lowpass: %.2f Hz"%(self.slideLow.val)
filt.append(lowpassZPHSH(tr.data,self.spinbuttonLowpass.get_value(),df=tr.stats.sampling_rate)) msg = "Zero-Phase Lowpass: %.2f Hz"%(self.spinbuttonLowpass.get_value()) appendTextview(self.textviewStdOut, msg)
def updatePlot(self): filt=[] #filter data if self.flagFilt==True: if self.flagFiltZPH: if self.flagFiltTyp==0: for tr in self.streams[self.stPt].traces: filt.append(bandpassZPHSH(tr.data,self.slideHigh.val,self.slideLow.val,df=tr.stats.sampling_rate)) print "Zero-Phase Bandpass: %.2f-%.2f Hz"%(self.slideHigh.val,self....
filt.append(highpassZPHSH(tr.data,self.slideHigh.val,df=tr.stats.sampling_rate)) print "Zero-Phase Highpass: %.2f Hz"%(self.slideHigh.val)
filt.append(highpassZPHSH(tr.data,self.spinbuttonHighpass.get_value(),df=tr.stats.sampling_rate)) msg = "Zero-Phase Highpass: %.2f Hz"%(self.spinbuttonHighpass.get_value()) appendTextview(self.textviewStdOut, msg)
def updatePlot(self): filt=[] #filter data if self.flagFilt==True: if self.flagFiltZPH: if self.flagFiltTyp==0: for tr in self.streams[self.stPt].traces: filt.append(bandpassZPHSH(tr.data,self.slideHigh.val,self.slideLow.val,df=tr.stats.sampling_rate)) print "Zero-Phase Bandpass: %.2f-%.2f Hz"%(self.slideHigh.val,self....
filt.append(bandpass(tr.data,self.slideHigh.val,self.slideLow.val,df=tr.stats.sampling_rate)) print "One-Pass Bandpass: %.2f-%.2f Hz"%(self.slideHigh.val,self.slideLow.val)
filt.append(bandpass(tr.data,self.spinbuttonHighpass.get_value(),self.spinbuttonLowpass.get_value(),df=tr.stats.sampling_rate)) msg = "One-Pass Bandpass: %.2f-%.2f Hz"%(self.spinbuttonHighpass.get_value(),self.spinbuttonLowpass.get_value()) appendTextview(self.textviewStdOut, msg)
def updatePlot(self): filt=[] #filter data if self.flagFilt==True: if self.flagFiltZPH: if self.flagFiltTyp==0: for tr in self.streams[self.stPt].traces: filt.append(bandpassZPHSH(tr.data,self.slideHigh.val,self.slideLow.val,df=tr.stats.sampling_rate)) print "Zero-Phase Bandpass: %.2f-%.2f Hz"%(self.slideHigh.val,self....
filt.append(bandstop(tr.data,self.slideHigh.val,self.slideLow.val,df=tr.stats.sampling_rate)) print "One-Pass Bandstop: %.2f-%.2f Hz"%(self.slideHigh.val,self.slideLow.val)
filt.append(bandstop(tr.data,self.spinbuttonHighpass.get_value(),self.spinbuttonLowpass.get_value(),df=tr.stats.sampling_rate)) msg = "One-Pass Bandstop: %.2f-%.2f Hz"%(self.spinbuttonHighpass.get_value(),self.spinbuttonLowpass.get_value()) appendTextview(self.textviewStdOut, msg)
def updatePlot(self): filt=[] #filter data if self.flagFilt==True: if self.flagFiltZPH: if self.flagFiltTyp==0: for tr in self.streams[self.stPt].traces: filt.append(bandpassZPHSH(tr.data,self.slideHigh.val,self.slideLow.val,df=tr.stats.sampling_rate)) print "Zero-Phase Bandpass: %.2f-%.2f Hz"%(self.slideHigh.val,self....
filt.append(lowpass(tr.data,self.slideLow.val,df=tr.stats.sampling_rate)) print "One-Pass Lowpass: %.2f Hz"%(self.slideLow.val)
filt.append(lowpass(tr.data,self.spinbuttonLowpass.get_value(),df=tr.stats.sampling_rate)) msg = "One-Pass Lowpass: %.2f Hz"%(self.spinbuttonLowpass.get_value()) appendTextview(self.textviewStdOut, msg)
def updatePlot(self): filt=[] #filter data if self.flagFilt==True: if self.flagFiltZPH: if self.flagFiltTyp==0: for tr in self.streams[self.stPt].traces: filt.append(bandpassZPHSH(tr.data,self.slideHigh.val,self.slideLow.val,df=tr.stats.sampling_rate)) print "Zero-Phase Bandpass: %.2f-%.2f Hz"%(self.slideHigh.val,self....
filt.append(highpass(tr.data,self.slideHigh.val,df=tr.stats.sampling_rate)) print "One-Pass Highpass: %.2f Hz"%(self.slideHigh.val)
filt.append(highpass(tr.data,self.spinbuttonHighpass.get_value(),df=tr.stats.sampling_rate)) msg = "One-Pass Highpass: %.2f Hz"%(self.spinbuttonHighpass.get_value()) appendTextview(self.textviewStdOut, msg)
def updatePlot(self): filt=[] #filter data if self.flagFilt==True: if self.flagFiltZPH: if self.flagFiltTyp==0: for tr in self.streams[self.stPt].traces: filt.append(bandpassZPHSH(tr.data,self.slideHigh.val,self.slideLow.val,df=tr.stats.sampling_rate)) print "Zero-Phase Bandpass: %.2f-%.2f Hz"%(self.slideHigh.val,self....
print "Unfiltered Traces"
msg = "Unfiltered Traces" appendTextview(self.textviewStdOut, msg)
def updatePlot(self): filt=[] #filter data if self.flagFilt==True: if self.flagFiltZPH: if self.flagFiltTyp==0: for tr in self.streams[self.stPt].traces: filt.append(bandpassZPHSH(tr.data,self.slideHigh.val,self.slideLow.val,df=tr.stats.sampling_rate)) print "Zero-Phase Bandpass: %.2f-%.2f Hz"%(self.slideHigh.val,self....
self.flagFilt=not self.flagFilt self.updatePlot()
print "DEPRECATED!" raise
def funcFilt(self, label): if label=='Filter': self.flagFilt=not self.flagFilt self.updatePlot() elif label=='Zero-Phase': self.flagFiltZPH=not self.flagFiltZPH if self.flagFilt: self.updatePlot() elif label=='Spectrogram': self.flagSpectrogram = not self.flagSpectrogram self.delAxes() self.drawAxes() self.fig.canvas.d...
self.flagFiltZPH=not self.flagFiltZPH if self.flagFilt: self.updatePlot()
print "DEPRECATED!" raise
def funcFilt(self, label): if label=='Filter': self.flagFilt=not self.flagFilt self.updatePlot() elif label=='Zero-Phase': self.flagFiltZPH=not self.flagFiltZPH if self.flagFilt: self.updatePlot() elif label=='Spectrogram': self.flagSpectrogram = not self.flagSpectrogram self.delAxes() self.drawAxes() self.fig.canvas.d...
elif label=='Public Event': self.flagPublicEvent = not self.flagPublicEvent print "setting \"public\" flag of event to: %s" % \ self.flagPublicEvent
def funcFilt(self, label): if label=='Filter': self.flagFilt=not self.flagFilt self.updatePlot() elif label=='Zero-Phase': self.flagFiltZPH=not self.flagFiltZPH if self.flagFilt: self.updatePlot() elif label=='Spectrogram': self.flagSpectrogram = not self.flagSpectrogram self.delAxes() self.drawAxes() self.fig.canvas.d...
if self.flagFilt:
if self.togglebuttonFilter.get_active():
def funcFiltTyp(self, label): self.flagFiltTyp=self.dictFiltTyp[label] if self.flagFilt: self.updatePlot()
print "P Pick set at %.3f" % self.dicts[self.stPt]['P']
msg = "P Pick set at %.3f" % self.dicts[self.stPt]['P'] appendTextview(self.textviewStdOut, msg)
def pick(self, event): #import ipdb; ipdb.set_trace() #We want to round from the picking location to #the time value of the nearest time sample: samp_rate = self.streams[self.stPt][0].stats.sampling_rate pickSample = event.xdata * samp_rate pickSample = round(pickSample) pickSample = pickSample / samp_rate # we need th...
print "P Pick weight set to %i"%self.dicts[self.stPt]['PWeight']
msg = "P Pick weight set to %i"%self.dicts[self.stPt]['PWeight'] appendTextview(self.textviewStdOut, msg)
def pick(self, event): #import ipdb; ipdb.set_trace() #We want to round from the picking location to #the time value of the nearest time sample: samp_rate = self.streams[self.stPt][0].stats.sampling_rate pickSample = event.xdata * samp_rate pickSample = round(pickSample) pickSample = pickSample / samp_rate # we need th...
print "P Pick polarity set to %s"%self.dicts[self.stPt]['PPol']
msg = "P Pick polarity set to %s"%self.dicts[self.stPt]['PPol'] appendTextview(self.textviewStdOut, msg)
def pick(self, event): #import ipdb; ipdb.set_trace() #We want to round from the picking location to #the time value of the nearest time sample: samp_rate = self.streams[self.stPt][0].stats.sampling_rate pickSample = event.xdata * samp_rate pickSample = round(pickSample) pickSample = pickSample / samp_rate # we need th...
print "P pick onset set to %s" % self.dicts[self.stPt]['POnset']
msg = "P pick onset set to %s" % self.dicts[self.stPt]['POnset'] appendTextview(self.textviewStdOut, msg)
def pick(self, event): #import ipdb; ipdb.set_trace() #We want to round from the picking location to #the time value of the nearest time sample: samp_rate = self.streams[self.stPt][0].stats.sampling_rate pickSample = event.xdata * samp_rate pickSample = round(pickSample) pickSample = pickSample / samp_rate # we need th...
print "S Pick set at %.3f" % self.dicts[self.stPt]['S']
msg = "S Pick set at %.3f" % self.dicts[self.stPt]['S'] appendTextview(self.textviewStdOut, msg)
def pick(self, event): #import ipdb; ipdb.set_trace() #We want to round from the picking location to #the time value of the nearest time sample: samp_rate = self.streams[self.stPt][0].stats.sampling_rate pickSample = event.xdata * samp_rate pickSample = round(pickSample) pickSample = pickSample / samp_rate # we need th...
print "S Pick weight set to %i"%self.dicts[self.stPt]['SWeight']
msg = "S Pick weight set to %i"%self.dicts[self.stPt]['SWeight'] appendTextview(self.textviewStdOut, msg)
def pick(self, event): #import ipdb; ipdb.set_trace() #We want to round from the picking location to #the time value of the nearest time sample: samp_rate = self.streams[self.stPt][0].stats.sampling_rate pickSample = event.xdata * samp_rate pickSample = round(pickSample) pickSample = pickSample / samp_rate # we need th...
print "S Pick polarity set to %s"%self.dicts[self.stPt]['SPol']
msg = "S Pick polarity set to %s"%self.dicts[self.stPt]['SPol'] appendTextview(self.textviewStdOut, msg)
def pick(self, event): #import ipdb; ipdb.set_trace() #We want to round from the picking location to #the time value of the nearest time sample: samp_rate = self.streams[self.stPt][0].stats.sampling_rate pickSample = event.xdata * samp_rate pickSample = round(pickSample) pickSample = pickSample / samp_rate # we need th...
print "S pick onset set to %s" % self.dicts[self.stPt]['SOnset']
msg = "S pick onset set to %s" % self.dicts[self.stPt]['SOnset'] appendTextview(self.textviewStdOut, msg)
def pick(self, event): #import ipdb; ipdb.set_trace() #We want to round from the picking location to #the time value of the nearest time sample: samp_rate = self.streams[self.stPt][0].stats.sampling_rate pickSample = event.xdata * samp_rate pickSample = round(pickSample) pickSample = pickSample / samp_rate # we need th...
print "P Error Pick 1 set at %.3f" % \
msg = "P Error Pick 1 set at %.3f" % \
def pick(self, event): #import ipdb; ipdb.set_trace() #We want to round from the picking location to #the time value of the nearest time sample: samp_rate = self.streams[self.stPt][0].stats.sampling_rate pickSample = event.xdata * samp_rate pickSample = round(pickSample) pickSample = pickSample / samp_rate # we need th...
print "P Error Pick 2 set at %.3f" % \
msg = "P Error Pick 2 set at %.3f" % \
def pick(self, event): #import ipdb; ipdb.set_trace() #We want to round from the picking location to #the time value of the nearest time sample: samp_rate = self.streams[self.stPt][0].stats.sampling_rate pickSample = event.xdata * samp_rate pickSample = round(pickSample) pickSample = pickSample / samp_rate # we need th...
print "S Error Pick 1 set at %.3f" % \
msg = "S Error Pick 1 set at %.3f" % \
def pick(self, event): #import ipdb; ipdb.set_trace() #We want to round from the picking location to #the time value of the nearest time sample: samp_rate = self.streams[self.stPt][0].stats.sampling_rate pickSample = event.xdata * samp_rate pickSample = round(pickSample) pickSample = pickSample / samp_rate # we need th...
print "S Error Pick 2 set at %.3f" % \
msg = "S Error Pick 2 set at %.3f" % \
def pick(self, event): #import ipdb; ipdb.set_trace() #We want to round from the picking location to #the time value of the nearest time sample: samp_rate = self.streams[self.stPt][0].stats.sampling_rate pickSample = event.xdata * samp_rate pickSample = round(pickSample) pickSample = pickSample / samp_rate # we need th...
print "Minimum for magnitude estimation set: %s at %.3f" % \
msg = "Minimum for magnitude estimation set: %s at %.3f" % \
def pick(self, event): #import ipdb; ipdb.set_trace() #We want to round from the picking location to #the time value of the nearest time sample: samp_rate = self.streams[self.stPt][0].stats.sampling_rate pickSample = event.xdata * samp_rate pickSample = round(pickSample) pickSample = pickSample / samp_rate # we need th...
print "Maximum for magnitude estimation set: %s at %.3f" % \
msg = "Maximum for magnitude estimation set: %s at %.3f" % \
def pick(self, event): #import ipdb; ipdb.set_trace() #We want to round from the picking location to #the time value of the nearest time sample: samp_rate = self.streams[self.stPt][0].stats.sampling_rate pickSample = event.xdata * samp_rate pickSample = round(pickSample) pickSample = pickSample / samp_rate # we need th...
print "Resetting axes"
msg = "Resetting axes" appendTextview(self.textviewStdOut, msg)
def zoom_reset(self,event): if event.button==2: # Use Z trace limits as boundaries self.axs[0].set_xbound(lower=self.xMin,upper=self.xMax) self.axs[0].set_ybound(lower=self.yMin,upper=self.yMax) # Update all subplots self.redraw() print "Resetting axes"