<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.apple-style-span
        {mso-style-name:apple-style-span;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Andy,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>This should work great. Thanks for the quick reply!<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Nick<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
radiance-general-bounces@radiance-online.org
[mailto:radiance-general-bounces@radiance-online.org] <b>On Behalf Of </b>Andrew
Mcneil<br>
<b>Sent:</b> Wednesday, March 10, 2010 11:53 AM<br>
<b>To:</b> Radiance general discussion<br>
<b>Subject:</b> Re: [Radiance-general] calculating percentages of a given value
in a .dat / .ok file<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div>

<p class=MsoNormal>Hi Nick,<o:p></o:p></p>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>you can use rtrace's -f option to change the output format
from floating point to ascii. &nbsp;(-faa)<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>The conversion from RGB irradiance to illuminance is:<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>179 * ( 0.265*R + 0.670*G + 0.065*B )&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>so you can use rcalc to calculate the percentage you desire
like so:<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>rtrace ... &nbsp;| &nbsp;rcalc -e
'ill=($1*0.265+$2*0.670+$3*0.065)*179' -e '$1=ill/300'<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>Best,<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>Andy<o:p></o:p></p>

</div>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div>

<blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;
margin-left:4.8pt;margin-right:0in'>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div>

<p class=MsoNormal>On Wed, Mar 10, 2010 at 10:22 AM, Nick Hubof &lt;<a
href="mailto:nhubof@gmail.com" target="_blank">nhubof@gmail.com</a>&gt; wrote:<o:p></o:p></p>

<div>

<div><pre><span style='color:black'>Hi,</span><o:p></o:p></pre><pre><span
style='color:black'>I am trying to do a similar process as below email, but with an illuminance plot. </span><o:p></o:p></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><o:p></o:p></pre><pre><span
style='color:black'>&nbsp;</span><o:p></o:p></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><o:p></o:p></pre><pre><span
style='color:black'>The .ok file consists of illumination data by point.</span><o:p></o:p></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&nbsp;&nbsp; 1.570207e+000&nbsp;&nbsp; 9.277438e-001). </span><o:p></o:p></pre><pre><span
style='color:black'>When viewed in the Ecotect grid this value is 270.316 lux. </span><o:p></o:p></pre><pre><span
style='color:black'>&nbsp;</span><o:p></o:p></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 &#8216;real&#8217; values?</span><o:p></o:p></pre><pre><span
style='color:black'>&nbsp;</span><o:p></o:p></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><o:p></o:p></pre><pre><span
style='color:black'>rtrace </span><span style='font-size:14.0pt;color:black'>&#8230;</span><span
style='font-size:7.0pt;color:black'>rendering settings</span><span
style='font-size:14.0pt;color:black'>&#8230;</span><span style='color:black'> gridtest.oct &lt; gridtest.pts &gt; gridtest.dat </span><o:p></o:p></pre><pre><span
style='color:black'>@RENAME gridtest3.dat gridtest3.ok </span><o:p></o:p></pre><pre><span
style='color:black'>&nbsp;</span><o:p></o:p></pre><pre><span style='color:black'>Thanks,</span><o:p></o:p></pre><pre><span
style='color:black'>Nick</span><o:p></o:p></pre><pre><span style='color:black'>&nbsp;</span><o:p></o:p></pre><pre><span
style='color:black'>&nbsp;</span><o:p></o:p></pre><pre><span style='color:black'>&nbsp;</span><o:p></o:p></pre><pre><span
style='color:black'>&nbsp;</span><o:p></o:p></pre><pre><span style='color:black'>&nbsp;</span><o:p></o:p></pre><pre><span
style='color:black'>&nbsp;</span><o:p></o:p></pre><pre><span style='color:black'>From Greg Ward (<i>Mon Oct 20 10:12:17 PDT 2008)_</i></span><o:p></o:p></pre><pre><span
style='color:black'>&nbsp;</span><o:p></o:p></pre><pre><span style='color:black'>And here is one of the many possible standard Radiance tools ways:</span><o:p></o:p></pre><pre><span
style='color:black'>&nbsp;</span><o:p></o:p></pre><pre><span style='color:black'>pvalue -h -H -o -b -df input.pic | rcalc -if -of -e '$1=1;$2=if(179* </span><o:p></o:p></pre><pre><span
style='color:black'>$1-THRESHOLD,1,0)' | total -if2</span><o:p></o:p></pre><pre><span
style='color:black'>&nbsp;</span><o:p></o:p></pre><pre><span style='color:black'>You need to set THRESHOLD to the desired luminance value (in cd/ </span><o:p></o:p></pre><pre><span
style='color:black'>m^2).&nbsp; This will give you two numbers, the ratio of which is the&nbsp; </span><o:p></o:p></pre><pre><span
style='color:black'>percentage you seek.&nbsp; If you want to do it all on the command line,&nbsp; </span><o:p></o:p></pre><pre><span
style='color:black'>you can add:</span><o:p></o:p></pre><pre><span
style='color:black'>&nbsp;</span><o:p></o:p></pre><pre><span style='color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | rcalc -e '$1=100*$2/$1'</span><o:p></o:p></pre><pre><span
style='color:black'>&nbsp;</span><o:p></o:p></pre><pre><span style='color:black'>to the end of the pipe.</span><o:p></o:p></pre><pre><span
style='color:black'>&nbsp;</span><o:p></o:p></pre><pre><span style='color:black'>Best,</span><o:p></o:p></pre><pre><span
style='color:black'>-Greg</span><o:p></o:p></pre><pre><span style='color:black'>&nbsp;</span><o:p></o:p></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><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i> Date: October 20, 2008 3:42:28 AM PDT</i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i>&nbsp;</i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i> Hi,</i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i>&nbsp;</i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i> I suppose you can use some of standard Radiance tools for that, but &nbsp;</i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i> here is another way we use.</i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i>&nbsp;</i></span><o:p></o:p></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>&nbsp; </i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i> program you can create falsecolor image from your original radiance&nbsp; </i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i> image. If you define false color palette with 2 colors - one has&nbsp; </i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i> value 0 and another value you want to use as a threshold, and open&nbsp; </i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i> Statistiques dialog, you'll have&nbsp; percent for each color in the&nbsp; </i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i> tablle. You can also define the palette with more colors, for&nbsp; </i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i> various threshold values.</i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i>&nbsp;</i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i> Hope this helps,</i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i> Marija</i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i> De Luminae.</i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i>&nbsp;</i></span><o:p></o:p></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><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i> Hi All,</i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i> I have a radiance .pic with lux values calculated using rpict -i.&nbsp;&nbsp; </i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i> Is there a way to calculate the percentage of the pixels that are&nbsp; </i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i> at or above a specified value?</i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i> Thanks,</i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;<i> Galen</i></span><o:p></o:p></pre><pre><span
style='color:black'>&gt;&nbsp;</span><o:p></o:p></pre>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p>

</div>

</div>

<p class=MsoNormal style='margin-bottom:12.0pt'><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><o:p></o:p></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</blockquote>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>