def getFld(vtiDir, t, dt=10.0, eqStub="eqSlc"): tSlc = np.int(t / dt) vtiFile = vtiDir + "/" + eqStub + ".%04d.vti" % (tSlc) dBz = lfmv.getVTI_SlcSclr(vtiFile).T ori, dx, ex = lfmv.getVTI_Eq(vtiFile) xi = ori[0] + np.arange(ex[0], ex[1] + 1) * dx[0] yi = ori[1] + np.arange(ex[2], ex[3] + 1) * dx[1] return xi, yi, dBz
def getFld(vtiDir, tSlc, eqStub="eqSlc"): #tSlc = np.int(t/dt) vtiFile = vtiDir + "/" + eqStub + ".%04d.vti" % (tSlc) print("Reading field from %s" % (vtiFile)) dBz = lfmv.getVTI_SlcSclr(vtiFile).T ori, dx, ex = lfmv.getVTI_Eq(vtiFile) xi = ori[0] + np.arange(ex[0], ex[1] + 1) * dx[0] yi = ori[1] + np.arange(ex[2], ex[3] + 1) * dx[1] return xi, yi, dBz
import matplotlib.gridspec as gridspec lfmv.ppInit() figSize = (16, 8) idScls = [3, 4, 5, 6] NumID = len(idScls) figQ = 300 PBs = [] for i in idScls: fIn = "idw%d.vti" % (i) print("Reading %s" % (fIn)) Bx, By, Bz = lfmv.getVTI_Slc(fIn) ori, dx, extent = lfmv.getVTI_Eq(fIn) PBi = np.sqrt(Bx**2.0 + By**2.0 + Bz**2.0) PBs.append(PBi) #Create grid x = ori[0] + dx[0] * np.arange(extent[0], extent[1] + 1) y = ori[1] + dx[1] * np.arange(extent[2], extent[3] + 1) vNorm = LogNorm(vmin=1.0, vmax=1.0e+3) cMap = "viridis" WRs = 10 * np.ones(NumID + 2) WRs[-1] = 0.25 WRs[-2] = 0.1 fig = plt.figure(figsize=figSize) gs = gridspec.GridSpec(1, NumID + 2, width_ratios=WRs)
def getGrid(fname): ori,dx,ex = lfmv.getVTI_Eq(fname) xi = ori[0] + np.arange(ex[0],ex[1]+1)*dx[0] yi = ori[1] + np.arange(ex[2],ex[3]+1)*dx[1] return xi,yi,dx[0],dx[1]