<div>Hi Nick,<div><br></div><div>you can use rtrace&#39;s -f option to change the output format from floating point to ascii.  (-faa)</div><div><br></div><div>The conversion from RGB irradiance to illuminance is:</div><div>
179 * ( 0.265*R + 0.670*G + 0.065*B ) </div><div><br></div><div>so you can use rcalc to calculate the percentage you desire like so:</div><div>rtrace ...  |  rcalc -e &#39;ill=($1*0.265+$2*0.670+$3*0.065)*179&#39; -e &#39;$1=ill/300&#39;</div>
<div><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="font-size: medium; white-space: pre;"><font class="Apple-style-span" face="arial"><span class="Apple-style-span" style="font-size: small; white-space: normal;"><br>
</span></font></span></font></div><div>Best,</div><div>Andy</div></div><div><br></div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div><br><div class="gmail_quote">On Wed, Mar 10, 2010 at 10:22 AM, Nick Hubof <span dir="ltr">&lt;<a href="mailto:nhubof@gmail.com" target="_blank">nhubof@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">











<div lang="EN-US" link="blue" vlink="purple">

<div><pre><span style="color:black">Hi,</span></pre><pre><span style="color:black">I am trying to do a similar process as below email, but with an illuminance plot. </span></pre><pre><span style="color:black">I would like to know the % above a lighting threshold of 300lux in an illumination grid output from radiance.</span></pre>


<pre><span style="color:black"> </span></pre><pre><span style="color:black">My office uses Ecotect to build daylight models with 2d analysis grids (.pts). After running radiance the analysis grid is populated into a .dat file that is renamed in the Ecotect Batch to a .ok file.</span></pre>


<pre><span style="color:black">The .ok file consists of illumination data by point.</span></pre><pre><span style="color:black">So when I open the .ok file in a text editor the values are in exponential form, ie.. (1.501146e+000   1.570207e+000   9.277438e-001). </span></pre>


<pre><span style="color:black">When viewed in the Ecotect grid this value is 270.316 lux. </span></pre><pre><span style="color:black"> </span></pre><pre><span style="color:black">Is there a way to have rtrace give me that percentage while the batch is running or at least convert the data from exponential form to ‘real’ values?</span></pre>


<pre><span style="color:black"> </span></pre><pre><span style="color:black">Please let me know what to add to the batch, I assume it will be at the rtrace section or after in the batch:</span></pre><pre><span style="color:black">rtrace </span><span style="font-size:14.0pt;color:black">…</span><span style="font-size:7.0pt;color:black">rendering settings</span><span style="font-size:14.0pt;color:black">…</span><span style="color:black"> gridtest.oct &lt; gridtest.pts &gt; gridtest.dat </span></pre>


<pre><span style="color:black">@RENAME gridtest3.dat gridtest3.ok </span></pre><pre><span style="color:black"> </span></pre><pre><span style="color:black">Thanks,</span></pre><pre><span style="color:black">Nick</span></pre>


<pre><span style="color:black"> </span></pre><pre><span style="color:black"> </span></pre><pre><span style="color:black"> </span></pre><pre><span style="color:black"> </span></pre><pre><span style="color:black"> </span></pre>


<pre><span style="color:black"> </span></pre><pre><span style="color:black">From Greg Ward (<span><i>Mon Oct 20 10:12:17 PDT 2008)_</i></span></span></pre><pre><span style="color:black"> </span></pre><pre><span style="color:black">And here is one of the many possible standard Radiance tools ways:</span></pre>


<pre><span style="color:black"> </span></pre><pre><span style="color:black">pvalue -h -H -o -b -df input.pic | rcalc -if -of -e &#39;$1=1;$2=if(179* </span></pre><pre><span style="color:black">$1-THRESHOLD,1,0)&#39; | total -if2</span></pre>


<pre><span style="color:black"> </span></pre><pre><span style="color:black">You need to set THRESHOLD to the desired luminance value (in cd/ </span></pre><pre><span style="color:black">m^2).  This will give you two numbers, the ratio of which is the  </span></pre>


<pre><span style="color:black">percentage you seek.  If you want to do it all on the command line,  </span></pre><pre><span style="color:black">you can add:</span></pre><pre><span style="color:black"> </span></pre><pre><span style="color:black">        | rcalc -e &#39;$1=100*$2/$1&#39;</span></pre>


<pre><span style="color:black"> </span></pre><pre><span style="color:black">to the end of the pipe.</span></pre><pre><span style="color:black"> </span></pre><pre><span style="color:black">Best,</span></pre><pre><span style="color:black">-Greg</span></pre>


<pre><span style="color:black"> </span></pre><pre><span style="color:black">&gt;<i> From: &quot;Marija Velickovic&quot; &lt;<a href="http://www.radiance-online.org/mailman/listinfo/radiance-general" target="_blank">maricanis at gmail.com</a>&gt;</i></span></pre>


<pre><span style="color:black">&gt;<i> Date: October 20, 2008 3:42:28 AM PDT</i></span></pre><pre><span style="color:black">&gt;<i> </i></span></pre><pre><span style="color:black">&gt;<i> Hi,</i></span></pre><pre><span style="color:black">&gt;<i> </i></span></pre>


<pre><span style="color:black">&gt;<i> I suppose you can use some of standard Radiance tools for that, but  </i></span></pre><pre><span style="color:black">&gt;<i> here is another way we use.</i></span></pre><pre><span style="color:black">&gt;<i> </i></span></pre>


<pre><span style="color:black">&gt;<i> In Raddisplay <a href="http://deluminaelab.com/en/raddisplay_details.html" target="_blank">http://deluminaelab.com/en/raddisplay_details.html</a>  </i></span></pre><pre><span style="color:black">&gt;<i> program you can create falsecolor image from your original radiance  </i></span></pre>


<pre><span style="color:black">&gt;<i> image. If you define false color palette with 2 colors - one has  </i></span></pre><pre><span style="color:black">&gt;<i> value 0 and another value you want to use as a threshold, and open  </i></span></pre>


<pre><span style="color:black">&gt;<i> Statistiques dialog, you&#39;ll have  percent for each color in the  </i></span></pre><pre><span style="color:black">&gt;<i> tablle. You can also define the palette with more colors, for  </i></span></pre>


<pre><span style="color:black">&gt;<i> various threshold values.</i></span></pre><pre><span style="color:black">&gt;<i> </i></span></pre><pre><span style="color:black">&gt;<i> Hope this helps,</i></span></pre><pre><span style="color:black">&gt;<i> Marija</i></span></pre>


<pre><span style="color:black">&gt;<i> De Luminae.</i></span></pre><pre><span style="color:black">&gt;<i> </i></span></pre><pre><span style="color:black">&gt;<i> 2008/10/20 Galen Burrell &lt;<a href="http://www.radiance-online.org/mailman/listinfo/radiance-general" target="_blank">galenburrell at yahoo.com</a>&gt;</i></span></pre>


<pre><span style="color:black">&gt;<i> Hi All,</i></span></pre><pre><span style="color:black">&gt;<i> I have a radiance .pic with lux values calculated using rpict -i.   </i></span></pre><pre><span style="color:black">&gt;<i> Is there a way to calculate the percentage of the pixels that are  </i></span></pre>


<pre><span style="color:black">&gt;<i> at or above a specified value?</i></span></pre><pre><span style="color:black">&gt;<i> Thanks,</i></span></pre><pre><span style="color:black">&gt;<i> Galen</i></span></pre><pre><span style="color:black">&gt; </span></pre>




<p class="MsoNormal"> </p>

</div>

</div>


<br>_______________________________________________<br>
Radiance-general mailing list<br>
<a href="mailto:Radiance-general@radiance-online.org" target="_blank">Radiance-general@radiance-online.org</a><br>
<a href="http://www.radiance-online.org/mailman/listinfo/radiance-general" target="_blank">http://www.radiance-online.org/mailman/listinfo/radiance-general</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br>