Skip to content

Commit

Permalink
Discard the temporary weight field
Browse files Browse the repository at this point in the history
  • Loading branch information
cphyc committed Dec 6, 2024
1 parent 6abd8fc commit 1ab751b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions yt/visualization/volume_rendering/off_axis_projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ def temp_weightfield(field, data):
registry=data_source.ds.unit_registry,
info={"imtype": "rendering"},
)

else:
for grid, mask in data_source.blocks:
data = []
Expand All @@ -520,12 +521,14 @@ def temp_weightfield(field, data):
vol.sampler(pg, num_threads=num_threads)

image = vol.finalize_image(camera, vol.sampler.aimage)

image = ImageArray(
image, funits, registry=data_source.ds.unit_registry, info=image.info
)

if weight is not None:
data_source.ds.field_info.pop(("index", "temp_weightfield"))
# Remove the temporary weight field
if weight is not None:
data_source.ds.field_info.pop(("index", "temp_weightfield"))

if method == "integrate":
if weight is None:
Expand Down

0 comments on commit 1ab751b

Please sign in to comment.