Hi All,<div><br></div><div>I've pushed a change (<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">c8a955052039</span>) that _should_ fix this issue.  If it doesn't work, could one of you send me a full example script off list that seems to get the right answer (and runs) with the older homogenized volume?  </div>

<meta charset="utf-8"><div><br></div><div>Best,</div><div>Sam<br><br><div class="gmail_quote">On Tue, Nov 23, 2010 at 3:43 PM, Britton Smith <span dir="ltr"><<a href="mailto:brittonsmith@gmail.com">brittonsmith@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi guys,<br><br>I was recently trying to render some derived fields that can have some zero values in them, and this was giving me seg faults as well in seemingly the same place.  I went into the definition of the field and put in nonzero, but quite small, floor value and this went away.<br>

<font color="#888888">
<br>Britton</font><div><div></div><div class="h5"><br><br><div class="gmail_quote">On Tue, Nov 23, 2010 at 5:30 PM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
Hi Stella,<br>
<br>
It looks to me like the amr_kdtree did not, in fact, retain API<br>
compatibility with the old mechanism for grid homogenization.  I took<br>
have seen segfaults from the casting segment, but I believed them to<br>
be a result of a poor choice in field tables, as I was actually<br>
projecting some odd derived quantities.  Evidently this was not the<br>
case, and there is an underlying problem.<br>
<br>
To work around this, I suggest you use the old version.  To do this,<br>
you can either supply a volume (using HomogenizedVolume, as in the<br>
past) or supply the keyword argument use_kd=False when creating the<br>
camera object.  The latter is probably easier.<br>
<br>
Let me know if this *still* gives you problems.  I'm sorry that this<br>
has been a hassle.<br>
<br>
-Matt<br>
<div><div></div><div><br>
On Tue, Nov 23, 2010 at 4:30 PM, Stella Offner <<a href="mailto:soffner@cfa.harvard.edu" target="_blank">soffner@cfa.harvard.edu</a>> wrote:<br>
> Hi Matt,<br>
><br>
> Thanks, again!  Now a new error: I called camera with a log_fields argument,<br>
> but it seems that kd tree code does not recognize this. Sadly, if I bi-pass<br>
> this by not using the log field, the code seg faults right after 'About to<br>
> cast'. This last thing could just be my script. Anyway, I'm using the<br>
> latest, rather than the stable version, which maybe I should use instead.<br>
><br>
><br>
> AttributeError                            Traceback (most recent call last)<br>
><br>
> /n/home05/soffner/yt-x86_64/src/yt-hg/scripts/iyt in <module>()<br>
>    140                 cam.zoom(1.0)<br>
>    141     #take a picture<br>
> --> 142                 vals = cam.snapshot()<br>
>    143                 max = vals.max()<br>
>    144                 print "Max= ", max, "Min= ", vals.min()<br>
><br>
> /n/home05/soffner/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/camera.pyc<br>
> in snapshot(self, fn)<br>
>    324         tfp = TransferFunctionProxy(self.transfer_function) # Reset<br>
> it every time<br>
>    325         tfp.ns = self.sub_samples<br>
> --> 326         self.volume.initialize_source()<br>
>    327         if self.use_kd:<br>
>    328             self.volume.reset_cast()<br>
><br>
> /n/home05/soffner/yt-x86_64/src/yt-hg/yt/utilities/amr_kdtree/amr_kdtree.pyc<br>
> in initialize_source(self)<br>
>    773     def initialize_source(self):<br>
>    774         if self.tree_type is 'domain':<br>
> --> 775             self.get_bricks()<br>
>    776<br>
>    777     def kd_ray_cast(self,image, tfp, vector_plane, back_center,<br>
> front_center):<br>
><br>
> /n/home05/soffner/yt-x86_64/src/yt-hg/yt/utilities/amr_kdtree/amr_kdtree.pyc<br>
> in get_bricks(self)<br>
>    345                 for i,field in enumerate(self.fields):<br>
>    346                     vcd =<br>
> current_node['grid'].get_vertex_centered_data(field,smoothed=True,no_ghost=self.no_ghost).astype('float64')<br>
> --> 347                     if self.log_field[i]: vcd = na.log10(vcd)<br>
>    348                     dds.append(vcd)<br>
>    349                 current_saved_grids.append(current_node['grid'])<br>
><br>
> AttributeError: 'AMRKDTree' object has no attribute 'log_field'<br>
> WARNING: Failure executing file:<br>
> </n/home05/soffner/ytorionlib/ytwindmovie.py><br>
><br>
><br>
> On Nov 23, 2010, at 3:51 PM, Matthew Turk wrote:<br>
><br>
>> Hi Stella,<br>
>><br>
>> You're right, that code was not using the correct parameters.  I have<br>
>> corrected it and pushed a new changeset.<br>
>><br>
>> -Matt<br>
>><br>
>> PS For what it's worth, this doesn't seem to be related to Mike's<br>
>> problem from the other thread, which I will defer to the author of the<br>
>> amr_kdtree module, Sam Skillman.  :)<br>
>><br>
>> On Tue, Nov 23, 2010 at 3:49 PM, Stella Offner <<a href="mailto:soffner@cfa.harvard.edu" target="_blank">soffner@cfa.harvard.edu</a>><br>
>> wrote:<br>
>>><br>
>>> Hi Matt,<br>
>>><br>
>>> Thanks! That got me past the camera-specific error. However, I am running<br>
>>> into an error in amr_kdtree, which has a call in the old form to<br>
>>> pf['DomainLeftEdge']:<br>
>>><br>
>>> KeyError                                  Traceback (most recent call<br>
>>> last)<br>
>>><br>
>>> /n/home05/soffner/yt-x86_64/src/yt-hg/scripts/iyt in <module>()<br>
>>>   135                 cam = pf.h.camera(c, L, W, (Nvec,Nvec),<br>
>>>   136                         transfer_function = tf, pf = pf,<br>
>>> fields=["log_den"],<br>
>>> --> 137                         north_vector = north)<br>
>>>   138                 cam.zoom(1.0)<br>
>>>   139     #take a picture<br>
>>><br>
>>><br>
>>> /n/home05/soffner/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/camera.pyc<br>
>>> in __init__(self, center, normal_vector, width, resolution,<br>
>>> transfer_function, north_vector, steady_north, volume, fields,<br>
>>> log_fields,<br>
>>> sub_samples, pf, use_kd, l_max, no_ghost, tree_type)<br>
>>>   193             if self.use_kd:<br>
>>>   194                 volume = AMRKDTree(<a href="http://self.pf" target="_blank">self.pf</a>, l_max=l_max,<br>
>>> fields=self.fields, no_ghost=no_ghost, tree_type=tree_type,<br>
>>> --> 195                                    log_fields = log_fields)<br>
>>>   196             else:<br>
>>>   197                 volume = HomogenizedVolume(fields, pf = <a href="http://self.pf" target="_blank">self.pf</a>,<br>
>>><br>
>>><br>
>>> /n/home05/soffner/yt-x86_64/src/yt-hg/yt/utilities/amr_kdtree/amr_kdtree.pyc<br>
>>> in __init__(self, pf, l_max, le, re, fields, no_ghost, tree_type,<br>
>>> log_fields)<br>
>>>   271<br>
>>>   272         if le is None:<br>
>>> --> 273             self.domain_left_edge = pf['DomainLeftEdge']<br>
>>>   274         else:<br>
>>>   275             self.domain_left_edge = le<br>
>>><br>
>>> /n/home05/soffner/yt-x86_64/src/yt-hg/yt/data_objects/static_output.pyc<br>
>>> in<br>
>>> __getitem__(self, key)<br>
>>>   113                   self.conversion_factors]:<br>
>>>   114             if key in d: return d[key]<br>
>>> --> 115         raise KeyError(key)<br>
>>>   116<br>
>>>   117     def keys(self):<br>
>>><br>
>>> KeyError: 'DomainLeftEdge'<br>
>>> WARNING: Failure executing file:<br>
>>> </n/home05/soffner/ytorionlib/ytwindmovie.py><br>
>>><br>
>>><br>
>>> On Nov 23, 2010, at 3:32 PM, Matthew Turk wrote:<br>
>>><br>
>>>> Hi Stella,<br>
>>>><br>
>>>> I've just pushed a change to include Camera and HomogenizedVolume in<br>
>>>> the yt.mods import.  I also wanted to note that you can get a camera<br>
>>>> by doing:<br>
>>>><br>
>>>> pf.h.camera<br>
>>>><br>
>>>> and that I think unless you're doing something clever, you may no<br>
>>>> longer need to generate a HomogenizedVolume by hand.  I think by<br>
>>>> default Camera will use the kD-tree, now, so you should be set just<br>
>>>> specifying the parameters for the rendering to pf.h.camera, and not<br>
>>>> the volume itself.<br>
>>>><br>
>>>> Let me know if you run into any more problems!<br>
>>>><br>
>>>> -Matt<br>
>>>><br>
>>>> On Tue, Nov 23, 2010 at 3:28 PM, Stella Offner <<a href="mailto:soffner@cfa.harvard.edu" target="_blank">soffner@cfa.harvard.edu</a>><br>
>>>> wrote:<br>
>>>>><br>
>>>>> Hi,<br>
>>>>><br>
>>>>>  I updated yt to the new release, and now I'm getting 'NameError: name<br>
>>>>> 'Camera' is not defined' for Camera and HomogenizedVolume (these were<br>
>>>>> both<br>
>>>>> part of the volume_rendering extension previously). Did these get<br>
>>>>> renamed<br>
>>>>> or<br>
>>>>> do I need to import something else?<br>
>>>>><br>
>>>>> Thanks!<br>
>>>>> Stella<br>
>>>>> _______________________________________________<br>
>>>>> yt-users mailing list<br>
>>>>> <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
>>>>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>>>>><br>
>>>> _______________________________________________<br>
>>>> yt-users mailing list<br>
>>>> <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
>>>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>>><br>
>>> _______________________________________________<br>
>>> yt-users mailing list<br>
>>> <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
>>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>>><br>
>> _______________________________________________<br>
>> yt-users mailing list<br>
>> <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</div></div></blockquote></div><br>
</div></div><br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div>