source.lon, f_i+1) GMT_string_chopped += '%1.4f %1.4f %1.1f\n'%(source.lat, source.lon, event.magnitude) # calculate theoretical azimut and backazimuth center_array_target = seismosizer.Target(lat=50.241611, lon=12.328142) distance = center_array_target.distance_to(source) azibazi = center_array_target.azibazi_to(source) print 'Azimuth: %s, Backazimuth: %s' %(azibazi) print 'DISTANCE : %s' % distance cmap = plt.cm.jet d = make_array(fn) cfreq = d.T[1] cfreqs = num.unique(cfreq) num_subplots = len(cfreqs) f, axs = plt.subplots(1, num_subplots, subplot_kw=dict(polar=True)) #f2, axlin = plt.subplots(2,1, figsize=(5,3)) f2, axs4 = plt.subplots(1,1, figsize=(3.5,2)) f3, axcom = plt.subplots(1,1, subplot_kw=dict(polar=True), figsize=(3.5,2)) f3.figsize = (4,4) #axs2 = axlin[0] #axs3 = axs2.twinx() #axs4 = axlin[1] theta_max = 0.2 # loop over center frequencies
backaz = num.zeros([num_cfreqs, len(files)]) deviat = num.zeros([num_cfreqs, len(files)]) maxsem = num.zeros([num_cfreqs, len(files)]) for i_f, fn in enumerate(files): flist = fn.split('.')[0] event_time = file_mapping[flist] print 'event time ', event_time for em in markers: if em.tmin==util.str_to_time(event_time): event = em._event source = seismosizer.Source.from_pyrocko_event(event) break azibazi = center_array_target.azibazi_to(source) data = make_array(fn) cfreqs = num.unique(data.T[1]) for i_cfrq, cf in enumerate(cfreqs): d_T = data.T ind = num.where(d_T==cf)[1] t = d_T[0][ind] baz = d_T[3][ind] slo = d_T[2][ind] sem = d_T[5][ind] beamp = d_T[6][ind] semmin = min(sem) semmax = max(sem) ind_semmax = num.where(sem==semmax)[0]