[GRASS-dev] r.sun and pj_do_proj() calls

Hamish hamish_b at yahoo.com
Tue Aug 3 04:32:30 EDT 2010


Seth wrote:
> Should I go with Hamish's patch in
> the previous email, or is there some ongoing work here? I
> think I'm getting ready to push to finish OpenCL r.sun.

Jaro's patch gives the same exact result as mine, but his is faster,
simpler, and more in sync with the historic code. I still have to study
Thomas's method a bit more to fully understand, but for now my observer's
money would be on taking Jaro's patch.

cheers,
Hamish






Jaro Hofierka wrote:
> > Hi Hamish,
> > 
> > Many thanks for your great work!
> > I expected some kind of skewness in the svn version,
> > because it always seeks a point in one direction:
> > 
> >>    delt_lat = -0.0001 * cos(inputAngle);  /* Arbitrary small distance in
> latitude */
> >>    delt_lon = 0.0001 * sin(inputAngle) / cos(latitude);

and yet mine does as well, but does not show the rotation.. ?
 
> > My idea is that perhaps the easiest way to deal with
> > the meridian convergence would be to do all calculations in
> > lat-lon, even for cartesian systems.
> > Even now we call pj_do_proj() to get lat-lon for every
> > grid point in main.c, so it might be more convenient to get
> > the lat-lon values in the beginning and then do everything
> > in lat-lon.
> > 
> > Kind regards,
> > 
> > Jaro
> > 
> > 
> > Hamish wrote:
> >> As suggested by Jaro, by
> >> - commenting out all the pj_do_proj() stuff, and
> >> - re-enabling sin(sunVarGeom->sunAzimuthAngle), and
> >> - using the -s shading flag, and
> >> - not using horizon maps,
> >> 
> >> I get the same exact output values as with my patch (attached), which
> >> replaces the proper pj_do_proj() reprojection with a simple cosine
> >> pseudo-projection.
> >> 
> >> Both Jaro's and my patches give slightly different results than the
> >> current SVN version based on pj_do_proj(). Looking at the test results
> >> from using a Gaussian mound the pj_() version seems to be rotated counter-
> >> clockwise by a little bit compared to the others. My best guess is that
> >> this is due to the 0.9 degree difference between grid-north and
> >> true-north at this site (`g.region -n`), as it is the pj_do_proj()
> >> version which seems to be slightly askew, the others seem to be
> >> symmetric. But perhaps that rotation is more than 1 deg?



      


More information about the grass-dev mailing list