Skip to content

Commit

Permalink
Merge pull request #1 from OceanParcels/main
Browse files Browse the repository at this point in the history
Using private grid._depth for negating depth (OceanParcels#75)
  • Loading branch information
iuryt authored Nov 11, 2024
2 parents 8cdf931 + 6f843e9 commit 6ba1f6f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/virtualship/expedition/input_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ def _load_default_fieldset(cls, directory: str | Path) -> FieldSet:

# make depth negative
for g in fieldset.gridset.grids:
g.depth = -g.depth
g._depth = (
-g._depth
) # TODO maybe add a grid.negate_depth() method in Parcels?

# add bathymetry data
bathymetry_file = directory.joinpath("bathymetry.nc")
Expand Down Expand Up @@ -137,7 +139,7 @@ def _load_drifter_fieldset(cls, directory: str | Path) -> FieldSet:

# make depth negative
for g in fieldset.gridset.grids:
g.depth = -g.depth
g._depth = -g._depth

# read in data already
fieldset.computeTimeChunk(0, 1)
Expand Down Expand Up @@ -169,7 +171,7 @@ def _load_argo_float_fieldset(cls, directory: str | Path) -> FieldSet:
# make depth negative
for g in fieldset.gridset.grids:
if max(g.depth) > 0:
g.depth = -g.depth
g._depth = -g._depth

# read in data already
fieldset.computeTimeChunk(0, 1)
Expand Down

0 comments on commit 6ba1f6f

Please sign in to comment.