--- ray/src/util/genBSDF.pl 2012/09/02 15:33:16 2.38
+++ ray/src/util/genBSDF.pl 2013/10/03 17:27:41 2.45
@@ -1,5 +1,5 @@
#!/usr/bin/perl -w
-# RCSid $Id: genBSDF.pl,v 2.38 2012/09/02 15:33:16 greg Exp $
+# RCSid $Id: genBSDF.pl,v 2.45 2013/10/03 17:27:41 greg Exp $
#
# Compute BSDF based on geometry and material description
#
@@ -24,7 +24,7 @@ my $nproc = 1;
my $doforw = 0;
my $doback = 1;
my $pctcull = 90;
-my $gunit = "Meter";
+my $gunit = "meter";
my @dim;
# Get options
while ($#ARGV >= 0) {
@@ -108,6 +108,7 @@ print
print "\n";
print
'System
+BSDF
@@ -117,18 +118,20 @@ print
printf "\t\t%.3f\n", $dim[5] - $dim[4];
printf "\t\t%.3f\n", $dim[1] - $dim[0];
printf "\t\t%.3f\n", $dim[3] - $dim[2];
-print "\t\tIntegral\n";
+print "\t\tOther\n";
+print " \n";
# Output MGF description if requested
if ( $geout ) {
- print "\t\t\n";
+ print "\t\n";
+ print "\t\t\n";
printf "xf -t %.6f %.6f 0\n", -($dim[0]+$dim[1])/2, -($dim[2]+$dim[3])/2;
open(MGFSCN, "< $mgfscn");
while () { print $_; }
close MGFSCN;
print "xf\n";
- print "\t\t\n";
+ print "\n";
+ print "\t\n";
}
-print " \n";
# Set up surface sampling
my $nx = int(sqrt($nsamp*($dim[1]-$dim[0])/($dim[3]-$dim[2])) + .5);
my $ny = int($nsamp/$nx + .5);
@@ -178,7 +181,7 @@ $disk2sq = '
norm_radians(p) : if(-p - PI/4, p + 2*PI, p);
in_disk_r = .999995*sqrt(Dx*Dx + Dy*Dy);
in_disk_phi = norm_radians(atan2(Dy, Dx));
-in_disk_rgn = floor((in_disk_phi + PI/4)/(PI/2)) + 1;
+in_disk_rgn = floor((.999995*in_disk_phi + PI/4)/(PI/2)) + 1;
out_square_a = select(in_disk_rgn,
in_disk_r,
(PI/2 - in_disk_phi)*in_disk_r/(PI/4),
@@ -274,7 +277,8 @@ $cmd = "rcalc -if3 -e 'Omega:PI/($ns*$ns)' " .
q{-e '$1=(0.265*$1+0.670*$2+0.065*$3)/Omega' };
if ($pctcull >= 0) {
$cmd .= "-of $td/" . ($bmodnm,$fmodnm)[$forw] . ".flt " .
- "| rttree_reduce -a -h -ff -t $pctcull -r $tensortree -g $ttlog2";
+ "| rttree_reduce -h -ff -t $pctcull -r $tensortree -g $ttlog2";
+ $cmd .= " -a" if ($tensortree == 3);
system "$cmd" || die "Failure running rttree_reduce";
} else {
$cmd .= "$td/" . ($bmodnm,$fmodnm)[$forw] . ".flt";
@@ -303,7 +307,7 @@ print
print "\t\t\tReflection $side\n";
print
' LBNL/Shirley-Chiu
- BRDF
+ BTDF
';
$cmd = "rcalc -if3 -e 'Omega:PI/($ns*$ns)' " .
@@ -404,8 +408,10 @@ $cmd = "cnt $ndiv $ny $nx | rcalc -of -e '$tcal' " .
system "$cmd" || die "Failure running: $cmd\n";
@tfarr = `$rccmd $td/$fmodnm.flt`;
die "Failure running: $rccmd $td/$fmodnm.flt\n" if ( $? );
+chomp(@tfarr);
@rfarr = `$rccmd $td/$bmodnm.flt`;
die "Failure running: $rccmd $td/$bmodnm.flt\n" if ( $? );
+chomp(@rfarr);
}
if ( $doback ) {
$cmd = "cnt $ndiv $ny $nx | rcalc -of -e '$tcal' " .
@@ -538,7 +544,7 @@ print
Reflection Front
LBNL/Klems Full
LBNL/Klems Full
- BRDF
+ BTDF
';
# Output front reflection (transposed order)
@@ -588,7 +594,7 @@ print
Reflection Back
LBNL/Klems Full
LBNL/Klems Full
- BRDF
+ BTDF
';
# Output back reflection (transposed order)