[yt-users] Accessing data
Stuart Mumford
stuart at mumford.me.uk
Wed Nov 6 03:37:31 PST 2013
Hello,
I am starting upon an adventure of actually using yt and I am already
getting the impression I may be using a chainsaw to cut kindling.
My data is uniform grid, not that large (128^3 for now) and I need to
access the fields, both on disk and derived in 3D array format. I have
tried using a covering_grid thus:
```
ts =
yt.load("/archive/io_testing/3D_tube128_Slog_p90_A20r2-3_B005/3D_tube128_Slog_p90_A20r2-3_B005_*.gdf")
ds = ts[10]
cg = ds.h.covering_grid(0, ds.domain_left_edge, ds.domain_dimensions)
cg['density_pert']
```
which soemtimes seems to give me an array full of -999 and sometimes gives
me this lovely traceback:
```
---------------------------------------------------------------------------
DataCubeError Traceback (most recent call last)
<ipython-input-55-62e42995fe53> in <module>()
----> 1 cg['density_pert']
/home/stuart/BitBucket/yt/yt/data_objects/data_containers.pyc in
__getitem__(self, key)
316 if key not in self.fields:
317 self.fields.append(key)
--> 318 self.get_data(key)
319 return self.field_data[key]
320
/home/stuart/BitBucket/yt/yt/data_objects/data_containers.pyc in
get_data(self, fields)
3757 for i, grid in enumerate(self._grids):
3758 if self._use_pbar: pbar.update(i)
-> 3759 count -= self._get_data_from_grid(grid, obtain_fields)
3760 if count <= 0: break
3761 if self._use_pbar: pbar.finish()
/home/stuart/BitBucket/yt/yt/data_objects/data_containers.pyc in
save_state(self, grid, field, *args, **kwargs)
79 old_keys = grid.field_data.keys()
80 grid.field_parameters = self.field_parameters
---> 81 tr = func(self, grid, field, *args, **kwargs)
82 grid.field_parameters = old_params
83 grid.field_data = YTFieldData( [(k, grid.field_data[k]) for
k in old_keys] )
/home/stuart/BitBucket/yt/yt/data_objects/data_containers.pyc in
_get_data_from_grid(self, grid, fields)
3801 c_fields, g_fields,
3802 self.ActiveDimensions, grid.ActiveDimensions,
-> 3803 grid.child_mask, self.domain_width, ll, 0)
3804 return count
3805
DataCubeError: DataCubeGeneric: Invalid parameters.
```
I only want my arrays :'(
On another, related, note:
I have a bit of code that executes in serial at the top of a otherwise
embarrassingly parallel piece of vtk code, I need the most optimal io
possible for this, as it is all io limited, how well is yt suited to
getting one slice out of my gdf files as fast as humanly possible?
Stuart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20131106/b81a924f/attachment.htm>
More information about the yt-users
mailing list