Skip to content

Commit

Permalink
wip: fesom regridding
Browse files Browse the repository at this point in the history
  • Loading branch information
pgierz committed Nov 5, 2024
1 parent b5c342d commit 8746c10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pymorize/fesom.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def regrid_to_regular(data, rule):
y = np.linspace(y_min, y_max, int(y_max - y_min))
lon, lat = np.meshgrid(x, y)
interpolated = fesom2regular(data, mesh, lon, lat)
return xr.DataArray(interpolated, coords=[("lat", lat), ("lon", lon)])
return xr.DataArray(interpolated, coords=[("lon", lon), ("lat", lat)])


class FESOMRegridPipeline(FrozenPipeline):
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_fesom.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ def test_regridding(fesom_pi_mesh_config, fesom_pi_sst_ds):
rule = pymorize.rule.Rule.from_dict(config["rules"][0])
rule.mesh_file = config["inherit"]["mesh_file"]
da = fesom_pi_sst_ds.sst
pymorize.fesom.regrid_to_regular(da, rule)
da = pymorize.fesom.regrid_to_regular(da, rule)
assert da.shape == (360, 180)

0 comments on commit 8746c10

Please sign in to comment.