Getting average value of grid point data
Mostra commenti meno recenti
I have a grid point data column in the form of 0000 where first two digits is x-coordinates and last two digits is y-coordinates as shown in filename 'gridid.xlsx'. For each grid point data column, I have corresponding snow depth data column. The data is for 10 years.
I have locationid with x-coordinate and y-coordinates as shown in 'location.xlsx'. The locationid is located anywhere inside the grid. I would like to run for loop for each year and get a average snow depth for each locationid. The average is calculated from four nearest corner grid point snow depth data in which locationid is located. Could anybody help me to figure it out what is the necessary steps to do? Any advice is highly appreciated.
5 Commenti
dpb
il 27 Gen 2021
[OP Answer moved to Comment -- dpb]
Any advice or suggestion to start this?
dpb
il 27 Gen 2021
Not at all clear to me how the integer 2-digit gridid is supposed to relate to coordinates and determine anything about what are corners since the coordinates seem essentially uncorrelated to the locationid.
David Hill
il 27 Gen 2021
Average of 0000,0001,0100,0101 would correlate to average snow depth for 0000?
dpb
il 27 Gen 2021
If a grid is (one-digit, not two)...
00 01 02 03 ...
10 11 12 13 ...
20 21 22 23 ...
30 31 32 33 ...
...
and want to average blocks of four, the simplest would be to build the 2D array of accumulations by location and then use convolution or 2D filter or, if have Image Proc toolbox, blockproc
While they're randomaly arrange, it'll be slow and a pain to code...
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Geometric Transformation and Image Registration in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!