[yt-users] volume rendering rotate
Cameron Hummels
chummels at astro.columbia.edu
Tue Nov 8 09:43:11 PST 2011
Hi Stella,
Sorry to hear you're encountering some problems with the camera-moving
code. I, too, recently made movies using the "rotate" function and the
camera interface, but I didn't have any issues with it. Like Britton, I
do not specify a rotation vector in the rotate call, and it uses the
"north vector" (as specified in the camera call) as the axis of
rotation. So try switching your "rotation vector" out of your rotation
call, and into your "north vector" in the camera call. That might fix it.
If that does not fix it, can you tell me what version of yt you're
using, so I can try to rerun my script with whatever version you're
using and reproduce your error? You can figure out your version by
typing "yt instinfo" at a command line, and it should return something like:
The current version of the code is:
---
2317668ec945 (yt) tip
Cameron
---
For reference, my code operates like yours seems to:
# Take the snapshot
cam = Camera(c1, vec1, start_width, (N,N), transfer_function=ptf,
pf=pf, use_kd=False, north_vector=vec2,
tree_type='domain', no_ghost=False, volume=hv_big)
# create hdf5 file with all projection data
f = h5py.File(filename + "_project.h5", "w")
frameid = 0
# Rotate 1
for i, image in enumerate(cam.rotation(2*na.pi, 180)):
f.create_dataset("/frame%04i" % frameid, data=image)
print "ROTATE1 #: %04i, frame #: %04i" % (i, frameid)
frameid += 1
f.close()
# open hdf5 file with all data
f = h5py.File(filename + "_project.h5", "r")
# Render projections
for frameid in frame_range:
im = f["/frame%04i" % frameid][:]
im = np.log10(im)
bm = iw.write_image(im, "%s_frame%04i.png" % (filename, frameid),
cmap_name='kamae',
color_bounds=(-32,-23))
f.close()
---
On 11/8/11 8:16 AM, Stella Offner wrote:
> Hi Britton,
>
> Thanks. I did try that and it didn't seem to fix the problem:
> cam = pf.h.camera(c, L, W, Nvec, tf, fields=["log_den"],
> steady_north=True)
> I'm also zoomed pretty far into the volume, so maybe that has
> something to do with it?
>
> Stella
>
>
> Britton Smith wrote:
>> Hi Stella,
>>
>> I think all you have to do is add the "steady_north=True" keyword arg
>> to the camera instantiation and you should be all set.
>>
>> Britton
>>
>> On Tue, Nov 8, 2011 at 10:35 AM, Stella Offner
>> <soffner at cfa.harvard.edu <mailto:soffner at cfa.harvard.edu>> wrote:
>>
>> Hi,
>>
>> I'm making a volume rendering movie and I'm encountering an issue
>> with the rotate function. I'm iterating over a call to
>> cam.rotate(angle, rot_vector=north), with a fixed angle and north
>> vector. However, the output images rotate about that axis for a
>> few frames and then switch north vectors and rotate about a
>> different north. I'm using a yt version I installed a couple weeks
>> ago, so its pretty up to date. Do you know what could be going on?
>>
>> for j in range(1,76):
>> cam.rotate((3.14*2.0/75.0), rot_vector=[0, 0, 1])
>> vals = cam.snapshot()
>> image_file = "%s_st%i_%i_%i_%i_box_%i.png" % (pf, star,
>> xrot, yrot, zrot, ifile+j)
>> write_bitmap(vals, image_file)
>>
>> Thanks,
>> Stella
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org <mailto: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
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
More information about the yt-users
mailing list