Regridding using lat/lon data

11 visualizaciones (últimos 30 días)
SR
SR el 10 de Nov. de 2016
Comentada: Hitesh Bugata el 29 de Jul. de 2020
I am working with runoff data on a high resolution regional grid. The grid is 560x560 in size and I need to regrid the data to be on a lower resolution grid of size 384x320. The high res data has latitude/longitude coordinates and one dimensional values for each grid cell. The low res grid has lat/lon locations. I need to map each grid cell from the high res grid onto a grid cell in the low res grid so that none of the runoff data is lost and the runoff total over the whole space will be preserved. I have been unable to find a nearest neighbor search function that can use lat/lon to map data across grids. Does anyone have any suggestions? Thank you!
  1 comentario
Hitesh Bugata
Hitesh Bugata el 29 de Jul. de 2020
Use griddedinterpolant(oldlat,oldlon,variable data, newlat,newlon).

Iniciar sesión para comentar.

Respuestas (3)

KSSV
KSSV el 10 de Nov. de 2016
doc interp2.

SR
SR el 10 de Nov. de 2016
Unfortunately interp2 does not work in this case because the query points are specified by the grid the data is being moved to so it loses a ton of data when going from a high res grid to a low res one as it doesn't look at the majority of cells within the high res grid. The matlab interpolation functions in general won't work here since the problem is essentially the opposite of interpolation.
  2 comentarios
KSSV
KSSV el 10 de Nov. de 2016
Have you tried interp2 and plot the result? When you use interp2 the values definitely match with your original grid.
SR
SR el 10 de Nov. de 2016
Yes. It does look accurate in a plot, however the summed runoff over the whole field is off by an order of magnitude due to the issues I listed above.

Iniciar sesión para comentar.


Walter Roberson
Walter Roberson el 10 de Nov. de 2016
Let first_lat be the latitude for runoff_data(1,:), last_lat be the latitude for runoff_data(end,:), first_long be the longitude for runoff_data(:,1), last_long be the longitude for runoff_data(:,end)
row_vector_of_old_latitudes = linspace(first_lat, last_lat, size(runoff_data,1));
column_vector_of_old_longitudes = linspace(first_long, last_long, size(runoff_data,2)).';
row_vector_of_new_latitudes = linspace(first_lat, last_lat, 384);
column_vector_of_new_longitudes = linspace(first_long, last_long, 320).';
new_runoff_data = interp2(row_vector_of_old_latitudes, column_vector_of_old_longitudes, runoff_data, row_vector_of_new_latitudes, column_vector_of_new_longitudes, 'linear');
  1 comentario
Walter Roberson
Walter Roberson el 10 de Nov. de 2016
Afterwards,
nrd = new_runoff_data * size(runoff_data,1)/size(new_runoff_data,1) * size(runoff_data,2)/size(new_runoff_data,2)
This will not be an exact preservation of the total. For example with my random sample data the total of nrd was 1725168.80255951 compared to an actual total of 1724560
Getting an exact preservation without simple scaling by the ratio is tricky.

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by