[GRASS-dev] Re: [GRASS GIS] #1401: r.series for time series

GRASS GIS trac at osgeo.org
Sun Jul 10 04:53:57 EDT 2011


#1401: r.series for time series
---------------------------------+------------------------------------------
 Reporter:  mmetz                |       Owner:  grass-dev@…              
     Type:  enhancement          |      Status:  new                      
 Priority:  normal               |   Milestone:  7.0.0                    
Component:  Raster               |     Version:  svn-trunk                
 Keywords:  raster, time series  |    Platform:  All                      
      Cpu:  All                  |  
---------------------------------+------------------------------------------

Comment(by mmetz):

 Replying to [comment:1 glynn]:
 > Replying to [ticket:1401 mmetz]:
 >
 > > The attached patch adds weighing windows to r.series
 >
 > A few points:
 >
 > 1. This patch places the centre of the window in the centre of the time
 period; I would have expected this to be configurable. E.g. I can imagine
 situations where the most recent data would have the greatest weight, with
 weight decreasing as the data gets older. Unlike spatial data, time has an
 inherent asymmetry between past and future.

 Sometimes yes. You could also achieve this with r.series
 in=map01,map02,map03,map04,map03,map02,map01. The patch assumes, as does
 the existing r.series for regression parameters, that the input is ordered
 and the (time) distance between maps is constant. This can be exploited by
 changing the order of the input maps. r.series
 in=map01,map01,map01,map02,map02,map03,map04 should give more weight to
 map01 and map02 and less to map03 and map04, effectively skewing the
 weight function.
 >
 > 2. I don't see the stated modifications to the gauss/normal or sinc
 functions. They appear to be identical to the r.series versions. Also, I'm
 not sure why those modifications would make sense; e.g. the fact that
 sinc/lanczos have negative weights is one of their advantages, as it
 results in sharper output than filters with only positive weights.
 >
 The gauss/normal functions have a radius of 0 (zero) in
 r.resamp.filter/main.c:L102 and L103 to indicate that they are infinite I
 assume. I have changed this radius to 4 for gauss and 8 for normal since
 normal = f_gauss(x/2) / 2. These functions now cover the 99.9% confidence
 interval for the number of input maps (see also adjustment of the gauss
 window in v.kernel).

 The sinc function becomes negative for x larger than an odd multiple of PI
 and smaller than the next even multiple of PI. In the patch, x is always
 >= 0 && <= PI. In order to have a sharper sinc window, something like
 sinc2 and sinc3 would be needed, like lanczos2 and lanczos3. Or an
 additional option radius/distance.

 > 3. Is "radius" really the correct term for one-dimensional data?
 Not sure. It comes from cut'n paste and I kept the term to keep the code
 similar. The user doesn't see the term anyway.
 >
 > Possible enhancements:
 >
 > Allowing arbitrary weights (one per input map) to be read from a file
 and/or a command line option.
 >
 I was thinking about that too, similar to r.neighbors.

 > Accepting a list of weight maps (one per input map), i.e. each input
 cell is a value/weight pair rather than just a value.

 Hmm, I would need a new module anyway to calculate regression parameters
 between two time series. The second time series could also be treated as
 weight maps if a weighed version of the selected function is available.

 The current patch already makes r.series quite complicated, that's why I
 did not introduce more options like skew or radius/distance or custom
 weights.

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/1401#comment:3>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list