''' A simple sample to plot MHD data
'''
import numpy as np
import matplotlib.pyplot as plt
from pyana.pep import mhddata
def main():
from mayavi import mlab
pp = mhddata.PlasmaParameter1205()
x = pp.xlist()
y = pp.ylist()
z = pp.zlist()
n = pp.nlist()
ln = np.log10(n)
ln[np.isinf(ln)] = np.nan
vx = pp.vxlist()
vy = pp.vylist()
vz = pp.vzlist()
mlab.contour3d(x, y, z, ln)
mlab.quiver3d(x[::20, ::20, ::20], y[::20, ::20, ::20], z[::20, ::20, ::20], vx[::20, ::20, ::20], vy[::20, ::20, ::20], vz[::20, ::20, ::20])
return pp
if __name__ == "__main__":
retval = main()