# Spherical sensor

Hi all,

I am calculating spherical illuminance(lux) or irradiance (W/m2), that is
the irradiance of a small spherical sensor in a room. I think it might be
possible if the cosine-correction process for light meter is modifiable. Do
you have any idea?

Best,
Minki

Hi Minki,

If this quantity is equal to the integral of luminance over the full sphere, then it would be the same as 4*PI times the average luminance in all directions. You can compute the latter quantity by averaging the output of an appropriate rtrace calculation of random rays over the sphere. Something like the following should work:

set N=10000
set orig=(0 0 0)
cnt \$N | rcalc -of -e 'Dz=1-2*(\$1+rand(.77-.61*recno))/'\$N -e 'phi=2*PI*(\$1+rand(-.10+.39*recno))'/\$N \
-e 'rxy=sqrt(1-Dz*Dz);Dx=rxy*cos(phi);Dy=rxy*sin(phi)' \
-e "Ox:\$orig[1];Oy:\$orig[2];Oz:\$orig[3]" \
-e '\$1=Ox;\$2=Oy;\$3=Oz;\$4=Dx;\$5=Dy;\$6=Dz' \
> rtrace -h -ff [options] scene.oct \
> total -if3 -m \
> rcalc -e '\$1=179*4*PI*(\$1*.265+\$2*.670+\$3*.065)'

This should take ray samples in a stratified random spiral over the sphere. The 3 averaged radiance values (RGB) output should be multiplied by 179 and 4*PI as above, unless I misunderstand the definition of spherical illuminance.

Best,
-Greg

···

From: Minki Sung <minki.sung@gmail.com>
Date: December 14, 2011 7:02:14 PM PST

Hi all,

I am calculating spherical illuminance(lux) or irradiance (W/m2), that is the irradiance of a small spherical sensor in a room. I think it might be possible if the cosine-correction process for light meter is modifiable. Do you have any idea?

Best,
Minki

Hi Greg,

I am sorry for my too late response to your kind comment. I read your
script and it is so helpful. I am using Radiance to calculate ultraviolet
intensity. So I don't need to convert radiance to illuminance, but need to
revise the script for multiply points sampling.
Thank you as always.

Best,
Minki

···

-----------------------------------------------------------

Hi Minki,

If this quantity is equal to the integral of luminance over the full
sphere, then it would be the same as 4*PI times the average luminance in
all directions. You can compute the latter quantity by averaging the
output of an appropriate rtrace calculation of random rays over the sphere.
Something like the following should work:

set N=10000
set orig=(0 0 0)
cnt \$N | rcalc -of -e 'Dz=1-2*(\$1+rand(.77-.61*recno))/'\$N -e
'phi=2*PI*(\$1+rand(-.10+.39*recno))'/\$N \
-e 'rxy=sqrt(1-Dz*Dz);Dx=rxy*cos(phi);Dy=rxy*sin(phi)' \
-e "Ox:\$orig[1];Oy:\$orig[2];Oz:\$orig[3]" \
-e '\$1=Ox;\$2=Oy;\$3=Oz;\$4=Dx;\$5=Dy;\$6=Dz' \
> rtrace -h -ff [options] scene.oct \
> total -if3 -m \
> rcalc -e '\$1=179*4*PI*(\$1*.265+\$2*.670+\$3*.065)'

This should take ray samples in a stratified random spiral over the sphere.
The 3 averaged radiance values (RGB) output should be multiplied by 179
and 4*PI as above, unless I misunderstand the definition of spherical
illuminance.

Best,
-Greg

From: Minki Sung <minki.sung@gmail.com>
Date: December 14, 2011 7:02:14 PM PST

Hi all,

I am calculating spherical illuminance(lux) or irradiance (W/m2), that is

the irradiance of a small spherical sensor in a room. I think it might be
possible if the cosine-correction process for light meter is modifiable. Do
you have any idea?

Best,
Minki

--
Minki Sung, Ph.D.

Building Technology Team
Korea Institute of Construction Technology
TEL.+82-31-9100-586
FAX.+82-31-9100-361

Hi Minki!

I am sorry for my too late response to your kind comment. I read your script and it is so helpful. I am using Radiance to calculate ultraviolet intensity. So I don't need to convert radiance to illuminance, but need to revise the script for multiply points sampling.
Thank you as always.

The script can do that, you just need to remove the multiplication with Radiance's assumed luminous efficacy (179) and the color weighting (R*.265+G*.670+B*.065) in the last line. So let the script end as

(...)

total -if3 -m

And remove the backslash and the last line. I am assuming that you have set equal values in all channels (R=G=B in all source, material definitions).

Unfortunately, especially for small light sources of high intensity, you must set a rather high sampling density N not to miss out important sources. The script sends out rays to random directions, other then Radiance's integrated direct calculation which keeps a list of sources with known locations to check.

Cheers, Lars.

Hi Lars~

I modified the script as follows, because i use just one channel out of RGB
channels.

set N=10000
cnt 10 10 10 \$N | rcalc -of -e 'Dz=1-2*(\$4+rand(.77-.61*recno))/'\$N \
-e 'phi=2*PI*(\$4+rand(-.10+.39*recno))'/\$N \
-e 'rxy=sqrt(1-Dz*Dz);Dx=rxy*cos(phi);Dy=rxy*sin(phi)' \
-e 'Ox=\$1*.02+0.02;Oy=\$2*0.02+0.02;Oz=\$3*0.02+0.02' \
-e '\$1=Ox;\$2=Oy;\$3=Oz;\$4=Dx;\$5=Dy;\$6=Dz' \
> rtrace -h -ff -oov -ar 256 -as 256 -ad 512 -ab 3 scene.oct \
> total -if4 -10000 -m \
> rcalc -e '\$1=\$1;\$2=\$2;\$3=\$3;\$4=4*PI*\$4' > fluence.dat

I checked appropriate number of rays to trace for some positions and
changes below 1% in results were observed between 10000 and more rays, but
less than 10000 was not desirable. I need to check for all the positions
concerned.

Many thank you~

Best,
Minki

···

-----------------------------------------------------------------------------------------------------------

Hi Minki!

I am sorry for my too late response to your kind comment. I read your
script and it is so helpful. I am using Radiance to calculate
ultraviolet intensity. So I don't need to convert radiance to
illuminance, but need to revise the script for multiply points sampling.
Thank you as always.

The script can do that, you just need to remove the multiplication with
Radiance's assumed luminous efficacy (179) and the color weighting
(R*.265+G*.670+B*.065) in the last line. So let the script end as

(...)

total -if3 -m

And remove the backslash and the last line. I am assuming that you have
set equal values in all channels (R=G=B in all source, material
definitions).

Unfortunately, especially for small light sources of high intensity, you
must set a rather high sampling density N not to miss out important
sources. The script sends out rays to random directions, other then
Radiance's integrated direct calculation which keeps a list of sources
with known locations to check.

Cheers, Lars.

--
Minki Sung, Ph.D.

Building Technology Team
Korea Institute of Construction Technology
TEL.+82-31-9100-586
FAX.+82-31-9100-361

Hi Minki,

set N=10000
cnt 10 10 10 \$N | rcalc -of -e 'Dz=1-2*(\$4+rand(.77-.61*recno))/'\$N \
-e 'phi=2*PI*(\$4+rand(-.10+.39*recno))'/\$N \
-e 'rxy=sqrt(1-Dz*Dz);Dx=rxy*cos(phi);Dy=rxy*sin(phi)' \
-e 'Ox=\$1*.02+0.02;Oy=\$2*0.02+0.02;Oz=\$3*0.02+0.02' \
-e '\$1=Ox;\$2=Oy;\$3=Oz;\$4=Dx;\$5=Dy;\$6=Dz' \
> rtrace -h -ff -oov -ar 256 -as 256 -ad 512 -ab 3 scene.oct \
> total -if6 -10000 -m \
> rcalc -e '\$1=\$1;\$2=\$2;\$3=\$3;\$4=4*PI*(\$4+\$5+\$6)/3' > fluence.dat

The "-oov" option of rtrace will output 6 floating point values, the XYZ origin for the ray and the RGB value. Your "total" command with "-if4" was not matching record boundaries, so the results would be all wrong.

Best,
-Greg

···

From: Minki Sung <minki.sung@gmail.com>
Date: April 21, 2012 11:48:41 AM PDT

Hi Lars~

I modified the script as follows, because i use just one channel out of RGB channels.

set N=10000
cnt 10 10 10 \$N | rcalc -of -e 'Dz=1-2*(\$4+rand(.77-.61*recno))/'\$N \
-e 'phi=2*PI*(\$4+rand(-.10+.39*recno))'/\$N \
-e 'rxy=sqrt(1-Dz*Dz);Dx=rxy*cos(phi);Dy=rxy*sin(phi)' \
-e 'Ox=\$1*.02+0.02;Oy=\$2*0.02+0.02;Oz=\$3*0.02+0.02' \
-e '\$1=Ox;\$2=Oy;\$3=Oz;\$4=Dx;\$5=Dy;\$6=Dz' \
> rtrace -h -ff -oov -ar 256 -as 256 -ad 512 -ab 3 scene.oct \
> total -if4 -10000 -m \
> rcalc -e '\$1=\$1;\$2=\$2;\$3=\$3;\$4=4*PI*\$4' > fluence.dat

I checked appropriate number of rays to trace for some positions and changes below 1% in results were observed between 10000 and more rays, but less than 10000 was not desirable. I need to check for all the positions concerned.

Many thank you~

Best,
Minki

Hi Greg,

That's because I use only one channel out of three; R in my sample script.
But I noticed that all the six records should be read using 'total -if6'
even if only four (ox, oy, oz, R) out of six would be used.

Thank you a lot!

Best,
Minki

Yes, Minki. That is exactly right.

Best,
-Greg

···

From: Minki Sung <minki.sung@gmail.com>
Date: April 22, 2012 6:39:57 PM PDT

Hi Greg,

That's because I use only one channel out of three; R in my sample script. But I noticed that all the six records should be read using 'total -if6' even if only four (ox, oy, oz, R) out of six would be used.

Thank you a lot!

Best,
Minki