[yt-dev] Issue #1070: Cannot access field that needs ghost zones from a covering grid (yt_analysis/yt)
Nathan Goldbaum
issues-reply at bitbucket.org
Fri Aug 21 08:08:14 PDT 2015
New issue 1070: Cannot access field that needs ghost zones from a covering grid
https://bitbucket.org/yt_analysis/yt/issues/1070/cannot-access-field-that-needs-ghost-zones
Nathan Goldbaum:
The following test script:
```
#!python
import yt
ds = yt.load('GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0100')
ad = ds.all_data()
ml = ad.quantities.min_location('gpot')
center = (ml[2], ml[3], ml[4])
dx = ds.index.get_smallest_dx()
width = 256*dx
LE = center-width.in_units('code_length')/2.
CN = int(width/dx)
Roi = ds.covering_grid(level=ds.index.max_level, left_edge=LE, dims=[CN, CN, CN])
Roi['gas', 'vorticity_x']
```
Fails with the following traceback
```
Traceback (most recent call last):
File "test2.py", line 20, in <module>
Roi['gas', 'vorticity_x']
File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/data_containers.py", line 253, in __getitem__
self.get_data(f)
File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/construction_data_containers.py", line 598, in get_data
fill, gen, part, alias = self._split_fields(fields_to_get)
File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/construction_data_containers.py", line 616, in _split_fields
finfo.check_available(self)
File "/Users/goldbaum/Documents/yt-hg/yt/fields/derived_field.py", line 150, in check_available
validator(data)
File "/Users/goldbaum/Documents/yt-hg/yt/fields/derived_field.py", line 293, in __call__
raise NeedsGridType(self.ghost_zones,self.fields)
yt.fields.field_exceptions.NeedsGridType: (1, [('gas', 'velocity_x'), ('gas', 'velocity_y'), ('gas', 'velocity_z')])
```
Thanks to Markus Haider for reporting this on the mailing list.
More information about the yt-dev
mailing list