Skip to content

Commit

Permalink
Merge pull request #4872 from jzuhone/fix_angmom_normal
Browse files Browse the repository at this point in the history
BUG: Always use the coordinate system normal for computing angular momentum components for particles
  • Loading branch information
chummels authored Apr 17, 2024
2 parents 13c218f + d759537 commit d046de2
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions yt/fields/particle_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,7 @@ def particle_vectors(field, data):


def get_angular_momentum_components(ptype, data, spos, svel):
if data.has_field_parameter("normal"):
normal = data.get_field_parameter("normal")
else:
normal = data.ds.arr(
[0.0, 0.0, 1.0], "code_length"
) # default to simulation axis
normal = data.ds.arr([0.0, 0.0, 1.0], "code_length") # default to simulation axis
pos = data.ds.arr([data[ptype, spos % ax] for ax in "xyz"]).T
vel = data.ds.arr([data[ptype, f"relative_{svel % ax}"] for ax in "xyz"]).T
return pos, vel, normal
Expand Down

0 comments on commit d046de2

Please sign in to comment.