Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a grid.negate_depth method to swap the sign of depth fields? #1746

Open
erikvansebille opened this issue Oct 31, 2024 · 0 comments
Open
Labels
coding/Python feature good first issue Good for new parcels developers

Comments

@erikvansebille
Copy link
Member

Since the sign/orientation of the depth vector is not standardised in oceanography, users may sometimes need to negate a grid.depth field. See e.g. OceanParcels/virtualship#75. Especially since grid._depth is a private attribute, this is not trivial to users.

It might thus be useful to add a simple grid.negate_depth()method that simply does

def negate_depth(self):
    self._depth = -self._depth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coding/Python feature good first issue Good for new parcels developers
Projects
Status: Backlog
Development

No branches or pull requests

1 participant