[GRASS-user] Question about r.sun2 and r.horizon

Hamish hamish_b at yahoo.com
Mon Jun 16 10:45:59 EDT 2008


Nikos:
> r.horizon elevin=srtm3_stel step=45 horizon=horizon_45 coord=4275945
Hamish:
> > coord= should be x,y not just a single number.
> > 
> > So the parser knows to expect two numbers, in the
> > option setup code should include the line:
> >   parm.coord->key_desc = "east,north";

(added in SVN)
 
> I remember  using the centre x,y  in the beginning and
> changing it later only to x because I read the r.sun2 help which
> is:
> 
> [...]
> lat A single value of latitude
> [...]

the r.horizon code expects %lf,%lf. see main.c line 343.
http://trac.osgeo.org/grass/browser/grass-addons/raster/r.sun_horizon/r.horizon/main.c#L343
 


> > > for i in `seq 92 304`; do
> > >     r.sun2 -s --o elevin=srtm3_stel aspin=aspect_stel \
> > >         slopein=slope_stel alb=0.23 lin=5.2 lat=4275945 \
> > >         horizon=horizon.45 horizonstep=45 \
> > >         glob_rad=global_rad_$i day=$i; done
Hamish:
> > lat= must be in the range 0-90. it will be converted
> > to radians and so does not take projected northings as
> > input.
....
> > but as far as I can tell looking through the r.sun2
> > code, the *lt string is only ever used when writing out the
> > map's metadata/history. (??)

I added a comment about G_scan_lat() into the code, but the lat= answer is still unused by the code AFAICT. I am not sure of the authors' intentions so left it as-is.

don't feel bad, it is very important to find these things..


Hamish



      



More information about the grass-user mailing list