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

Hamish hamish_b at yahoo.com
Mon Jun 16 10:03:40 EDT 2008


> > r.horizon elevin=srtm3_stel step=45 horizon=horizon_45 coord=4275945

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";



> > 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

lat= must be in the range 0-90. it will be converted to radians and so does not take projected northings as input.

the parser option to ensure the 0-90 range is:
  parm.lat->options = "0-90";

although it might be nicer to allow DDD:MM:SS.SSS strings (e.g. "23:55N") then use G_lat_scan() to convert to a float. check the return value of that function to see if it is out of range and a G_fatal_error() is needed.

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. (??)



Hamish



      



More information about the grass-user mailing list