Пример #1
0
# dbs[1] = hemisphere2.stl file
# dbs[2] = r/phi xmf file
# dbs[3] = magnetic field data slice
sphereDir = os.path.dirname(os.path.realpath(__file__))
dbs = [
    sphereDir + '/hemisphere1.stl', sphereDir + '/hemisphere2.stl',
    sys.argv[1], sys.argv[2] + "/merid90Slc.*.vti database"
]

AddArgument("-nowin")
Launch()
for db in dbs:
    OpenDatabase(db)
CreateDatabaseCorrelation("c", dbs, 0)

pyv.lfmExprs()

pyv.plotMesh(dbs[0],
             'STL_mesh',
             meshColor=(240, 240, 240, 255),
             opaqueColor=(240, 240, 240, 255))
pyv.plotMesh(dbs[1],
             'STL_mesh',
             meshColor=(0, 0, 0, 255),
             opaqueColor=(0, 0, 0, 255))

pyv.lfmPCol(dbs[2],
            varNames[vi],
            vBds=bnds,
            Log=True,
            cMap='plasma',
Пример #2
0
#Legends
plXs = [0.03]
plYs = [0.9, 0.4]
plTits = ["Residual Bz [nT]", "Particle Energy [keV]"]
#Construct filenames/directory structure
#Use ActivateDatabase to swap between
#md0 = GetMetaData(dbs[0]) for info

Src0 = EqDir + "/eqSlc.*.vti database"
Src1 = pDir + "/" + pStub[RunID] + ".h5part"

dbs = [Src0, Src1]

#Do some defaults
pyv.lfmExprs(doTrace=True)

#Open databases
OpenDatabase(dbs[0])
OpenDatabase(dbs[1])

#Create database correlation
CreateDatabaseCorrelation("P2Fld", dbs, 0)

#Create fields/particle plots
pyv.lfmPCol(dbs[0], "dBz", vBds=dBzBds, pcOpac=0.7, Inv=True)
pyv.lfmPScat(dbs[1], v4="Trapped", vBds=[0, 1], cMap=pCMap, Inv=False)

SetActivePlots((1, 2))
pyv.cutOut()