import viscojapan as vj f1 = vj.EpochalG('../G_Rake66.h5') G1 = f1[0] f2 = vj.EpochalG('../G_Rake90.h5') G2 = f2[0] f3 = vj.EpochalG('../G_Rake95.h5') G3 = f3[0] fno = 285 bm = vj.MyBasemap(region_code='near') scale = 2e-2 mplt = vj.MapPlotDisplacement(basemap=bm) mplt.plot_disp(G1[:, fno], f1.sites, scale=scale) mplt.plot_disp(G2[:, fno], f2.sites, scale=scale, color='red') mplt.plot_disp(G3[:, fno], f3.sites, scale=scale, color='blue') vj.MapPlotFault('../fault_He50km.h5', basemap=bm).plot_fault(fno) vj.plt.show()
#nth = 34 nth = 15 point_source_file = './outs_He63km_Rake81/day_0000_flt_%04d.out'%nth tp = np.loadtxt(point_source_file) disp0 = tp[:,2:5].flatten() disp1 = G1[:,nth] #scale = 2e-3 scale = 4e-5 bm = vj.MyBasemap(region_code='I') mplt = vj.MapPlotFault(fault_file,basemap=bm) mplt.plot_fault(fno=nth) mplt = vj.MapPlotDisplacement(basemap=bm) mplt.plot_disp(disp0, sites, scale=scale, X=0.2, Y=0.8, U=1e-6, label='point source') mplt.plot_disp(disp1, sites,color='r', scale=scale, X=0.2, Y=0.9, U=1e-6, label='reg source') plt.savefig('~compare.pdf') plt.show()
from pylab import plt import numpy as np import viscojapan as vj ## sites = np.loadtxt('../sites', '4a') ##ep = vj.EpochalDisplacement('../../cumu_post_with_seafloor.h5','../sites') ##slip_co = ep[0] ## ## ##mplt = vj.MapPlotDisplacement() ## ##mplt.plot_disp(slip_co,sites) ##plt.show() ep = vj.EpochalSlip('../slip0/incr_slip0.h5') slip_co = ep[0] mplt = vj.MapPlotFault('../fault_model/fault_bott50km.h5') mplt.plot_slip(slip_co) plt.show()
from pylab import plt import numpy as np import viscojapan as vj mplt = vj.MapPlotSlab() mplt.plot_top() tp = np.loadtxt( '/home/zy/workspace/viscojapan/Pollitz_slip_model/Pollitz-slipmodel.txt') lons = tp[:, 0].reshape((42, -1)) lats = tp[:, 1].reshape((42, -1)) mplt.basemap.plot(lons, lats, color='green', latlon=True) mplt.basemap.plot(np.ascontiguousarray(lons.T), np.ascontiguousarray(lats.T), color='green', latlon=True) mplt = vj.MapPlotFault('fault_bott50km.h5') mplt.plot_fault(color='red') plt.show()
def _plot_fault(self): if self.fault_file is not None: mplt = vj.MapPlotFault(self.fault_file, basemap=self.basemap) mplt.plot_slip(self.fault_slip)