Hi Sam,
Looks like rays weren't implemented for octrees. I've issued a PR to
implement them here:
https://bitbucket.org/yt_analysis/yt/pull-request/697/enable-rays-to-be-trac...
Once fido reports that the unit tests are all still correct, I will
accept it. I've verified it with this:
http://paste.yt-project.org/show/4264/
-Matt
On Fri, Jan 31, 2014 at 11:54 AM, Sam Geen
Hi,
I'm trying to read data from a RAMSES output using a ray (c.f. http://yt-project.org/docs/dev/analyzing/generating_processed_data.html#line...) - I basically call:
import yt.mods pf = yt.mods.load("output_00007/info_00007.txt") ray = pf.h.ray((0.5,0.5,0.5),(0,0,0)) ray["Density"] # <-- throws exception here
It works fine up until when I try to query the density, whereupon it throws a KeyError (ray.keys() is also empty). It seems to find all the fields fine when creating the ray object. Error log at the bottom of the e-mail.
I'm pretty sure I'm using the latest version of YT from the yt-3.0 branch of the yt repository, but if I'm the only one getting this error I can double-check.
Anyone have any ideas? Failing that, if there's a better way to sample data along a line in YT, let me know.
Thanks!
Sam
--- In [5]: print ray["Density"] --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-5-dbeb4caf2ed1> in <module>() ----> 1 print ray["Density"]
/home/samgeen/.local/lib/python2.7/site-packages/yt-3.0dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.pyc in __getitem__(self, key) 189 return self.field_data[f] 190 else: --> 191 self.get_data(f) 192 # Note that this is less succinct so that we can account for the case 193 # when there are, for example, no elements in the object.
/home/samgeen/.local/lib/python2.7/site-packages/yt-3.0dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.pyc in get_data(self, fields) 573 # need to be generated. 574 read_fluids, gen_fluids = self.hierarchy._read_fluid_fields( --> 575 fluids, self, self._current_chunk) 576 self.field_data.update(read_fluids) 577
/home/samgeen/.local/lib/python2.7/site-packages/yt-3.0dev-py2.7-linux-x86_64.egg/yt/geometry/geometry_handler.pyc in _read_fluid_fields(self, fields, dobj, chunk) 533 selector, 534 fields_to_read, --> 535 chunk_size) 536 for field in fields_to_read: 537 ftype, fname = field
/home/samgeen/.local/lib/python2.7/site-packages/yt-3.0dev-py2.7-linux-x86_64.egg/yt/frontends/ramses/io.pyc in _read_fluid_selection(self, chunks, selector, fields, size) 47 d = {} 48 for field in fields: ---> 49 d[field] = np.concatenate(tr.pop(field)) 50 return d 51
KeyError: ('gas', 'Density') --- _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org