how to re-center spatial data (longitudes centered on 0) before grid interpolation?

1 次查看(过去 30 天)
I would like interpolate a spatial data file (lat_old, long_old) to a different grid (lat_new, lon_new), where the grid size is different and latitudes are centered on zero.
I tried the following:
[X,Y]=meshgrid(lon_old,lat_old);
[X_new,Y_new]=meshgrid(lon_new,lat_new);
data_new= interp2(X,Y,data_old',X_new,Y_new);
However, the old longitudes are (0,360), while the new grid is centered on 0 (-180,180). The code above only performs interpolation for the positive part of the new grid, and yields NaN for negative longitude values (-180,0). (Please note that grid sizes are also different, and the new grid is centered on longitude 0)
How do I re-center 'data_old' with longitude values (0,360) to (-180,-180), before performing the interpolation to a new grid size?

采纳的回答

KSSV
KSSV 2016-6-23
To change 0 to 360 grid to -180 to +180, you need not to interpolate. Check resolution between 0 to 360, take the same resolution from -180 to +180 and replace 0 to 360 with -180 to +180. Once you have done this, then you may go for interpolation to get the grid for any other resolution.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by