Skip to content

Commit 3adf777

Browse files
Using the new grid.negate_depth() method
Note that this will only work after Parcels v3.1.1 is released and on conda. But create this PR now already so we don't forget to update the VirtualShip
1 parent 44eae19 commit 3adf777

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ channels:
33
- conda-forge
44
dependencies:
55
- click
6-
- parcels >3, <3.1.0
6+
- parcels >3.1.0
77
- pyproj >= 3, < 4
88
- sortedcontainers == 2.4.0
99
- opensimplex == 0.4.5

src/virtualship/expedition/input_data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def _load_default_fieldset(cls, directory: str | Path) -> FieldSet:
9797

9898
# make depth negative
9999
for g in fieldset.gridset.grids:
100-
g.depth = -g.depth
100+
g.negate_depth()
101101

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

138138
# make depth negative
139139
for g in fieldset.gridset.grids:
140-
g.depth = -g.depth
140+
g.negate_depth()
141141

142142
# read in data already
143143
fieldset.computeTimeChunk(0, 1)
@@ -169,7 +169,7 @@ def _load_argo_float_fieldset(cls, directory: str | Path) -> FieldSet:
169169
# make depth negative
170170
for g in fieldset.gridset.grids:
171171
if max(g.depth) > 0:
172-
g.depth = -g.depth
172+
g.negate_depth()
173173

174174
# read in data already
175175
fieldset.computeTimeChunk(0, 1)

0 commit comments

Comments
 (0)