Hi Jan,
It’s great to get a reply from the developer of DGP!
I’m happy to hear you are going to fix the bug. Some people seem to misunderstand the P distribution from evalglare is true. Evalglare is influential.
that is fixed in the newest version. Iwata and Osterhaus released at CIE2010 an updated version
The CIE2010 version was what I wanted to discuss next. I’m glad that you are going to implement it to evalglare.
But the image you gave is slightly different from the CIE2010 version, which is not concentric but an ellipse. CIE2010 version is squished vertically.
So I made a change in the source-code like this:
if (phi < 0) { tau = 90.0 ; }
Yes, Iwata mentioned like that and which means at a glance P below line of sight depends on only sigma like this.
posindex = exp(6.49 / 1000 * sigma + 21.0 / 100000 * sigma * sigma);
But it’s a little confusing. (and I guess it might have confused you too.) Iwata continued to mention like this.
sigma = atan[ {x^2+(y*1.15)^2}^0.5/z]
This “sigma” is not the normal sigma in the Guth model. Iwata defines the CIE2010 equation using xyz coordinate system.
So I prefer to replace “sigma” to something which is not duplicate with the existing variables. Let’s call it “beta” for now.
beta = atan[ {x^2+(y*1.15)^2}^0.5/z]
or I prefer to transform the coordinate system to the one using sigma and tau to make it more consistent with Guth model,
beta = atan(tan(sigma)* sqrt(1 + 0.3225 * pow(cos(tau),2)));
These tau and sigma are exactly normal sigma and tau in the Guth model. Both "beta"s are mathematically the same. And then you will get P like this.
posindex = exp(6.49 / 1000 * beta + 21.0 / 100000 * beta * beta);
I’ve added the CIE2010 equation into your evalglare.c and got the results below.
It is rounded oval (but hard to tell…) and has a small error when you use it for DGP and UGR unless you have large glare sources below line of sight.
}if (postype == 2) {
/* Guth model, equation from IES lighting handbook */
posindex =
exp((35.2 - 0.31889 * tau -
1.22 * exp(-2 * tau / 9)) / 1000 * sigma + (21 +
0.26667 * tau -
0.002963 * tau *
tau) / 100000 *
sigma * sigma);
/* below line of sight, using Iwata NEW model */
if (phi < 0) {
beta = atan(tan(sigma/deg)* sqrt(1 + 0.3225 * pow(cos(tau/deg),2))) * deg;
posindex = exp(6.49 / 1000 * beta + 21.0 / 100000 * beta * beta);
}
}
Kikuchi