[GRASS-dev] Optimizing a script

Markus Neteler neteler at osgeo.org
Sat Oct 30 13:07:40 EDT 2010


On Sat, Oct 30, 2010 at 1:06 AM,  <antonio.rocha at deimos.com.pt> wrote:
> Greetings
>
> I have created a script to detect clouds/shadows (i.landsat.acca- Great work
> Jorge), grow of these pixels and then identify an area that is common to all
> bands (7).And at the end, turn these pixels into NULL. Above this paragraph
> I placed a part of this code. My problem is that, for regular satellite
> images  it's a very slow process. How can I optimize it? any suggestion?

You will need to find out where it is slow (profiling). Maybe
as simple debug just add datetime output every here and there to
see in which step it spends much time?

Markus

PS: Random link, perhaps helpful, too:
http://wiki.python.org/moin/PythonSpeed/PerformanceTips


More information about the grass-dev mailing list