[GRASS-dev] [r.sun]

Anna Petrášová kratochanna at gmail.com
Thu Apr 28 06:31:11 PDT 2016


On Thu, Apr 28, 2016 at 9:02 AM, Markus Neteler <neteler at osgeo.org> wrote:
> On Thu, Apr 28, 2016 at 2:51 PM, Ben Hur Pintor <bnhr.dev at gmail.com> wrote:
>>> Long time back I added the SOLPOS support in r.sunmask.
>>> Do you have a pointer to the SPA source code? Because implementing it
>>> from a 40 pages PDF is expensive :-)
>>
>> Sorry about that. Hahaha. Here's the actual C code:
>> https://www.nrel.gov/midc/spa/
>
> "... The Software is being provided for internal, noncommercial
> purposes only and shall not be re-distributed. ..."
>
> Unfortunately it is non-free.
>
>>> You may consider to tile the data (r.tile) with sufficient overlap,
>>> then process these tiles in parallel.
>>
>> I was choosing between r.tile or simply setting smaller computational
>> regions.
>
> Fine but be sure to not leave out shadow relevant relief in case you
> are in a hilly / mountainous area.
> r.viewshed can help to some extent to figure out how large the region
> needs to be.
>
> Markus
>

Also for the tiling approach, you might want to test GridModule, an
example for r.slope.aspect here:

import grass.script as gscript
from grass.pygrass.modules.grid import GridModule

def main(elevation):
    region = gscript.region()
    width = region['cols'] // 2 + 1
    height = region['rows'] // 2 + 1

    grd = GridModule('r.slope.aspect', elevation=elevation, slope='slope',
                     debug=False, width=width, height=height,
                     overlap=10, processes=4, overwrite=True)
    grd.run()

if __name__ == '__main__':
    elevation = 'elevation'
    gscript.run_command('g.region', raster=elevation)
    main(elevation)


Best,

Anna

> --
> Markus Neteler
> http://www.mundialis.de - free data with free software
> http://grass.osgeo.org
> http://courses.neteler.org/blog
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev


More information about the grass-dev mailing list