Skip to content

Commit

Permalink
Merge pull request yt-project#1369 from ngoldbaum/surface-fix
Browse files Browse the repository at this point in the history
Use output_units instead of units when generating ghost zones. closes yt-project#1368
  • Loading branch information
Nathan Goldbaum authored May 8, 2017
2 parents 113f392 + a72b2c3 commit 1194c04
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion yt/data_objects/grid_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def get_vertex_centered_data(self, fields, smoothed=True, no_ghost=False):
for field in fields:
finfo = self.ds._get_field_info(field)
new_fields[field] = self.ds.arr(
np.zeros(self.ActiveDimensions + 1), finfo.units)
np.zeros(self.ActiveDimensions + 1), finfo.output_units)
if no_ghost:
for field in fields:
# Ensure we have the native endianness in this array. Avoid making
Expand Down
10 changes: 10 additions & 0 deletions yt/data_objects/tests/test_fluxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,13 @@ def _Emissivity(field, data):

assert os.path.exists('my_galaxy_emis.obj')
assert os.path.exists('my_galaxy_emis.mtl')

@requires_file(ISOGAL)
def test_correct_output_unit():
# see issue #1368
ds = load(ISOGAL)
x = y = z = .5
sp1 = ds.sphere((x,y,z), (300, 'kpc'))
Nmax = sp1.max('HI_Density')
sur = ds.surface(sp1,"HI_Density", .5*Nmax)
sur['x'][0]

0 comments on commit 1194c04

Please sign in to comment.