| 4 |
|
# Complex glazing model (goes with glaze1.cal and glaze2.cal) |
| 5 |
|
# |
| 6 |
|
# Oct. 2002 Greg Ward |
| 7 |
+ |
# Aug. 2004 GW (added -f option to read glazings from file) |
| 8 |
+ |
# Funding for this development generously provided by Visarc, Inc. |
| 9 |
+ |
# (http://www.visarc.com) |
| 10 |
|
# |
| 11 |
|
|
| 12 |
|
################################################################# |
| 13 |
|
# |
| 14 |
+ |
# The general assumption is that one surface is uncoated, and |
| 15 |
+ |
# reflectances and transmittances are computed from this fact. |
| 16 |
+ |
# If the user tries to enter two coated surfaces on the same |
| 17 |
+ |
# pane, the script complains and exits. |
| 18 |
+ |
# |
| 19 |
|
# Supported surface types: |
| 20 |
|
# |
| 21 |
|
set sn_arr=("clear glass" "VE1-2M low-E coating" "PVB laminated" "V-175 white frit" "V-933 warm gray frit") |
| 34 |
|
# Boolean whether coatings can have partial coverage: |
| 35 |
|
set part_arr=(0 0 0 1 1) |
| 36 |
|
|
| 37 |
+ |
set gfiles=() |
| 38 |
+ |
while ($#argv > 0) |
| 39 |
+ |
set header="Surface Tr Tg Tb Rcr Rcg Rcb Rgr Rgg Rgb Part" |
| 40 |
+ |
if ($#argv < 2 || "$argv[1]" != '-f') then |
| 41 |
+ |
echo "Usage: $0 [-f glazing.dat ..]" |
| 42 |
+ |
exit 1 |
| 43 |
+ |
endif |
| 44 |
+ |
shift argv |
| 45 |
+ |
set gf="$argv[1]" |
| 46 |
+ |
shift argv |
| 47 |
+ |
set gfiles=($gfiles:q $gf:q) |
| 48 |
+ |
if ("`sed -n 1p $gf:q`" != "$header") then |
| 49 |
+ |
echo "Bad header in $gf -- Expected: $header" |
| 50 |
+ |
exit 1 |
| 51 |
+ |
endif |
| 52 |
+ |
echo "Adding glazing types from file $gf :" |
| 53 |
+ |
set nl=`wc -l < $gf:q` |
| 54 |
+ |
@ i=2 |
| 55 |
+ |
while ($i <= $nl) |
| 56 |
+ |
set ln=(`sed -n ${i}p $gf:q`) |
| 57 |
+ |
if ($#ln != 11) then |
| 58 |
+ |
echo "Expected 11 words in line: $ln" |
| 59 |
+ |
exit 1 |
| 60 |
+ |
endif |
| 61 |
+ |
echo $ln[1] |
| 62 |
+ |
set sn_arr=($sn_arr:q $ln[1]) |
| 63 |
+ |
set tn_r_arr=($tn_r_arr $ln[2]) |
| 64 |
+ |
set tn_g_arr=($tn_g_arr $ln[3]) |
| 65 |
+ |
set tn_b_arr=($tn_b_arr $ln[4]) |
| 66 |
+ |
set rc_r_arr=($rc_r_arr $ln[5]) |
| 67 |
+ |
set rc_g_arr=($rc_g_arr $ln[6]) |
| 68 |
+ |
set rc_b_arr=($rc_b_arr $ln[7]) |
| 69 |
+ |
set rg_r_arr=($rg_r_arr $ln[8]) |
| 70 |
+ |
set rg_g_arr=($rg_g_arr $ln[9]) |
| 71 |
+ |
set rg_b_arr=($rg_b_arr $ln[10]) |
| 72 |
+ |
set part_arr=($part_arr $ln[11]) |
| 73 |
+ |
@ i++ |
| 74 |
+ |
end |
| 75 |
+ |
end |
| 76 |
+ |
if (! $#gfiles) unset gfiles |
| 77 |
+ |
|
| 78 |
|
################################################################# |
| 79 |
|
# |
| 80 |
|
# Get user input |
| 157 |
|
echo "" |
| 158 |
|
echo "############################################" |
| 159 |
|
echo "# Glazing produced by Radiance glaze script" |
| 160 |
< |
echo "# `date`" |
| 160 |
> |
echo '# $Revision$' |
| 161 |
> |
if ($?gfiles) then |
| 162 |
> |
echo "# Loaded: $gfiles:q" |
| 163 |
> |
echo "# `date`" |
| 164 |
> |
endif |
| 165 |
|
echo "# Material surface normal points to interior" |
| 166 |
|
echo "# Number of panes in system: $np" |
| 167 |
|
|
| 225 |
|
else |
| 226 |
|
### Low-E glazing |
| 227 |
|
echo "10" |
| 228 |
< |
echo " sr_lowE_r sr_lowE_g sr_lowE_b" |
| 229 |
< |
echo " st_lowE_r st_lowE_g st_lowE_b" |
| 228 |
> |
echo " sr_clear_r sr_clear_g sr_clear_b" |
| 229 |
> |
echo " st_clear_r st_clear_g st_clear_b" |
| 230 |
|
echo " 0 0 0" |
| 231 |
|
echo " glaze1.cal" |
| 232 |
|
echo "0" |