Hi all.<div><br></div><div>I'm trying to make a covering grid of the full domain of an enzo (cosmological) simulation, getting the dark matter density and velocity fields. This works fine with the gas:</div><div><br></div>
<div><font face="'courier new', monospace">In [1]: cg = pf.h.covering_grid(0, [0,0,0], [256,256,256], fields=["Density", "x-velocity", "y-velocity", "z-velocity"])</font></div>
<div><br></div><div>But then I try the DM fields:</div><div><br></div><div><div><font face="'courier new', monospace">In [2]: cg = pf.h.covering_grid(0, [0,0,0], [256,256,256], fields=["Dark_Matter_Density", "cic_particle_velocity_x", "cic_particle_velocity_y", "cic_particle_velocity_z"])</font></div>
<div><font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace">... ipython cruft ...</font></div><div><font face="'courier new', monospace"><br></font></div>
<div><font face="'courier new', monospace"><div>/project/projectdirs/nyx/yt-installs/yt-hopper/src/yt-hg/yt/data_objects/data_containers.pyc in __init__(self, level, left_edge, dims, fields, pf, num_ghost_zones, use_pbar, **kwargs)</div>
<div> 3342 self.domain_width = na.rint((self.pf.domain_right_edge -</div><div> 3343 self.pf.domain_left_edge)/self.dds).astype('int64')</div><div>-> 3344 self._refresh_data()</div>
<div> 3345 </div><div> 3346 def _get_list_of_grids(self, buffer = 0.0):</div><div><br></div><div>/project/projectdirs/nyx/yt-installs/yt-hopper/src/yt-hg/yt/data_objects/data_containers.pyc in _refresh_data(self)</div>
<div> 3359 </div><div> 3360 def _refresh_data(self):</div><div>-> 3361 AMR3DData._refresh_data(self)</div><div> 3362 self['dx'] = self.dds[0] * na.ones(self.ActiveDimensions, dtype='float64')</div>
<div> 3363 self['dy'] = self.dds[1] * na.ones(self.ActiveDimensions, dtype='float64')</div><div><br></div><div>/project/projectdirs/nyx/yt-installs/yt-hopper/src/yt-hg/yt/data_objects/data_containers.pyc in _refresh_data(self)</div>
<div> 307 """</div><div> 308 self.clear_data()</div><div>--> 309 self.get_data()</div><div> 310 </div><div> 311 def keys(self):</div><div><br></div><div>/project/projectdirs/nyx/yt-installs/yt-hopper/src/yt-hg/yt/data_objects/data_containers.pyc in get_data(self, fields)</div>
<div> 3377 try:</div><div> 3378 #print "Generating", field</div><div><br></div><div>-> 3379 self._generate_field(field)</div><div> 3380 continue</div>
<div> 3381 except NeedsOriginalGrid, ngt_exception:</div><div><br></div><div>/project/projectdirs/nyx/yt-installs/yt-hopper/src/yt-hg/yt/data_objects/data_containers.pyc in _generate_field(self, field)</div>
<div> 3404 # First we check the validator; this might even raise!</div><div><br></div><div> 3405 self.pf.field_info[field].check_available(self)</div><div>-> 3406 self[field] = self.pf.field_info[field](self)</div>
<div> 3407 else: # Can't find the field, try as it might</div><div> 3408 raise KeyError(field)</div><div><br></div><div>/project/projectdirs/nyx/yt-installs/yt-hopper/src/yt-hg/yt/data_objects/field_info_container.pyc in __call__(self, data)</div>
<div> 314 ii = self.check_available(data)</div><div> 315 original_fields = data.keys() # Copy</div><div>--> 316 dd = self._function(self, data)</div><div> 317 dd *= self._convert_function(data)</div>
<div> 318 for field_name in data.keys():</div><div><br></div><div>/project/projectdirs/nyx/yt-installs/yt-hopper/src/yt-hg/yt/frontends/enzo/fields.pyc in _cic_particle_field(field, data)</div><div> 332 particle_field = <a href="http://field.name">field.name</a>[4:]</div>
<div> 333 top = na.zeros(data.ActiveDimensions, dtype='float32')</div><div>--> 334 if data.NumberOfParticles == 0: return top</div><div> 335 particle_field_data = data[particle_field] * data['particle_mass']</div>
<div> 336 amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),</div><div><br></div><div>AttributeError: 'AMRCoveringGrid' object has no attribute 'NumberOfParticles'</div>
</font></div></div><div><br></div><div>Are you not supposed to use a covering grid with these fields or am I creating the covering grid incorrectly? I get reasonable looking plots if I slice/project cic_particle_velocity_x, so I believe it's working otherwise.</div>
<div><br>
</div><div>Best,</div><div>Casey</div>