[GRASS-dev] Re: r.series: threshold/count method?

Markus Neteler neteler at osgeo.org
Sun Aug 30 15:05:03 EDT 2009

On Fri, Aug 28, 2009 at 10:47 PM, Markus Neteler<neteler at osgeo.org> wrote:
> Hi,
> it would be ideal to have a new threshold/count method in r.series.
> Example: I am calculating growing degree days (accumulated temperatures
> over one year, [1]) and want to know at which day of year (count) this
> happens. Input would be 365 growing degree days maps, parameters
> a threshold value (e.g. 440 for insect moulting) and the result a
> count value per pixel which corresponds to the map number which
> I gave as input (which is the day of year DOY in this case).
> Would that be hard to implement? A bit of rounding/epsilon will be
> involved to match the requested threshold since the input maps
> are typically FP maps.
> I can imagine more use cases: first frost day in autumn (theshold -0.1°C
> or so), input daily minimum temperature maps and more...
> Markus
> [1] http://en.wikipedia.org/wiki/Growing_degree_day

Attached an attempt for review.
My problem is how to pass the threshold value into the function
(currently hardcoded sample value).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: c_thresh.c
Type: text/x-c
Size: 764 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20090830/bab4dcf4/c_thresh.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: thresh.diff
Type: text/x-diff
Size: 980 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20090830/bab4dcf4/thresh.bin

More information about the grass-dev mailing list