import numpy as num uncertainty=False output_path='/Users/francesco/Desktop/Single_Station_Location/MOLQUAKE_V_0.3/ridge_2staz' data_path='/Users/francesco/Desktop/Single_Station_Location/MOLQUAKE_V_0.3/ridge_2staz' datafiles=['ridgecrest_refcat_15.dat','ridgecrest_picks_2sta_15.dat'] catalogue_file='refcat_15.dat' out_catalogue='outcat_ridgecrest_two_stations.txt' Vp=6000 #velocities in m/s !!!!! Vps=1.73 Vs=Vp/Vps nref=20 datafile='ridgecrest_Vp_'+str(Vp) dataobj=molquake.molquake_dat(data_path,datafiles,one_sta=False) locobj=molquake.molquake_loc(Vp,Vs) references=dataobj.references nref=num.size(references[:,0]) locobj.location_2stations(dataobj.data, references) catevs=dataobj.read_catalogue(data_path,catalogue_file) locobj.catalogue_creation(dataobj.evids, dataobj.origin, nref, out_catalogue, output_path) if uncertainty: print('uncertainty estimation') multiloc=locobj.uncertainty_estimation_2sta(dataobj.data, references, 25, [5500,6500], 1.73) locboot=num.array([0.,0.,0]) for i in range(25): locboot=num.vstack((locboot,multiloc[i,:,:])) num.save('locboot_real.npy',locboot) num.save('locreal.npy',dataobj.references) num.save('catevs.npy',catevs)
path = '/Users/francesco/Desktop/Single_Station_Location/Synthetic_data' data_path = '/Users/francesco/Desktop/Single_Station_Location/' filecat = 'catalogue' filepicks = 'picks' offset = 10000 extension = 1000 Vp = 6500 Vs = Vp / num.sqrt(3) kv = (Vp * Vs) / (Vp - Vs) data = num.load(path + '/synth1.data.mol.npy') references = num.load(path + '/synth1.reference.mol.npy') references = references[:10, :] data = num.sqrt(data[:, 0]**2 + data[:, 1]**2 + data[:, 2]**2) / kv objloc = molquake.molquake_loc(offset, extension) Vpmin = 6000 Vpmax = 7000 locations = objloc.location(data, references, Vp, Vs) num.save('locations_single.npy', locations) for i in range(1): Vp = Vpmin + (2 * num.random.random_sample() - 1) * (Vpmax - Vpmin) Vs = Vp / num.sqrt(3) locs = objloc.location(data, references, Vp, Vs) locations = num.vstack((locations, locs)) num.save('locations_bootstrap.npy', locations) #multiloc=objloc.uncertainty_estimation(data, references, 1, [5.4, 5.6], num.sqrt(3)) #print(num.shape(multiloc)) #data=data_in_sphere(n_points, radius=1000, origin_shift=10000.) #references=data_in_sphere(n_points, radius=1000, origin_shift=10000.)