Opened 11 years ago

Closed 11 years ago

#2281 closed defect (fixed)

t.rast.aggregate unnecessaryly slow with limited number of maps

Reported by: sbl Owned by: grass-dev@…
Priority: normal Milestone: 7.0.0
Component: Default Version: unspecified
Keywords: Cc:
CPU: Unspecified Platform: Unspecified

Description

I was having some trouble with t.rast.aggregate which was much slower than running the same operation directly in r.series, making t.rast.aggregate almost useless (see performance comparison below).

I tracked the problem down to the usage of the z-flag in r.series.

Please find attached a patch for aggregation.py, which adds a check for the number of maps to be opened in r.series and uses the z- only if there is a danger for hitting a limit for open files (fix number of 1000 in the patch).

g.region -up projection: 1 (UTM) zone: 33 datum: etrs89 ellipsoid: grs80 north: 8000000 south: 6450000 west: -75000 east: 1120000 nsres: 1000 ewres: 1000 rows: 1550 cols: 1195 cells: 1852250

time t.rast.aggregate input=temperature method=average output=test base=test granularity="1 months" sampling=during where="start_time >= '2012-12-01' AND start_time < '2013-01-01'" --o --v Percent complete...

100%

Update metadata, spatial and temporal extent from all registered maps of

real 25m23.127s user 9m56.357s sys 15m22.446s

time r.series input=$(g.mlist type=rast pattern=tm_2012_12* separator=",") output=test method=average --o

100%

real 0m4.588s user 0m3.492s sys 0m0.764s

Attachments (1)

aggregation.diff (883 bytes ) - added by sbl 11 years ago.

Download all attachments as: .zip

Change History (3)

by sbl, 11 years ago

Attachment: aggregation.diff added

comment:1 by huhabla, 11 years ago

Thanks for this valuable patch. Applied in r60173.

comment:2 by sbl, 11 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.