Skip to content

Commit

Permalink
allow to specify 3 vectors as direction
Browse files Browse the repository at this point in the history
  • Loading branch information
nvaytet committed Apr 5, 2024
1 parent d335bef commit 903297a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/osyris/plot/direction.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ def get_direction(direction=None, dataset=None, dx=None, dy=None, origin=None):
v = direction.cross(dir_vecs["pos_u"])
v.name = "pos_v"
dir_vecs["pos_v"] = v
elif isinstance(direction, dict):
dir_vecs = direction.copy()
assert "normal" in dir_vecs
assert "pos_u" in dir_vecs
assert "pos_v" in dir_vecs
else:
raise ValueError(f"Bad direction for slice: {direction}.")

Expand Down

0 comments on commit 903297a

Please sign in to comment.