[GRASS-dev] r.regression.line crash in awk (awk debugging)

Markus Neteler neteler at osgeo.org
Fri Aug 7 03:52:25 EDT 2009


On Fri, Aug 7, 2009 at 9:41 AM, Hamish<hamish_b at yahoo.com> wrote:
> Markus Neteler wrote:
>> echo "345.551054 1 1
>> 364.229489 1 1
>> 382.907925 1 3" | awk ...
> ....
>>       R     = (sumXY - sumX*sumY/tot)/((sumsqX - sumX^2/tot)*(sumsqY -
>> sumY^2/tot))^0.5;
>
> sumsqY = 5
> sumY = 5
> tot = 5
>
> thus (sumsqY - sumY^2/tot))^0.5  = 0

ok... but how to add "protection"?
The original input was 81 rows (pixels with certain temperature
and their corresponding altitude from DEM).

It prints out
print tot, sumX, sumsqX, sumY, sumsqY, sumXY
7432 9.17582e+06 1.14575e+10 7432 7432 9.17582e+06

Mhh, same situation again... perhaps I am just trying nonsense :)

cheers
Markus

PS: Should I commit the BEGIN initialization anyway?


More information about the grass-dev mailing list