[yt-dev] Issue #1166: YTFieldNotFound for angular momentum (yt_analysis/yt)
Joyce Lee
issues-reply at bitbucket.org
Thu Jan 28 13:26:47 PST 2016
New issue 1166: YTFieldNotFound for angular momentum
https://bitbucket.org/yt_analysis/yt/issues/1166/ytfieldnotfound-for-angular-momentum
Joyce Lee:
I'm working with 3D simulation data (ORION) to find angular momentum vector.
http://use.yt/upload/f1926f08
http://use.yt/upload/272030ab
http://use.yt/upload/5e496e7c
I run the following:
```
#!python
import yt
file = "data.0200.3d.hdf5"
ds = yt.load(file)
sp = ds.sphere("center", (0.1, 'pc'))
L = sp.quantities.angular_momentum_vector()
```
and get the following traceback
```
#!python
/Users/joycelee/yt-x86_64/src/yt-hg/yt/data_objects/derived_quantities.pyc in __call__(self, *args, **kwargs)
66 storage = {}
67 for sto, ds in parallel_objects(chunks, -1, storage = storage):
---> 68 sto.result = self.process_chunk(ds, *args, **kwargs)
69 # Now storage will have everything, and will be done via pickling, so
70 # the units will be preserved. (Credit to Nathan for this
/Users/joycelee/yt-x86_64/src/yt-hg/yt/data_objects/derived_quantities.pyc in process_chunk(self, data, use_gas, use_particles)
458 rvals.extend([(data["all", "particle_specific_angular_momentum_%s" % axis] *
459 data["all", "particle_mass"]).sum(dtype=np.float64) \
--> 460 for axis in "xyz"])
461 rvals.append(data["all", "particle_mass"].sum(dtype=np.float64))
462 return rvals
/Users/joycelee/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.pyc in __getitem__(self, key)
244 Returns a single field. Will add if necessary.
245 """
--> 246 f = self._determine_fields([key])[0]
247 if f not in self.field_data and key not in self.field_data:
248 if f in self._container_fields:
/Users/joycelee/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.pyc in _determine_fields(self, fields)
513 raise YTFieldNotParseable(field)
514 ftype, fname = field
--> 515 finfo = self.ds._get_field_info(ftype, fname)
516 else:
517 fname = field
/Users/joycelee/yt-x86_64/src/yt-hg/yt/data_objects/static_output.pyc in _get_field_info(self, ftype, fname)
541 self._last_finfo = self.field_info[(ftype, fname)]
542 return self._last_finfo
--> 543 raise YTFieldNotFound((ftype, fname), self)
544
545 def _setup_classes(self):
YTFieldNotFound: Could not find field '('all', 'particle_specific_angular_momentum_x')' in data.0200.3d.hdf5.
```
More information about the yt-dev
mailing list