[GRASS-dev] [GRASS GIS] #2941: r.sun: wrong sign in equation of time
GRASS GIS
trac at osgeo.org
Fri Mar 4 02:16:50 PST 2016
#2941: r.sun: wrong sign in equation of time
--------------------------+-------------------------
Reporter: tomhuld | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.4
Component: Default | Version: unspecified
Resolution: | Keywords:
CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Description changed by neteler:
Old description:
> Bug report ticket #2876 by fabriziosossan reported a problem with the
> equation of time in r.sun, whereby the calculation of the solar time from
> the clock (civil) time is wrong. The problem was fixed with a patch for
> GRASS 6, but as far as I know there the fix was not applied to GRASS 7.
>
> I would like to suggest the following patch for r.sun/main.c. Since this
> is my first patch for GRASS, apologies if I'm doing it worng.
>
> --- main.c (revision 67790)
> +++ main.c (working copy)
> @@ -1766,7 +1766,7 @@
> * "local clock time". */
> dayRad = 2. * M_PI * day / 365.25;
> locTimeOffset =
> - -0.128 * sin(dayRad - 0.04887) - 0.165 * sin(2 * dayRad +
> + +0.128 * sin(dayRad - 0.04887) + 0.165 * sin(2 * dayRad +
> 0.34383);
>
> /* Time offset due to timezone as input by user */
New description:
Bug report ticket #2876 by fabriziosossan reported a problem with the
equation of time in r.sun, whereby the calculation of the solar time from
the clock (civil) time is wrong. The problem was fixed with a patch for
GRASS 6, but as far as I know there the fix was not applied to GRASS 7.
I would like to suggest the following patch for r.sun/main.c. Since this
is my first patch for GRASS, apologies if I'm doing it worng.
{{{
--- main.c (revision 67790)
+++ main.c (working copy)
@@ -1766,7 +1766,7 @@
* "local clock time". */
dayRad = 2. * M_PI * day / 365.25;
locTimeOffset =
- -0.128 * sin(dayRad - 0.04887) - 0.165 * sin(2 * dayRad +
+ +0.128 * sin(dayRad - 0.04887) + 0.165 * sin(2 * dayRad +
0.34383);
/* Time offset due to timezone as input by user */
}}}
--
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2941#comment:1>
GRASS GIS <https://grass.osgeo.org>
More information about the grass-dev
mailing list