Skip to content

Commit 927ea50

Browse files
Setting the grid mesh to "spherical" in from_copernicusmarine
Also adding a unit test This fixes #2406
1 parent 0d419a2 commit 927ea50

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/parcels/_core/fieldset.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ def from_copernicusmarine(ds: xr.Dataset):
235235
},
236236
autoparse_metadata=False,
237237
**_DEFAULT_XGCM_KWARGS,
238-
)
238+
),
239+
mesh="spherical",
239240
)
240241

241242
fields = {}

tests/test_fieldset.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,12 @@ def test_fieldset_from_copernicusmarine(ds, caplog):
259259
assert "renamed it to 'V'" in caplog.text
260260

261261

262+
@pytest.mark.parametrize("ds", _COPERNICUS_DATASETS)
263+
def test_grid_mesh_from_copernicusmarine(ds):
264+
fieldset = FieldSet.from_copernicusmarine(ds)
265+
assert fieldset.U.grid._mesh == "spherical"
266+
267+
262268
@pytest.mark.parametrize("ds", [datasets_circulation_models["ds_copernicusmarine"].copy()])
263269
def test_fieldset_from_copernicusmarine_missing_axis(ds, caplog):
264270
del ds["latitude"].attrs["axis"]

0 commit comments

Comments
 (0)