Glynn Clements wrote on 08/16/2007 08:59 PM: > Markus Neteler wrote: > > >> to easier operate on incomplete time series from MODIS (and >> others), we would like to suggest attached patch. It >> adds a threshold to filter out incomplete pixel series >> before calling the aggregation function which saves us >> to perform extra runs on counting valid pixels and to >> post-filter the aggregated results. >> > > While I don't doubt that this is a useful optimisation for your > particular case, I'm generally opposed to adding such optimisations > for specific cases. > > A more general optimisation would be to extend the method= and output= > options to accept multiple values, so that you can compute multiple > aggregates in a single run. You would still need to combine the two > outputs with e.g. r.mapcalc, but you would only need one run of > r.series. > The optimization you propose is of course far more general than what we did, and could be extremely valuable.
Nonetheless, we think that introducing the threshold parameter is not really a special case hack: all it really does is a straightforward generalization of the current -n flag, transforming it from a ON/OFF switch to an integer value. The threshold parameter indicates the minimum number of non NULL inputs required for passing over the inputs to the aggregation function. It varies in the range [1,num_inputs]; thresh=num_inputs is equivalent to -n (return NULL unless the inputs are all non NULL), while thresh=1 is the standard behaviour (compute the aggregation if there is at least 1 non NULL input). Markus and Antonio ------------------ ITC -> dall'1 marzo 2007 Fondazione Bruno Kessler ITC -> since 1 March 2007 Fondazione Bruno Kessler ------------------ _______________________________________________ grass-dev mailing list grass-dev@grass.itc.it http://grass.itc.it/mailman/listinfo/grass-dev