[yt-users] camera rotation

Mateusz Ruszkowski mateuszr at umich.edu
Sat Dec 7 11:57:25 PST 2013



  Hi all,

I switched to the development yt branch which now includes Sam's latest changes. These updates fixed the problem. Thanks Sam!

   Cheers,
     Mateusz


On Dec 5, 2013, at 5:34 PM, Sam Skillman wrote:

> Hi Mateusz
> 
> This has been merged in. Could you run: "yt update" and try again?
> 
> Sam
> 
> 
> On Thu, Dec 5, 2013 at 2:27 PM, Sam Skillman <samskillman at gmail.com> wrote:
> Hi Mateusz,
> 
> Sorry for the hassle -- it seems a bug was introduced a while back and you're the first one to attempt to rotate around something not at the center of the simulation since then! I've issued a pull request that should fix this so that the focus stays locked on C and it should rotate about it.  Your script above should not have to be altered, though I'll note that the N argument in the cam.rotation() call isn't necessary since it will by default rotate around the "north_vector", which is N in your case.
> 
> I expect that this PR will be accepted quite quickly:  https://bitbucket.org/yt_analysis/yt/pull-request/672/bugfix-for-camera-movement/diff
> 
> Best,
> Sam
> 
> 
> On Thu, Dec 5, 2013 at 1:08 PM, Mateusz Ruszkowski <mateuszr at umich.edu> wrote:
> 
> 
>    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
> 
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
> 
> 
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20131207/9f4a6120/attachment.html>


More information about the yt-users mailing list