pga_range = pgalims.max() - pgalims.min() plt.figure(figsize=(5, 5)) #get predicted data Rjb_pred = logspace(-1, 2) M = M * ones(len(Rjb_pred)) vs30 = 720 * ones(len(Rjb_pred)) U = zeros(len(Rjb_pred)) NS = zeros(len(Rjb_pred)) RS = zeros(len(Rjb_pred)) SS = ones(len(Rjb_pred)) pred_pga, std_pga = gmpe_tools.bssa14(M, Rjb_pred, vs30, SS=SS, NS=NS, RS=RS, U=U, intensity_measure='PGA') ax = plt.gca() ax.set_yscale('log') ax.set_xscale('log') k = 0 i = arange(46 * k, 46 * (k + 1)) plt.scatter(Rjb[i], PGA[i], lw=0.5, s=40, c='#DC143C') k = 1 i = arange(46 * k, 46 * (k + 1)) plt.scatter(Rjb[i], PGA[i], lw=0.5, s=40, c='#32CD32') k = 2
#Get theoretical GMPE npts = 100 M = 5.3 * ones(npts) Rjb = logspace(0, 2.5, npts) U = zeros(npts) SS = zeros(npts) RS = zeros(npts) NS = ones(npts) vs30 = 760 * ones(npts) #get intensities pga_bssa14, stdev_pga = bssa14(M, Rjb, vs30, U=U, SS=SS, RS=RS, NS=NS, Z1=None, intensity_measure='PGA', italy=True) pgv_bssa14, stdev_pgv = bssa14(M, Rjb, vs30, U=U, SS=SS, RS=RS, NS=NS, Z1=None, intensity_measure='PGV', italy=True) Sa03_bssa14, stdev_Sa03 = bssa14(M,
from numpy import genfromtxt,ones,zeros,savetxt,c_ import gmpe_tools from pyproj import Geod lonlat=genfromtxt('/Users/dmelgar/Downloads/20160718-query.csv',usecols=[1,2],delimiter=',') m=genfromtxt('/Users/dmelgar/Downloads/20160718-query.csv',usecols=[4],delimiter=',') g=Geod(ellps='WGS84') lonsta=-122.9090*ones(len(m)) latsta=39.1060*ones(len(m)) az,baz,dist=g.inv(lonsta,latsta,lonlat[:,1],lonlat[:,0]) dist=dist/1000 vs30=720*ones(len(m)) U=zeros(len(m)) NS=zeros(len(m)) RS=zeros(len(m)) SS=ones(len(m)) pga,stdpga=gmpe_tools.bssa14(m,dist,vs30,intensity_measure='PGA',U=U,NS=NS,RS=RS,SS=SS) pgv,stdpgv=gmpe_tools.bssa14(m,dist,vs30,intensity_measure='PGV',U=U,NS=NS,RS=RS,SS=SS) savetxt('/Users/dmelgar/Downloads/RMA_groundmotion.txt',c_[m,dist,pga,stdpga,pgv,stdpgv],fmt='%.2f\t%.2f\t%.4e\t%.4f\t%.4e\t%.4f',header='M, dist(km), PGA (g), sigma_PGA, PGV (cm/s), sigma_PGV')