The average radiance across a particular field of view

Hi Radiance Community,

I have been looking into ways to implement the view angle and direction to irradiance calculation (preferably with the ‘rtrace’ program but I am sure if that’s possible) as an input to calculate the radiant flux for a given field of view, to compute the average radiance across a particular field of view (watts reaching a defined field of view). My priority is to use solid angles as input to the program.

If anyone has experience in this area, I’d appreciate any tips you may have.
Thanks!

Hi Parisa,

I’m not 100% sure what you are asking, but you might want to look at the rsensor tool, which takes an angular sensitivity function and traces importance samples to estimate a specific sensor output.

Cheers,
-Greg

P.S. I don’t know where to find the man page on the website, so I’m including it below for convenience.

1 Like

Thanks a lot for your reply. I think this is the program I can use and I have been experimenting with it. However, I would appreciate it if you can please clarify the angular sensitivity to me since I am using the program for research purposes. Is this the sensor sensitivity and how do I define it?
I assume a program such as ‘trance’ functions in a similar way but based on coordinates and vectors, if so how is the sensitivity defined for it?

Hi Parisa,

I’m not familiar with the “trance” program, so I don’t know what to say about that.

Regarding the Radiance “rsensor” tool, the man page shows how the sensor sensitivity is given as a spreadsheet, where relative sensitivity is organized into columns representing different azimuthal angles and rows of different polar angles. A polar angle of theta=0 corresponds to the view direction specified in the command-line view arguments (-vd) for that sensor. The -vu (view up) vector specifies the direction corresponding to a zero (phi=0) azimuthal angle, with positive angles following the right-hand rule (i.e., clockwise when looking in the -vd direction).

The sensitivity values will act as multipliers against the integrated radiances, essentially acting as an interpolated function over the (partial) sphere where samples are sent.

I hope this helps.
-Greg

1 Like

Thank you for the information and I appreciate your help.

About “trance”, I meant ‘rtrace’. I am sorry, I think my keyboard automatically changed the word.
So, does ‘rtrace’ use a built-in sensitivity function with the maximum sensitivity in the defined vector direction? If so, how are the sensitivity values defined for it?

Ah - gotta love autocorrect! The rtrace values are in watts/sr/meter^2 (i.e., radiance) if your scene is defined properly, or in watts/meter^2 (i.e., irradiance) with the rtrace -I or -i options. The rsensor program multiplies these values by whatever sensitivity coefficients you specify. If you were to define a hemisphere of coefficients, where each coefficient was the cosine of theta at that position, then rsensor would return irradiance (by performing the correct cosine-weighted integral).

In reality, rsensor does something slightly different and more efficient, which is it chooses samples based on the given weighting, sending more primary rays in the direction of greater sensitivity. That way, you don’t waste any samples on regions you don’t care about, and the final result is more accurate for a given number of ray samples.

1 Like

Hi Greg,

Thanks for all your help. I have a couple of questions about rsensor (again).

  1. In the azimuthal angle, what about 270 to 0(360) degrees? Is it going to be calculated by linear interpolation between 270 and 0?

  2. I need to do the calculations using rsensor for multiple views. For example, for 4 different view files, I have my commands as:

oconv xformlight.rad roommat.rad > room.oct
rsensor -h -vf viewf1.vf rsensorfile.dat room.oct
rsensor -h -vf viewf2.vf rsensorfile.dat room.oct
rsensor -h -vf viewf3.vf rsensorfile.dat room.oct
rsensor -h -vf viewf4.vf rsensorfile.dat room.oct
rtrace -I -as 4096 -ar 100 -aa 0.1 -ab 50 room.oct <inroom.dat> outroom.dat

And this gives me 4 lines of RGB values on Command Prompt. I was wondering how I can create the output in a separate file (similar to the output file for rtrace).

  1. what is the default if I am not using the -vu option?
  1. The sensitivities are not interpolated – rsensor takes the closest value. If you give only 4 phi angles, the closest will be 270 if phi is between 225 and 315°, and 0 if phi is between 315 and 45°.

  2. rsensor can take multiple views in one command, and produces the output values in order. So, you can use:

rsensor -h -vf viewf1.vf rsensorfile.dat -vf viewf2.vf rsensorfile.dat -vf viewf3.vf rsensorfile.dat -vf viewf4.vf rsensorfile.dat room.oct > output.dat

Even if this weren’t the case, you could always follow your runs with “>> output.dat” and that file would be appended with each value.

  1. The default with no “-vu” option is “0 0 1” just as for other Radiance tools that take view specifications.

Best,
-Greg

1 Like

Thank you so much for your reply, Greg.

I came across another issue with my calculations. For testing the rsensor program, I had my setup for a square room with either one luminaire (symmetrical distribution) in the center of the ceiling in one scenario and with 4 luminaires of the same type all placed at the same distance from all walls.

I used rsensor to calculate radiant flux for 90 degrees field of view at 2 different viewpoints, with 2 opposite view directions at each point (I tried to visualize this in the figure below, even though it is not an accurate representation I hope it helps to better communicate my problem here. The blue and red arrows each represent the same distances to one another)

And my expectation is that I’d get identical or. similar values for each rsensor calculation since the room is a square, all walls have the same reflectance levels, the viewpoints are located at the same distance to the walls, and luminaire(s) are arranged uniformly in the ceiling or located in the center. But I get 4 different values, and I can’t see why.

My sensor file looks like this:

and my commands are:

rsensor -h -vp 1.25 2.5 1 -vd 0 1 0 rsensorfile.dat room.oct
rsensor -h -vp 1.25 2.5 1 -vd 0 -1 0 rsensorfile.dat room.oct
rsensor -h -vp 3.75 2.5 1 -vd 0 1 0 rsensorfile.dat room.oct
rsensor -h -vp 3.75 2.5 1 -vd 0 -1 0 rsensorfile.dat room.oct
rtrace -h room.oct

I’m not sure what’s going on, either. You should get the same values. Can you upload your file, somewhere, so I can look at it? Or, you could generate 4 views corresponding to your 4 sensors to see what you can see.

-Greg

1 Like

@Parisa did this get resolved?

1 Like

Thanks for your help, Greg.

Sorry for not replying earlier. I wanted to run more simulations, but I realized it was the IES file (I did the calculations for luminous flux in different angles, and they don’t match although it was supposed to be symmetrical.)

These are the results for a 5mX5m room and the results for matching sensors (for example A&G - B&H…) are very close (but not identical, because of the random number generator?!).
Sorry, I should’ve guessed it was about the IES file.

A) rsensor -h -rd 10000 -vp 1.25 1.25 1.11 -vd 0 1 0 rsensorfile.dat room5.oct
7.8342e-02 7.8342e-02 7.8342e-02

B) sensor -h -rd 10000 -vp 1.25 1.25 1.11 -vd 0 -1 0 rsensorfile.dat room5.oct
7.1796e-02 7.1796e-02 7.1796e-02

C) rsensor -h -rd 10000 -vp 1.25 3.75 1.11 -vd 0 1 0 rsensorfile.dat room5.oct
7.1683e-02 7.1683e-02 7.1683e-02

D) rsensor -h -rd 10000 -vp 1.25 3.75 1.11 -vd 0 -1 0 rsensorfile.dat room5.oct
7.8340e-02 7.8340e-02 7.8340e-02

E) rsensor -h -rd 10000 -vp 3.75 3.75 1.11 -vd 0 1 0 rsensorfile.dat room5.oct
7.1454e-02 7.1454e-02 7.1454e-02

F) rsensor -h -rd 10000 -vp 3.75 3.75 1.11 -vd 0 -1 0 rsensorfile.dat room5.oct
7.8276e-02 7.8276e-02 7.8276e-02

G) rsensor -h -rd 10000 -vp 3.75 1.25 1.11 -vd 0 1 0 rsensorfile.dat room5.oct
7.8059e-02 7.8059e-02 7.8059e-02

H) rsensor -h -rd 10000 -vp 3.75 1.25 1.11 -vd 0 -1 0 rsensorfile.dat room5.oct
7.1558e-02 7.1558e-02 7.1558e-02

Glad you found the source of the larger errors. Your 10% variation is likely due to Monte Carlo sampling. If you give all your different views in a single rsensor call as I suggested in my earlier reply, your calculations will be quicker and more consistent, as they’ll be able to share the same irradiance cache. You can also try increasing the -ad parameter above the value reported by “rsensor -defaults”. Try doubling it, for example.

-Greg

1 Like