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 numpy as np import lfmViz as lfmv import lfmPostproc as lfmpp import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec fld = "/Users/soratka1/Work/magnetoloss/eqSlc/eqSlc.0250.vti" IDs = [1335, 301, 95834, 12593, 63464, 75685] fIn = "/Users/soratka1/Work/magnetoloss/synth/O.100keV.h5part" Bz = lfmv.getVTI_SlcSclr(fld, fldStr='dBz') xm = np.linspace(-15.0, 13, 560) ym = np.linspace(-20.0, 20, 801) xx, yy = np.meshgrid(xm, ym) Ni = len(IDs) #fig = plt.figure(1, figsize=(15,10)) gs = gridspec.GridSpec(Ni, 1) t, x = lfmpp.getH5p(fIn, "x") t, y = lfmpp.getH5p(fIn, "y") t, z = lfmpp.getH5p(fIn, "z") t, pids = lfmpp.getH5p(fIn, "id") t, Om = lfmpp.getH5p(fIn, "Om") t, Op = lfmpp.getH5p(fIn, "Op") Omp = (Om + Op) for n in range(len(IDs)): pid = IDs[n] npid = (pids == pid).argmax() xp = x[:, npid]