[yt-users] Camera & HomogenizedVolume

Matthew Turk matthewturk at gmail.com
Tue Nov 23 12:51:52 PST 2010


Hi Stella,

You're right, that code was not using the correct parameters.  I have
corrected it and pushed a new changeset.

-Matt

PS For what it's worth, this doesn't seem to be related to Mike's
problem from the other thread, which I will defer to the author of the
amr_kdtree module, Sam Skillman.  :)

On Tue, Nov 23, 2010 at 3:49 PM, Stella Offner <soffner at cfa.harvard.edu> wrote:
> Hi Matt,
>
> Thanks! That got me past the camera-specific error. However, I am running
> into an error in amr_kdtree, which has a call in the old form to
> pf['DomainLeftEdge']:
>
> KeyError                                  Traceback (most recent call last)
>
> /n/home05/soffner/yt-x86_64/src/yt-hg/scripts/iyt in <module>()
>    135                 cam = pf.h.camera(c, L, W, (Nvec,Nvec),
>    136                         transfer_function = tf, pf = pf,
> fields=["log_den"],
> --> 137                         north_vector = north)
>    138                 cam.zoom(1.0)
>    139     #take a picture
>
> /n/home05/soffner/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/camera.pyc
> in __init__(self, center, normal_vector, width, resolution,
> transfer_function, north_vector, steady_north, volume, fields, log_fields,
> sub_samples, pf, use_kd, l_max, no_ghost, tree_type)
>    193             if self.use_kd:
>    194                 volume = AMRKDTree(self.pf, l_max=l_max,
> fields=self.fields, no_ghost=no_ghost, tree_type=tree_type,
> --> 195                                    log_fields = log_fields)
>    196             else:
>    197                 volume = HomogenizedVolume(fields, pf = self.pf,
>
> /n/home05/soffner/yt-x86_64/src/yt-hg/yt/utilities/amr_kdtree/amr_kdtree.pyc
> in __init__(self, pf, l_max, le, re, fields, no_ghost, tree_type,
> log_fields)
>    271
>    272         if le is None:
> --> 273             self.domain_left_edge = pf['DomainLeftEdge']
>    274         else:
>    275             self.domain_left_edge = le
>
> /n/home05/soffner/yt-x86_64/src/yt-hg/yt/data_objects/static_output.pyc in
> __getitem__(self, key)
>    113                   self.conversion_factors]:
>    114             if key in d: return d[key]
> --> 115         raise KeyError(key)
>    116
>    117     def keys(self):
>
> KeyError: 'DomainLeftEdge'
> WARNING: Failure executing file:
> </n/home05/soffner/ytorionlib/ytwindmovie.py>
>
>
> On Nov 23, 2010, at 3:32 PM, Matthew Turk wrote:
>
>> Hi Stella,
>>
>> I've just pushed a change to include Camera and HomogenizedVolume in
>> the yt.mods import.  I also wanted to note that you can get a camera
>> by doing:
>>
>> pf.h.camera
>>
>> and that I think unless you're doing something clever, you may no
>> longer need to generate a HomogenizedVolume by hand.  I think by
>> default Camera will use the kD-tree, now, so you should be set just
>> specifying the parameters for the rendering to pf.h.camera, and not
>> the volume itself.
>>
>> Let me know if you run into any more problems!
>>
>> -Matt
>>
>> On Tue, Nov 23, 2010 at 3:28 PM, Stella Offner <soffner at cfa.harvard.edu>
>> wrote:
>>>
>>> Hi,
>>>
>>>  I updated yt to the new release, and now I'm getting 'NameError: name
>>> 'Camera' is not defined' for Camera and HomogenizedVolume (these were
>>> both
>>> part of the volume_rendering extension previously). Did these get renamed
>>> or
>>> do I need to import something else?
>>>
>>> Thanks!
>>> Stella
>>> _______________________________________________
>>> 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
>
> _______________________________________________
> 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