[GRASS-dev] [GRASS GIS] #1624: i.tasscap speedup

#1624: i.tasscap speedup
-------------------------+--------------------------------------------------
Reporter: sprice | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
I made two changes to the i.tasscap script for a nice speedup. First I
combined all outputs into one mapcalc() call, resulting in a ~9% speedup.
Then I added an option to skip outputting the 'haze' raster for a total
~41% speedup. I also converted all tabs to spaces for consistency.
Attached is the diff.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1624&gt;
GRASS GIS <http://grass.osgeo.org>

#1624: i.tasscap speedup
-------------------------+--------------------------------------------------
Reporter: sprice | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by hamish):

ps- where do we stand on 8 spaces vs. 1 tab in python scripts?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1624#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1624: i.tasscap speedup
-------------------------+--------------------------------------------------
Reporter: sprice | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Python | Version: svn-trunk
Keywords: i.tasscap | Platform: All
      Cpu: All |
-------------------------+--------------------------------------------------
Changes (by hamish):

  * keywords: => i.tasscap
  * platform: Unspecified => All
  * component: Default => Python
  * cpu: Unspecified => All

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1624#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1624: i.tasscap speedup
-------------------------+--------------------------------------------------
Reporter: sprice | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Python | Version: svn-trunk
Keywords: i.tasscap | Platform: All
      Cpu: All |
-------------------------+--------------------------------------------------

Comment(by neteler):

Replying to [comment:1 hamish]:
> ps- where do we stand on 8 spaces vs. 1 tab in python scripts?

See #1832

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1624#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#1624: i.tasscap speedup
-------------------------+--------------------------------------------------
Reporter: sprice | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Python | Version: svn-trunk
Keywords: i.tasscap | Platform: All
      Cpu: All |
-------------------------+--------------------------------------------------

Comment(by lucadelu):

Replying to [ticket:1624 sprice]:
> I made two changes to the i.tasscap script for a nice speedup. First I
combined all outputs into one mapcalc() call, resulting in a ~9% speedup.
Then I added an option to skip outputting the 'haze' raster for a total
~41% speedup. I also converted all tabs to spaces for consistency.
Attached is the diff.

I tested the patch, with the updates of indentation that you can find in
the last attachment, but in my case the script is slower then the old one,
I'm using time to test the speed.

With the North Carolina landsat I obtain this value with the old version

{{{
real 0.84
user 0.70
sys 0.09
}}}

and this with the new one

{{{
real 0.85
user 0.73
sys 0.08
}}}

With bigger files the result is this, old

{{{
real 166.72
user 145.94
sys 4.79
}}}

new

{{{
real 169.69
user 146.95
sys 4.70
}}}

Please can you test again and send us your results?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1624#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#1624: i.tasscap speedup
---------------------------------+------------------------------------------
Reporter: sprice | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Python | Version: svn-trunk
Keywords: needinfo, i.tasscap | Platform: All
      Cpu: All |
---------------------------------+------------------------------------------
Changes (by lucadelu):

  * keywords: i.tasscap => needinfo, i.tasscap

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1624#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>