Usage of gendaylit

Hi,

I used `gendaylit` to create a light source and then used `rtrace` to calculate the total irradiance in the horizontal plane (GHI). I expected to not get a spatial homogeneous result because the sky shouldnt be isotrop with the gendaylit command I used. But Ive got quite the homogeneous result.

Is there something I did wrong when using gendaylit?

Here you can see my sky file:

# gendaylit -ang 31.079667233283445 145.77476488001884 -W 750 150 -O 1
# Local solar time: 0.00
# Solar altitude and azimuth: 31.1 145.8

void light solar
0
0
3 1.103e+07 1.103e+07 1.103e+07

solar source sun
0
0
4 -0.481708 0.708141 0.516229 0.533000

void brightfunc skyfunc
2 skybright perezlum.cal
0
10 4.603e+01 3.116e+01 -0.890991 -0.338041 13.098706 -3.400389 0.305582 -0.481708 0.708141 0.516229

skyfunc glow sky_glow
0
0
4 1 1 1 0

sky_glow source sky
0
0
4 0 0 1 180

Greetings Philip

Hi Philip,

What are we looking at in your plot, exactly? It seems to be an elliptical region â€“ are these points you have computed irradiance for on a horizontal plane? Are the â€śxâ€ť and â€śyâ€ť axes horizontal world coordinates?

It is an interesting pattern you are seeing. Were points computed along an elliptical spiral? You did not share your rtrace options, but it looks like the â€śambientâ€ť irradiance cache is active. The deviations you are seeing appear to be due to new calculation points, and the values span only a small range of less than 1%. This level of randomness is expected in a Monte Carlo calculation.

-Greg

Hi Greg,

first of all thanks for your fast reply. In the plot you can see a filled contour plot which shows the measured irradiance. The detector points are actually on a circle. But the aspect of the axes is unequal. Thats why it looks elliptical.

I used the following rtrace command:` rtrace -ab 1 -aa 0.22 -ar 512 -ad 1024 -as 512`.

You wrote:

The deviations you are seeing appear to be due to new calculation points, and the values span only a small range of less than 1%. This level of randomness is expected in a Monte Carlo calculation.

And this is what im not understanding. Because I also think that the deviations are because of nummerics and therefore the irradiance is virtually spatial constant/homogen. But I expected to have an spatial inhomogeneous result.

One can visualize the sky distribution on PD: CIE Sky Model. If Im understanding it correctly the CIE-Sky and the â€śPerez-Skyâ€ť are nearly identical. And if I use the tool from the website with nearly the same Perez-Params and sun position (like I used in `gendaylit` in Radiance) the sky distribution looks like this:

And with a distribution like this I expected that the diffuse irradiance in the horizontal plane is not spatially constant / homogeneous.

Greetings Philip

Sorry â€“ I misread the numbers on your axes. I now see that it is circular, not that it really matters.

The diagram you show is for directions in the sky hemisphere, rather than positions on a horizontal plane. The horizontal irradiance from any sky will be constant and uniform if there is no nearby geometry. This is because you are integrating a function that is infinitely distant. To get a plot like the one shown, you need to render a fisheye image looking skyward, not irradiances in a plane.

I hope this helps.

Best,
-Greg

Ah ok. Thanks. But for my interest: How do you achive that "the function is infinitely distant"?

Greetings Philip

The â€śsourceâ€ť primitive in Radiance specifies a solid angle at infinity, as described in the userâ€™s manual.

Cheers,
-Greg

I was more intereseted to find out how such a thing is implemented in the code. I already tried to find the anser in the source code but I couldnt find the information I wanted. It would be awesome if you could provide some further detail @Greg_Ward.

Furthermore I tried to understand gendaylit better. Therefore I used

``````# gendaylit -ang 31.079667233283445 -34.225235119981164 -W 750 150 -O 1
# Local solar time: 0.00
# Solar altitude and azimuth: 31.1 -34.2

void light solar
0
0
3 0 0 0

solar source sun
0
0
4 0.481708 -0.708141 0.516229 0.533000

void brightfunc skyfunc
2 skybright perezlum.cal
0
10 4.603e+01 3.116e+01 -0.890991 -0.338041 13.098706 -3.400389 0.305582 0.481708 -0.708141 0.516229

skyfunc glow sky_glow
0
0
4 1 1 1 0

sky_glow source sky
0
0
4 0 0 1 180
``````

as the light source and used rtrace with the same parameters as above to calculate the irradiance of a detector with a fixed position, which looks at every direction from North to South in 0.1 degree steps (in the xy-plane). The direction is described with the angle phi (0 â†’ North). The result ist the following:

Are the â€žjumpsâ€ś in the irradiance connected to the patch size oft the perez all weather sky?

Greetings Philip

these jumps are related to your parameter settings - you have the ambient cache on and you are sending out not enough rays. Are you using the -I option to get the irradiance?

with these settings here:
-I -ad 100000 -as 50000 -aa 0 -ab 1

I get following plot (with exactly your gendaylit output, which is actually from an outdated version) which is smooth (same sampling 0.1 degree, same axis units).:

remaining â€śstepsâ€ť can be made smoother with higher settings or e.g. using -u option.

Jan

1 Like

Jan is correct â€“ you are seeing artifacts of a too-coarse irradiance cache calculation, and the â€ś-aa 0â€ť option is the best way to turn it off so you see just the noise without any bias.

Regarding the source code where â€śsourceâ€ť is implemented, it is in ray/src/rt/source.c. (Is that enough sources for you?) Once a ray has escaped all geometry in the scene, the sourcehit() routine is called, which checks all the infinitely distant light sources for solid angle correspondence.

Hope this helps!
-Greg