#!/usr/bin/env python # # $Id: pvid.py,v 1.4 2009/06/13 07:38:49 brandenb Exp $ # Animation of slices for the magnetic field # import numpy as N import pylab as P import pencil as pc import sys # bb1=Bx, bb2=By and bb3=Bz bb1, t = pc.read_slices(field='bb3', proc=0) dim=pc.read_dim() par=pc.read_param(quiet=True) par2=pc.read_param(quiet=True, param2=True) grid=pc.read_grid(param=par, quiet=True, trim=True) nt=len(t) frame=par.xyz0[0],par.xyz1[0],par.xyz0[2],par.xyz1[2] P.ion() im=P.imshow(bb1[0,...], aspect='auto', origin='lower') st=P.figtext(0.8,0.2,'t=%.1f'%t[0], color='w') for i in range(1, nt): im.set_data(bb1[i, ...]) st.set_text('t=%.1f'%t[i]) P.draw() P.show()