#610: r.sun: incidout uses 0 instead of NULL
---------------------+------------------------------------------------------
  Reporter:  hamish  |       Owner:  [email protected]
      Type:  defect  |      Status:  new                      
  Priority:  normal  |   Milestone:  6.5.0                    
 Component:  Raster  |     Version:  6.4.0 RCs                
Resolution:          |    Keywords:  r.sun                    
  Platform:  All     |         Cpu:  All                      
---------------------+------------------------------------------------------
Comment (by mmetz):

 Next try. IIUR, incidout is calculated in rsunlib.c by lumcline(). For a
 shadowed area, sunVarGeom->isShadow is apparently set to 1 and incidence
 is left as 0. For an area where there is still night, incidence angle is
 negative and set to 0 (r.sun2/rsunlib.c#L439). That's why my first wild
 guess didn't work, it was probably setting night to NULL, not shadow. If
 any of the input maps is NULL, incidence (as all other output maps) is set
 to NULL (says the manual). To keep a maximum of information in the
 incidence output map, you could e.g. set incidence of shadows to -1, make
 night -2, keep special case incidence == 0 with no shadow, and propagate
 any input NULL cells as NULL cells. Then optionally use r.null to set
 shadows and/or night to NULL. Or discard all this info and make input NULL
 cells, night, shadow and special case incidence == 0 with no shadow all
 NULL (if (s <= 0) return UNDEFZ;)

 Not tested, all interpreted from the code and the manual.

 Markus M

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/610#comment:5>
GRASS GIS <http://grass.osgeo.org>
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to