[yt-users] camera rotation

Mateusz Ruszkowski mateuszr at umich.edu
Thu Dec 5 13:08:25 PST 2013



   Hi all,

I am trying to understand how the camera rotation works in yt. I verified that the following set of commands

C = (0.0,-50*kpc,zPos)
L = (0.0,-1.0,0.0)
W = 100*kpc
N = (0.0,0.0,1.0)
cam = pf.h.camera(C, L, W, 512, tf, N)
cam.snapshot("single_snapshot.png")

produces a nice image of a flat gas distribution located in the (x,y) plane anchored at zPos. I would like to move the camera around the z-axis while pointing it at (0,0,zPos) and take 10 snapshots. This should result in a sequence of 10 identical images of the same pancake-flat distribution of the gas. I tried this:

for i, snap in enumerate(cam.rotation(2*np.pi, 10,N)):
    print "Taking snapshot % 3i" % (i+1)
    snap.write_png("rot_%04i.png" % i)

My assumption was that "N" in the above command defines the vector around which to move the camera. This procedure did generate 10 images but they were all different rather than identical. My question is how do I move the camera around the z-axis while pointing it at (0,0,zPos), or in other words, how do I define the point where "N" is anchored.

   Thanks,
     Mateusz




More information about the yt-users mailing list