[GRASS-dev] [GRASS GIS] #2867: Add modifier parameter to r.series

GRASS GIS trac at osgeo.org
Tue Jan 19 05:33:20 PST 2016


#2867: Add modifier parameter to r.series
--------------------------+-------------------------
  Reporter:  pvanbosgeo   |      Owner:  grass-dev@…
      Type:  enhancement  |     Status:  new
  Priority:  normal       |  Milestone:  7.0.4
 Component:  Raster       |    Version:  unspecified
Resolution:               |   Keywords:  r.series
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+-------------------------

Comment (by mlennert):

 Replying to [comment:4 pvanbosgeo]:
 > Replying to [comment:2 glynn]:
 > > Replying to [ticket:2867 pvanbosgeo]:
 > > > An useful enhancement of r.series would be to add a "modifier" (or
 similar name) parameter to r.series
 > > > which would allow to calculate the statistic defined by "method" on
 a modified version of the maps (e.g. squared, square root, log, sin, cos,
 etc.).
 > >
 > > My main concern is that this is going to open the door to a never-
 ending stream of requests to add more modifiers or more features (e.g.
 parametric modifiers, or selecting modifiers on a per-output bases) until
 we end up having to embed either r.mapcalc or Python into r.series.
 > >
 > > OTOH, I'm aware that the usual solution (use in conjunction with
 r.mapcalc) has a significant overhead when you're potentially dealing with
 hundreds of input maps. Even so, I'd be inclined to limit the available
 modifiers to those which seem likely to be particularly useful (only
 sqrt/x^2 and log/exp spring to mind); there are a *lot* of real->real
 functions in the standard math library.
 >
 > Completely get your point.. but if I may still add a possibly very
 particularly useful one: pow(). It could possible be included instead of
 sqrt and x^2.

 The problem with pow() is that it needs to parameters and this would
 complicate things further.

 Another option, maybe more in line with Glynn's suggestion of extracting
 some or r.mapcalc into a library would be to create a
 modification_expression parameter which would take any arbitrary formula
 using r.mapcalc syntax (e.g. pow(x, 4.5) or cos(x)/sqrt(x), etc) where x
 represents the map input to r.series. But IIUC that would +/- mean
 recreating r.mapcalc within r.series...

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2867#comment:5>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list