In [1]:
import yt
In [2]:
ds = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0100")
yt : [INFO     ] 2015-10-27 11:27:52,955 integer runtime parameter checkpointfilenumber overwrites a simulation scalar of the same name
yt : [INFO     ] 2015-10-27 11:27:52,956 integer runtime parameter plotfilenumber overwrites a simulation scalar of the same name
yt : [INFO     ] 2015-10-27 11:27:52,972 Parameters: current_time              = 7.89058001997e+16
yt : [INFO     ] 2015-10-27 11:27:52,972 Parameters: domain_dimensions         = [16 16 16]
yt : [INFO     ] 2015-10-27 11:27:52,973 Parameters: domain_left_edge          = [ -3.70272000e+24  -3.70272000e+24  -3.70272000e+24]
yt : [INFO     ] 2015-10-27 11:27:52,974 Parameters: domain_right_edge         = [  3.70272000e+24   3.70272000e+24   3.70272000e+24]
yt : [INFO     ] 2015-10-27 11:27:52,974 Parameters: cosmological_simulation   = 0.0
In [3]:
sp = ds.sphere("c", (500.,"kpc"))
yt : [INFO     ] 2015-10-27 11:27:53,074 Loading field plugins.
yt : [INFO     ] 2015-10-27 11:27:53,074 Loaded angular_momentum (8 new fields)
yt : [INFO     ] 2015-10-27 11:27:53,075 Loaded astro (15 new fields)
yt : [INFO     ] 2015-10-27 11:27:53,076 Loaded cosmology (22 new fields)
yt : [INFO     ] 2015-10-27 11:27:53,077 Loaded fluid (62 new fields)
yt : [INFO     ] 2015-10-27 11:27:53,078 Loaded fluid_vector (94 new fields)
yt : [INFO     ] 2015-10-27 11:27:53,079 Loaded geometric (110 new fields)
yt : [INFO     ] 2015-10-27 11:27:53,080 Loaded local (110 new fields)
yt : [INFO     ] 2015-10-27 11:27:53,080 Loaded magnetic_field (118 new fields)
yt : [INFO     ] 2015-10-27 11:27:53,081 Loaded my_plugins (118 new fields)
yt : [INFO     ] 2015-10-27 11:27:53,082 Loaded species (120 new fields)
In [4]:
fn = sp.save_as_dataset(fields=["density","kT","velocity_x","velocity_y","velocity_z"])
yt : [INFO     ] 2015-10-27 11:27:54,933 Saving field data to yt dataset: sloshing_nomag2_hdf5_plt_cnt_0100_sphere.h5.
In [5]:
ds2 = yt.load(fn)
yt : [INFO     ] 2015-10-27 11:27:55,371 Parameters: current_time              = 7.89058001997e+16
yt : [INFO     ] 2015-10-27 11:27:55,372 Parameters: domain_dimensions         = [2 2 2]
yt : [INFO     ] 2015-10-27 11:27:55,372 Parameters: domain_left_edge          = [ -3.70272000e+24  -3.70272000e+24  -3.70272000e+24]
yt : [INFO     ] 2015-10-27 11:27:55,373 Parameters: domain_right_edge         = [  3.70272000e+24   3.70272000e+24   3.70272000e+24]
yt : [INFO     ] 2015-10-27 11:27:55,373 Parameters: cosmological_simulation   = 0.0
In [6]:
ad = ds2.all_data()
In [7]:
ad.quantities.angular_momentum_vector()
yt : [INFO     ] 2015-10-27 11:27:55,405 Allocating for 2.450e+06 particles
yt : [INFO     ] 2015-10-27 11:27:55,870 Identified 3.566e+05 octs
yt : [INFO     ] 2015-10-27 11:27:56,041 Loading field plugins.
yt : [INFO     ] 2015-10-27 11:27:56,041 Loaded angular_momentum (8 new fields)
yt : [INFO     ] 2015-10-27 11:27:56,042 Loaded astro (15 new fields)
yt : [INFO     ] 2015-10-27 11:27:56,042 Loaded cosmology (22 new fields)
yt : [INFO     ] 2015-10-27 11:27:56,043 Loaded fluid (63 new fields)
yt : [INFO     ] 2015-10-27 11:27:56,044 Loaded fluid_vector (95 new fields)
yt : [INFO     ] 2015-10-27 11:27:56,044 Loaded geometric (111 new fields)
yt : [INFO     ] 2015-10-27 11:27:56,045 Loaded local (111 new fields)
yt : [INFO     ] 2015-10-27 11:27:56,045 Loaded magnetic_field (119 new fields)
yt : [INFO     ] 2015-10-27 11:27:56,045 Loaded my_plugins (119 new fields)
yt : [INFO     ] 2015-10-27 11:27:56,046 Loaded species (121 new fields)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-7-dfa2f61eed0f> in <module>()
----> 1 ad.quantities.angular_momentum_vector()

/Users/jzuhone/Source/yt-py2/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/jzuhone/Source/yt-py2/yt/data_objects/derived_quantities.pyc in process_chunk(self, data, use_gas, use_particles)
    453             rvals.extend([(data["gas", "specific_angular_momentum_%s" % axis] *
    454                            data["gas", "cell_mass"]).sum(dtype=np.float64) \
--> 455                           for axis in "xyz"])
    456             rvals.append(data["gas", "cell_mass"].sum(dtype=np.float64))
    457         if use_particles:

/Users/jzuhone/Source/yt-py2/yt/data_objects/data_containers.pyc in __getitem__(self, key)
    258                 return self.field_data[f]
    259             else:
--> 260                 self.get_data(f)
    261         # fi.units is the unit expression string. We depend on the registry
    262         # hanging off the dataset to define this unit object.

/Users/jzuhone/Source/yt-py2/yt/data_objects/data_containers.pyc in get_data(self, fields)
    867 
    868         fields_to_generate += gen_fluids + gen_particles
--> 869         self._generate_fields(fields_to_generate)
    870         for field in list(self.field_data.keys()):
    871             if field not in ofields:

/Users/jzuhone/Source/yt-py2/yt/data_objects/data_containers.pyc in _generate_fields(self, fields_to_generate)
    887                 fi = self.ds._get_field_info(*field)
    888                 try:
--> 889                     fd = self._generate_field(field)
    890                     if fd is None:
    891                         raise RuntimeError

/Users/jzuhone/Source/yt-py2/yt/data_objects/data_containers.pyc in _generate_field(self, field)
    293                 tr = self._generate_container_field(field)
    294             if finfo.particle_type:
--> 295                 tr = self._generate_particle_field(field)
    296             else:
    297                 tr = self._generate_fluid_field(field)

/Users/jzuhone/Source/yt-py2/yt/data_objects/data_containers.pyc in _generate_particle_field(self, field)
    377         else:
    378             with self._field_type_state(ftype, finfo, gen_obj):
--> 379                 rv = self.ds._get_field_info(*field)(gen_obj)
    380         return rv
    381 

/Users/jzuhone/Source/yt-py2/yt/fields/derived_field.pyc in __call__(self, data)
    175             raise RuntimeError(
    176                 "Something has gone terribly wrong, _function is NullFunc " +
--> 177                 "for %s" % (self.name,))
    178         with self.unit_registry(data):
    179             dd = self._function(self, data)

RuntimeError: Something has gone terribly wrong, _function is NullFunc for ('all', 'velocity_x')