File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,10 @@ def from_copernicusmarine(ds: xr.Dataset):
216216 )
217217
218218 ds = _rename_coords_copernicusmarine (ds )
219+ if "W" in ds .data_vars :
220+ ds ["W" ] -= ds [
221+ "W"
222+ ] # Negate W to convert from up positive to down positive (as that's the direction of positive z)
219223 grid = XGrid (
220224 xgcm .Grid (
221225 ds ,
@@ -245,10 +249,9 @@ def from_copernicusmarine(ds: xr.Dataset):
245249 fields ["V" ] = Field ("V" , ds ["V" ], grid , XLinear )
246250
247251 if "W" in ds .data_vars :
248- ds ["W" ] -= ds [
249- "W"
250- ] # Negate W to convert from up positive to down positive (as that's the direction of positive z)
251- fields ["W" ] = Field ("W" , ds ["W" ], grid , XLinear )
252+ fields ["W" ] = Field (
253+ "W" , ds ["W" ], grid , XLinear
254+ ) # TODO: Choose interpolator based on `location` SGRID attribute
252255 fields ["UVW" ] = VectorField ("UVW" , fields ["U" ], fields ["V" ], fields ["W" ])
253256 else :
254257 fields ["UV" ] = VectorField ("UV" , fields ["U" ], fields ["V" ])
You can’t perform that action at this time.
0 commit comments