[pcr] interpolation along curving lines or an LDD
WPA van Deursen
wvandeursen at carthago.nl
Wed Mar 23 08:23:35 CET 2005
Hello all,
it might be illustrative for this whole discussion to understand why
such a seemingly trivial function is not part of the PCRaster
functionality. After all, this function has been requested and analysed
many times before.
The main reason that it is currently not included is that once you are
outside the simple case of only one channel, if you are dealing with an
LDD NETwork, the (desired) functionality of this operation becomes very
cumbersome.
Consider the case of two branches A>C and B>C, which join in C and
flow further through C>D.
AsciiArt:
A>C<B


v
D
Now, if we have a concentration of x in A, a concentration of 0 in B and
a concentration of y in D and we want to interpolate, you start to see
that this problem is completely underdetermined. At least, I would like
to know the flowrate in channel A>C and the flowrate in channel B>C.
So if I know this flow rates, I can start doing some useful
interpolation. I should end up with something of a constant
concentration in A>C, a zero concentration in B>C and a to
concentration dependent on the flowrates in C>D. But, if thats the
case, then what does my measured concentration in D means, and what if
this concentration is not equal to the concentration in C? You see that
things start to become underdetermined.
Consider as the next case that its not concentrations that we want to
interpolate, but waterlevels. So now I have a known waterlevel in A of
x, a waterlevel of 0 in B and a known waterlevel of y in D. Now we do
want to interpolate along the line A>C>D, but, contrary to the first
case, we also want to have interpolated values along the line B>C. So,
a completely different schedule, for seemingly exactly the same case.
As shown, the wanted results of this function are very dependent on the
situation, and, until now, we as the developers of PCRaster have not
found a generalised solution that deals with all these cases. As long as
the generalised functions are not there, you can always use the
approaches Derek and Marcel pointed out, or write your own specialised
and casespecific dll.
Hope this explains some of the pitfalls of the lddinterpolator.
Have a nice day
Willem
Cees Wesseling wrote:
> indeed using repeat you can set the convergence criteria, to say 0.001
>
>
> repeat {
> prev = attribute.map;
> attribute.map = cover(attribute.pnt, if(river.map,
> windowaverage(attribute.map,3*celllength())));
> } until mapmaximum(abs(attribute.mapprev)) < 0.001;
>
> Marcel van der Perk wrote:
>
>> Daniël,
>>
>> Further to the suggestion by Derek to do a nearest neighbourhood
>> interpolation, you might prefer a linear interpolation along the river
>> network between the sampling locations. If so, this could be achieved by
>> repeating the following statement a number of times:
>>
>> attribute.map = cover(attribute.pnt, if(river.map,
>> windowaverage(attribute.map,3*celllength())))
>>
>> where
>> attribute.map = interpolated attribute values (concentrations)
>> attribute.pnt = attribute values (concentrations) to be interpolated at
>> the sampling locations (these should be located on the river network)
>> river.map = boolean map of the river network
>>
>> You should repeat this statement many (> 1000 ?) times, for example using
>> a dynamic loop or the new 'repeat until' conditional iteration. This will
>> take some computation time, but the final result will converge towards a
>> linear interpolation between the sampling locations.
>
>
>

WPA van Deursen
Carthago Consultancy
PCRaster Environmental Software
Oostzeedijk Beneden 23a
3062 VK Rotterdam
The Netherlands
T/F +31 (0)10  2130004
www.carthago.nl
More information about the pcrasterinfo
mailing list