<div dir="ltr">No, I mean which simulation code. I'll need to patch the frontend for that simulation code.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 2, 2013 at 10:53 AM, Noel Scudder <span dir="ltr"><<a href="mailto:noel.scudder@stonybrook.edu" target="_blank">noel.scudder@stonybrook.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Nathan,<div><br></div><div>Well, I just updated to the latest version of yt, 2.5.4, and I've been using that - is that what you mean?</div>
<span class="HOEnZb"><font color="#888888"><div><br></div></font></span><div><span class="HOEnZb"><font color="#888888">-Noel</font></span><div><div class="h5"><br><br><div class="gmail_quote">On Tue, Jul 2, 2013 at 1:16 PM, Nathan Goldbaum <span dir="ltr"><<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Noel,<div><br></div><div>I believe pf.domain_dimensions should be a numpy array while in your case it's actually a list. It looks like this is due to a bug in the frontend you're using. Which code is this for? This should be an easy fix.</div>
<div><br></div><div>-Nathan</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Tue, Jul 2, 2013 at 10:12 AM, Noel Scudder <span dir="ltr"><<a href="mailto:noel.scudder@stonybrook.edu" target="_blank">noel.scudder@stonybrook.edu</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>Hi yt users,<div><br></div><div>I have a (hopefully) simple question I'm hoping to get cleared up.</div>
<div>I've run into the same error both in clump finding and volume rendering:</div>
<div><div>AttributeError: 'list' object has no attribute 'astype'.</div>
</div><div><br></div><div>My volume rendering script:</div><div>----------------------</div><div><div>from yt.mods import *</div><div>pf = load("plt_derr_perr_grav_00020")</div><div>field = "pressure"</div>
</div><div><div>pf.h</div><div><br></div><div>#color transfer function/layer creation I'll leave out for clarity</div><div><br></div><div><div>c = [5.0e9, 5.0e9, 5.0e9]</div><div>L = [0.15, 1.0, 0.20]</div><div>W = (pf.domain_right_edge - pf.domain_left_edge)*0.5</div>
<div>Nvec = 768</div><div><br></div><div>cam = pf.h.camera(c, L, W, (Nvec,Nvec), transfer_function = tf, fields=[field], pf=pf, no_ghost=False)</div><div><br></div><div>im = cam.snapshot(clip_ratio=6.0)</div></div></div>
<div>
<br></div><div>...</div><div>----------------------</div><div><br></div><div>Without "no_ghost=False", the script runs as it's supposed to. If it's included, I get the following message:</div><div><br></div>
<div><div> File "<stdin>", line 1, in <module></div><div> File "volume.py", line 17, in <module></div><div> cam.snapshot("v1.png")</div><div> File "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/camera.py", line 684, in snapshot</div>
<div> self.initialize_source()</div><div> File "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/camera.py", line 636, in initialize_source</div><div> return self.volume.initialize_source()</div>
<div> File "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/utilities/amr_kdtree/amr_kdtree.py", line 200, in initialize_source</div><div> for b in self.traverse():</div><div> File "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/utilities/amr_kdtree/amr_kdtree.py", line 210, in traverse</div>
<div> yield self.get_brick_data(node)</div><div> File "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/utilities/amr_kdtree/amr_kdtree.py", line 284, in get_brick_data</div><div> vcd = grid.get_vertex_centered_data(field,smoothed=True,no_ghost=self.no_ghost).astype('float64')</div>
<div> File "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/data_objects/grid_patch.py", line 510, in get_vertex_centered_data</div><div> cg = self.retrieve_ghost_zones(1, field, smoothed=smoothed)</div><div> File "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/data_objects/grid_patch.py", line 477, in retrieve_ghost_zones</div>
<div> level, new_left_edge, **kwargs)</div><div> File "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 3867, in __init__</div><div> self.pf.domain_dimensions.astype("float64"))</div>
<div>AttributeError: 'list' object has no attribute 'astype'</div></div><div><br></div><div><br></div><div>My clump-finding script closely follows the "Identifying Clumps" recipe in the cookbook:</div>
<div>----------------------</div><div><div>from yt.mods import *</div><div>from yt.analysis_modules.level_sets.api import *</div><div><br></div><div>field = "density"</div><div>step = 2.0</div><div><br></div><div>
pf = load("plt_derr_perr_grav_00020")</div><div>pf.h</div></div><div><br></div><div><div>data_source = pf.h.all_data()</div></div><div><div>c_min = 10**na.floor(na.log10(data_source[field]).min() )</div><div>c_max = 10**na.floor(na.log10(data_source[field]).max()+1)</div>
</div><div><br></div><div><div>function = 'self.data[\'%s\'].size > 8' %field</div></div><div><br></div><div><div>master_clump = Clump(data_source, None, field, function=function)</div></div><div><div>
find_clumps(master_clump, c_min, c_max, step)</div>
</div><div><br></div><div>...</div><div>----------------------</div><div>An error will occur occur at find_clumps:</div><div><br></div><div><div>Finding clumps: min: 1.500000e-04, max: 1.500000e+07, step: 2.000000</div><div>
First pass100% |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:00 </div><div>Traceback (most recent call last): | ETA: --:--:-- </div>
<div> File "<stdin>", line 1, in <module></div><div> File "clumps.py", line 30, in <module></div><div> find_clumps(master_clump, c_min, c_max, step)</div><div> File "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/analysis_modules/level_sets/clump_handling.py", line 179, in find_clumps</div>
<div> clump.find_children(min_val)</div><div> File "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/analysis_modules/level_sets/clump_handling.py", line 120, in find_children</div><div> self.cached_fields)</div>
<div> File "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/analysis_modules/level_sets/contour_finder.py", line 107, in identify_contours</div><div> cg = grid.retrieve_ghost_zones(1, "tempContours", smoothed=False)</div>
<div> File "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/data_objects/grid_patch.py", line 479, in retrieve_ghost_zones</div><div> cube = self.hierarchy.covering_grid(level, new_left_edge, **kwargs)</div><div> File "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 3706, in __init__</div>
<div> self.dds = self.pf.domain_width/rdx.astype("float64")</div><div>AttributeError: 'list' object has no attribute 'astype'</div></div><div><br></div><div><br></div><div>Can anyone tell me why I am getting this error in both cases? I've been doing my utmost, but I'm not familiar enough with python nor yt yet.Thanks for your help!</div>
<div><br></div><div>Cheers,</div><div><br></div><div>Noel Scudder</div>
<br></div></div>_______________________________________________<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></blockquote></div><br></div>
<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></blockquote></div><br></div></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>