IDW interpolation in CDO
Added by Jonathan K over 4 years ago
Hi
I am remaping climate data from one grid to another and I would like to do it with the IDW method.
Is there a way to make use of this method within CDO?
Thanks for any comments!
Kind regards
Jonathan
Replies (8)
RE: IDW interpolation in CDO - Added by Ralf Mueller over 4 years ago
hi!
What exactly is the IDW method?
cheers
ralf
RE: IDW interpolation in CDO - Added by Jonathan K over 4 years ago
IDW stands for 'Inverse Distance Weighting'
It is a common method for spatial interpolation.
In case of further interest, here link to a good description of IDW:
https://gisgeography.com/inverse-distance-weighting-idw-interpolation/
I would like to use it as method in CDO but it is not part of the regular program it seems.
Is there a way to incorporate it anyhow? E.g. through an external library?
Kind regards
Jonathan
RE: IDW interpolation in CDO - Added by Uwe Schulzweida over 4 years ago
The CDO operator remapdis is an implementation of the Distance Weighted Interpolation method: https://code.mpimet.mpg.de/projects/cdo/embedded/index.html#x1-6230002.12.4
Cheers,
Uwe
RE: IDW interpolation in CDO - Added by Jonathan K over 4 years ago
Thanks Uwe,
we are looking at the documentation in SCRIP right now, to see if the Distance Weighted Interpolation method that is implementet here is equal to IDW and if it is not, to understand the difference.
I will post the outcome here for fututre reference.
Best regards
Jonathan
RE: IDW interpolation in CDO - Added by Jonathan K over 4 years ago
The remapdis operator in CDO actually is an implementation of the IDW method.
The documentation in SCRIP is mathematically not put very clearly. The equation that is presented there only describes how the weight of one source point is calculated by the code. The subsequent steps are not described. The weights will be multiplied with corresponding values and then summed up to calculate the actual destination value that is to be interpolated. SCRIP kind of just skips to explain that part...
As documented in the CDO users guide the remapdis operator uses 4 source values by default to interpolate the destination value.
So the remapdis operator is actually the implementation of IDW with 4 source points and the power set to 1.
Best regards
Jonathan
RE: IDW interpolation in CDO - Added by Gabe Bromley almost 4 years ago
Hello,
I am looking to use the remapdis method for extracting modeled hourly precipitation at lat-lon locations for comparison with station observations. The model is very high-resolution and storms might be displaced by a few grid cells, so a nearest neighbor approach is not ideal. What would be the process to do this or is there a way I can design a new operator for this?
Thanks for all you do,
Gabe
RE: IDW interpolation in CDO - Added by Gabe Bromley almost 4 years ago
Sorry I apparently didn't search well enough. It seems this might be the answer:
https://code.mpimet.mpg.de/boards/1/topics/7659
Thanks,
Gabe
RE: IDW interpolation in CDO - Added by Brendan DeTracey almost 4 years ago
For comparison with station data, I would first decide what geographical area my station represented. I would then use a CDO grid description file to create an unstructured grid with one grid cell. That cell's boundary(polygon) would represent your geographic area. The boundary(polygon) could simply be a circle defined by a constant distance from your station e.g. a 20 sided regular polygon of desired radius. Or you might have a boundary around your station based on geographic considerations e.g. topography. Finally, you use conservative remapping (remapcon
). With the CDO defaults, remapcon
calculates an area weighted averaged for your single grid cell(polygon).
Of course, bilinear or distance weighted might be accurate enough for your purposes, but the area weighted average will conserve the vertical flux. My 2cents.