Ejemplo n.º 1
0
    def __init__(self, h5pF, Ts):

        #Find out how many particles we're dealing with
        self.T, self.pId = lfmpp.getH5pT(h5pF, "id", Ts)
        self.Np = len(self.pId)

        t, x = lfmpp.getH5pT(h5pF, "xeq", Ts)
        t, y = lfmpp.getH5pT(h5pF, "yeq", Ts)

        self.L = np.sqrt(x**2.0 + y**2.0)
        #Calculate phi in degrees in [0,360]
        pSgn = np.arctan2(y, x) * 180.0 / np.pi  #[-180,180]
        #Remap
        Ind = pSgn < 0
        pSgn[Ind] = pSgn[Ind] + 360

        self.phi = pSgn

        t, self.A = lfmpp.getH5pT(h5pF, "alpheq", Ts)
        t, self.K = lfmpp.getH5pT(h5pF, "keveq", Ts)
        t, self.Mu = lfmpp.getH5pT(h5pF, "mueq", Ts)

        Ind = np.isnan(self.Mu) | (self.Mu < 0)
        self.Mu[Ind] = 0

        self.W = np.zeros(self.Np)  #Room for weights
        self.isWgt = False  #Weights not yet calculated/set

        self.F = []  #Holder for distribution function (t>0)

        self.isPDF = False
Ejemplo n.º 2
0
def getPs(h5pDir, h5pStub, t, dt=10.0):
    tSlc = np.int(t / dt)
    h5pFile = h5pDir + "/" + h5pStub
    t, xeq = lfmpp.getH5pT(h5pFile, "xeq", tSlc)
    t, yeq = lfmpp.getH5pT(h5pFile, "yeq", tSlc)
    t, kev = lfmpp.getH5pT(h5pFile, "kev", tSlc)

    t, mp = lfmpp.getH5pT(h5pFile, "mp", tSlc)
    t, tl = lfmpp.getH5pT(h5pFile, "tl", tSlc)
    t, atm = lfmpp.getH5pT(h5pFile, "atm", tSlc)

    In = (atm + tl + mp) < 0.5
    xeq = xeq[In]
    yeq = yeq[In]
    kev = kev[In]

    return xeq, yeq, kev