load_single_file = False #sl_mean = slice(10, 110, None) sl_mean = slice(None, None, None) trim_stream = 200 ############# script starts here for i in range(len(filters)): for correlation in ProgressBar()(correlations): if correlation[0] == correlation[1]: tws = tws1 else: tws = tws2 try: if not load_single_file: stream = data.readX(correlation, t1, t2, period=period, filter=filters[i], stack=stack) else: stream = data.readX(correlation, t1=None, t2=None, period=period, filter=filters[i], stack=stack) stream = stream.select(time=(t1, t2)) except IOError as ex: print ex print 'Error loading file ... continue with next' continue print stream if len(stream) == 0: continue if USE_TWS_AFTER_SW: dist = data.stations.dist(correlation[0][:-1], correlation[1][:-1]) if dist > 550: continue direct = int(round(dist / 3.))
#events.write('/home/richter/Data/events/events_Tocopilla.txt') events = Events.read('/home/richter/Data/events/events_Tocopilla.txt') events.pick(latitude=lat_Toc, longitude=lon_Toc, minval=0, maxval=100., indegree=False) #events.plot(lat_Toc, lon_Toc, circles=(1,)) method = 'filter2-20_1bit' #method = 'filter0.005_1bit' data = IPOC(xcorr_append='/Tocopilla/' + method, use_local_LVC=True) t1 = UTC('2007-11-01') t2 = UTC('2007-12-01') period = 1800 correlation = ('PB03Z', 'PB03Z') stream = data.readX(correlation, t1, t2, period=period) #stream.filter2(2, 20) stream.setHIForHist(events, period=period) figsize = (8.267, 11.693)[::-1] add_to_title = '_againfilter_zoom1' #save = data.getPlotXCorr(correlation, 'all') + '_againfilter_zoom1 + events.png' save = False stream.plotXcorr(0, 50, imshow=True, use_dlognorm=True, filter=(2, 20), fig=plt.figure(figsize=figsize), figtitle='station ' + add_to_title, dateformatter='%y-%m-%d %Hh%M', save=save, show=True, #dateformatter=' % y % b' plotinfo=('num_events',), #plotinfo_width=0.1, #@UnusedVariable plotlabel=('# events',), #@UnusedVariable plotinfowhere=('right',)) plt.show()
minval=0, maxval=100., indegree=False) #events.plot(lat_Toc, lon_Toc, circles=(1,)) method = 'filter2-20_1bit' #method = 'filter0.005_1bit' data = IPOC(xcorr_append='/Tocopilla/' + method, use_local_LVC=True) t1 = UTC('2007-11-01') t2 = UTC('2007-12-01') period = 1800 correlation = ('PB03Z', 'PB03Z') stream = data.readX(correlation, t1, t2, period=period) #stream.filter2(2, 20) stream.setHIForHist(events, period=period) figsize = (8.267, 11.693)[::-1] add_to_title = '_againfilter_zoom1' #save = data.getPlotXCorr(correlation, 'all') + '_againfilter_zoom1 + events.png' save = False stream.plotXcorr( 0, 50, imshow=True, use_dlognorm=True, filter=(2, 20), fig=plt.figure(figsize=figsize), figtitle='station ' + add_to_title,