orig/glaze.csh
author Axel Jacobs <axel@jaloxa.eu>
Mon, 14 Apr 2014 22:21:17 +0100
changeset 73 87fa3132a136
parent 0 0aa115157c9c
permissions -rw-r--r--
New IES test file with spaces in file name
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
     1
#!/bin/csh -f
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
     2
# RCSid: $Id: glaze.csh,v 2.8 2009/11/05 19:00:50 greg Exp $
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
     3
#
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
     4
# Complex glazing model (goes with glaze1.cal and glaze2.cal)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
     5
#
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
     6
# Oct. 2002 Greg Ward
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
     7
# Aug. 2004 GW (added -f option to read glazings from file)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
     8
# Funding for this development generously provided by Visarc, Inc.
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
     9
# (http://www.visarc.com)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    10
#
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    11
# Nov. 2009 Jack de Valpine - Visarc, Inc.
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    12
#     -f option now clears the internal demo database and accepts
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    13
#        a clear glass definition as the first entry
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    14
#        in the database file
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    15
#         
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    16
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    17
#################################################################
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    18
#
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    19
# The general assumption is that one surface is uncoated, and
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    20
# reflectances and transmittances are computed from this fact.
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    21
# If the user tries to enter two coated surfaces on the same
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    22
# pane, the script complains and exits.
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    23
#
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    24
# Supported surface types (clear glass prepended below):
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    25
#
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    26
set sn_arr=("VE1-2M low-E coating" "PVB laminated" "V-175 white frit" "V-933 warm gray frit")
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    27
# Glass-side hemispherical reflectances for each surface type:
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    28
set rg_r_arr=(0.065 .11 0.33 0.15)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    29
set rg_g_arr=(0.058 .11 0.33 0.15)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    30
set rg_b_arr=(0.067 .11 0.33 0.15)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    31
# Coating-side hemispherical reflectance for each surface type:
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    32
set rc_r_arr=(0.042 .11 0.59 0.21)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    33
set rc_g_arr=(0.049 .11 0.59 0.21)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    34
set rc_b_arr=(0.043 .11 0.59 0.21)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    35
# Hemispherical (normal) transmittance for each surface type:
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    36
set tn_r_arr=(0.756 0.63 0.21 0.09)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    37
set tn_g_arr=(0.808 0.63 0.21 0.09)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    38
set tn_b_arr=(0.744 0.63 0.21 0.09)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    39
# Boolean whether coatings can have partial coverage:
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    40
set part_arr=(0 0 1 1)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    41
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    42
set gfiles=()
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    43
while ($#argv > 0)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    44
	set header="Surface	Tr	Tg	Tb	Rcr	Rcg	Rcb	Rgr	Rgg	Rgb	Part"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    45
	if ($#argv < 2 || "$argv[1]" != '-f') then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    46
		echo "Usage: $0 [-f glazing.dat ..]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    47
		exit 1
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    48
	endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    49
	shift argv
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    50
	# Clear internal default database
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    51
	set sn_arr=()
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    52
	set rg_r_arr=() ; set rg_g_arr=() ; set rg_b_arr=()
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    53
	set rc_r_arr=() ; set rc_g_arr=() ; set rc_b_arr=()
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    54
	set tn_r_arr=() ; set tn_g_arr=() ; set tn_b_arr=()
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    55
	set part_arr=()
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    56
	set gf="$argv[1]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    57
	shift argv
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    58
	set gfiles=($gfiles:q $gf:q)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    59
	if ("`sed -n 1p $gf:q`" != "$header") then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    60
		echo "Bad header in $gf -- Expected: $header"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    61
		exit 1
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    62
	endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    63
	echo "Adding glazing types from file $gf :"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    64
	set nl=`wc -l < $gf:q`
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    65
	@ i=2
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    66
	while ($i <= $nl)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    67
		set ln=(`sed -n ${i}p $gf:q`)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    68
		if ($#ln != 11) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    69
			echo "Expected 11 words in line: $ln"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    70
			exit 1
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    71
		endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    72
		echo $ln[1]
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    73
		set sn_arr=($sn_arr:q $ln[1])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    74
		set tn_r_arr=($tn_r_arr $ln[2])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    75
		set tn_g_arr=($tn_g_arr $ln[3])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    76
		set tn_b_arr=($tn_b_arr $ln[4])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    77
		set rc_r_arr=($rc_r_arr $ln[5])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    78
		set rc_g_arr=($rc_g_arr $ln[6])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    79
		set rc_b_arr=($rc_b_arr $ln[7])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    80
		set rg_r_arr=($rg_r_arr $ln[8])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    81
		set rg_g_arr=($rg_g_arr $ln[9])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    82
		set rg_b_arr=($rg_b_arr $ln[10])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    83
		set part_arr=($part_arr $ln[11])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    84
		@ i++
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    85
	end
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    86
end
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    87
if (! $#gfiles) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    88
	unset gfiles
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    89
	echo "###"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    90
	echo "### NOTE: Using internal demo database!"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    91
	echo "###"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    92
	echo
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    93
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    94
#
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    95
# Make sure we have a clear glazing definition
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    96
#
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    97
if (`rcalc -n -e 'ad(a,b)=if(a-b,a-b,b-a);$1=if('"ad($rg_r_arr[1],$rc_r_arr[1])+ad($rg_g_arr[1],$rc_g_arr[1])+ad($rg_b_arr[1],$rc_b_arr[1])-.005,1,0)"`) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    98
	set sn_arr=("clear glass" $sn_arr:q)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
    99
	set rg_r_arr=(0.074 $rg_r_arr)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   100
	set rg_g_arr=(0.077 $rg_g_arr)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   101
	set rg_b_arr=(0.079 $rg_b_arr)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   102
	set rc_r_arr=(0.074 $rc_r_arr)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   103
	set rc_g_arr=(0.077 $rc_g_arr)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   104
	set rc_b_arr=(0.079 $rc_b_arr)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   105
	set tn_r_arr=(0.862 $tn_r_arr)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   106
	set tn_g_arr=(0.890 $tn_g_arr)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   107
	set tn_b_arr=(0.886 $tn_b_arr)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   108
	set part_arr=(0 $part_arr)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   109
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   110
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   111
#################################################################
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   112
#
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   113
# Get user input
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   114
#
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   115
echo -n "Enter the number of panes in the system: "
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   116
set np="$<"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   117
if ($np != 1 && $np != 2) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   118
	echo "Must be 1 or 2 pane system"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   119
	exit 1
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   120
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   121
echo ""
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   122
echo "Window normal faces interior"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   123
echo ""
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   124
if ($np == 1) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   125
echo "  | |"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   126
echo "  | |"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   127
echo "  | |"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   128
echo "  | |-->"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   129
echo "  | |"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   130
echo "  | |"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   131
echo "  | |"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   132
echo " s1 s2"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   133
else
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   134
echo "  | |    | |"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   135
echo "  | |    | |"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   136
echo "  | |    | |"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   137
echo "  | |    | |-->"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   138
echo "  | |    | |"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   139
echo "  | |    | |"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   140
echo "  | |    | |"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   141
echo " s1 s2  s3 s4"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   142
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   143
echo ""
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   144
echo "Supported surface types are:"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   145
set i=1
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   146
while ($i <= $#sn_arr)
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   147
	echo "  " $i - $sn_arr[$i]
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   148
	@ i++
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   149
end
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   150
echo ""
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   151
echo -n "What is the type of s1? "
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   152
set s1t="$<"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   153
echo -n "What is the type of s2? "
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   154
set s2t="$<"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   155
if ($s1t != 1 && $s2t != 1) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   156
	echo "One surface of each pane must be $sn_arr[1]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   157
	exit 1
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   158
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   159
if ($part_arr[$s1t]) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   160
	echo -n "Enter fraction coverage for s1 (0-1): "
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   161
	set s1c="$<"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   162
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   163
if ($part_arr[$s2t]) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   164
	echo -n "Enter fraction coverage for s2 (0-1): "
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   165
	set s2c="$<"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   166
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   167
if ($np == 2) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   168
echo -n "What is the type of s3? "
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   169
set s3t="$<"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   170
echo -n "What is the type of s4? "
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   171
set s4t="$<"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   172
if ($s3t != 1 && $s4t != 1) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   173
	echo "One surface of each pane must be $sn_arr[1]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   174
	exit 1
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   175
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   176
if ($part_arr[$s3t]) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   177
	echo -n "Enter fraction coverage for s3 (0-1): "
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   178
	set s3c="$<"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   179
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   180
if ($part_arr[$s4t]) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   181
	echo -n "Enter fraction coverage for s4 (0-1): "
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   182
	set s4c="$<"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   183
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   184
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   185
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   186
#################################################################
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   187
#
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   188
# Begin material comments
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   189
#
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   190
echo ""
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   191
echo "############################################"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   192
echo "# Glazing produced by Radiance glaze script"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   193
echo '# $Revision: 2.8 $'
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   194
if ($?gfiles) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   195
	echo "# Loaded: $gfiles:q"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   196
	echo -n "# " ; date
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   197
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   198
echo "# Material surface normal points to interior"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   199
echo "# Number of panes in system: $np"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   200
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   201
if ($np == 2) goto glaze2
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   202
#################################################################
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   203
#
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   204
# Compute single glazing
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   205
#
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   206
set sc=1
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   207
echo "# Exterior surface s1 type: $sn_arr[$s1t]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   208
if ($?s1c) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   209
	echo "# s1 coating coverage: $s1c"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   210
	set sc=$s1c
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   211
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   212
echo "# Interior surface s2 type: $sn_arr[$s2t]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   213
if ($?s2c) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   214
	echo "# s2 coating coverage: $s2c"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   215
	set sc=$s2c
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   216
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   217
if ($s1t != 1) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   218
	set ct=$s1t
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   219
	echo -n "# Exterior normal hemispherical reflectance: "
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   220
	ev ".265*($sc*$rc_r_arr[$ct]+(1-$sc)*$rc_r_arr[1])+.670*($sc*$rc_g_arr[$ct]+(1-$sc)*$rc_g_arr[1])+.065*($sc*$rc_b_arr[$ct]+(1-$sc)*$rc_b_arr[1])"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   221
	echo -n "# Interior normal hemispherical reflectance: "
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   222
	ev ".265*($sc*$rg_r_arr[$ct]+(1-$sc)*$rg_r_arr[1])+.670*($sc*$rg_g_arr[$ct]+(1-$sc)*$rg_g_arr[1])+.065*($sc*$rg_b_arr[$ct]+(1-$sc)*$rg_b_arr[1])"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   223
else
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   224
	set ct=$s2t
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   225
	echo -n "# Exterior normal hemispherical reflectance: "
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   226
	ev ".265*($sc*$rg_r_arr[$ct]+(1-$sc)*$rg_r_arr[1])+.670*($sc*$rg_g_arr[$ct]+(1-$sc)*$rg_g_arr[1])+.065*($sc*$rg_b_arr[$ct]+(1-$sc)*$rg_b_arr[1])"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   227
	echo -n "# Interior normal hemispherical reflectance: "
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   228
	ev ".265*($sc*$rc_r_arr[$ct]+(1-$sc)*$rc_r_arr[1])+.670*($sc*$rc_g_arr[$ct]+(1-$sc)*$rc_g_arr[1])+.065*($sc*$rc_b_arr[$ct]+(1-$sc)*$rc_b_arr[1])"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   229
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   230
echo -n "# Normal hemispherical transmittance: "
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   231
ev ".265*($sc*$tn_r_arr[$ct]+(1-$sc)*$tn_r_arr[1])+.670*($sc*$tn_g_arr[$ct]+(1-$sc)*$tn_g_arr[1])+.065*($sc*$tn_b_arr[$ct]+(1-$sc)*$tn_b_arr[1])"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   232
echo "#"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   233
echo "void BRTDfunc glaze1_unnamed"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   234
if ($part_arr[$s1t] || $part_arr[$s2t]) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   235
### Frit glazing
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   236
echo "10"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   237
echo "	sr_frit_r sr_frit_g sr_frit_b"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   238
echo "	st_frit_r st_frit_g st_frit_b"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   239
echo "	0 0 0"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   240
echo "	glaze1.cal"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   241
echo "0"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   242
echo "11"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   243
if ($s2t == 1) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   244
	ev "$s1c*($rg_r_arr[$s1t]-$rg_r_arr[1])" \
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   245
		"$s1c*($rg_g_arr[$s1t]-$rg_g_arr[1])" \
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   246
		"$s1c*($rg_b_arr[$s1t]-$rg_b_arr[1])"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   247
	ev "$s1c*$rc_r_arr[$s1t]" "$s1c*$rc_g_arr[$s1t]" "$s1c*$rc_b_arr[$s1t]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   248
	ev "$s1c*$tn_r_arr[$s1t]" "$s1c*$tn_g_arr[$s1t]" "$s1c*$tn_b_arr[$s1t]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   249
	echo "	1	$s1c"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   250
else
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   251
	ev "$s2c*$rc_r_arr[$s2t]" "$s2c*$rc_g_arr[$s2t]" "$s2c*$rc_b_arr[$s2t]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   252
	ev "$s2c*($rg_r_arr[$s2t]-$rg_r_arr[1])" \
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   253
		"$s2c*($rg_g_arr[$s2t]-$rg_g_arr[1])" \
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   254
		"$s2c*($rg_b_arr[$s2t]-$rg_b_arr[1])"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   255
	ev "$s2c*$tn_r_arr[$s2t]" "$s2c*$tn_g_arr[$s2t]" "$s2c*$tn_b_arr[$s2t]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   256
	echo "	-1	$s2c"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   257
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   258
else
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   259
### Low-E glazing
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   260
echo "10"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   261
echo "	sr_clear_r sr_clear_g sr_clear_b"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   262
echo "	st_clear_r st_clear_g st_clear_b"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   263
echo "	0 0 0"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   264
echo "	glaze1.cal"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   265
echo "0"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   266
echo "19"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   267
echo "	0 0 0"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   268
echo "	0 0 0"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   269
echo "	0 0 0"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   270
if ($s2t == 1) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   271
	echo "	1"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   272
	set st=$s1t
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   273
else
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   274
	echo "	-1"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   275
	set st=$s2t
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   276
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   277
echo "	$rg_r_arr[$st] $rg_g_arr[$st] $rg_b_arr[$st]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   278
echo "	$rc_r_arr[$st] $rc_g_arr[$st] $rc_b_arr[$st]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   279
echo "	$tn_r_arr[$st] $tn_g_arr[$st] $tn_b_arr[$st]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   280
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   281
echo ""
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   282
exit 0
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   283
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   284
glaze2:
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   285
#################################################################
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   286
#
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   287
# Compute double glazing
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   288
#
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   289
if ($s2t != 1) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   290
	set s2r_rgb=($rc_r_arr[$s2t] $rc_g_arr[$s2t] $rc_b_arr[$s2t])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   291
	set s1r_rgb=($rg_r_arr[$s2t] $rg_g_arr[$s2t] $rg_b_arr[$s2t])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   292
	set s12t_rgb=($tn_r_arr[$s2t] $tn_g_arr[$s2t] $tn_b_arr[$s2t])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   293
else
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   294
	set s2r_rgb=($rg_r_arr[$s1t] $rg_g_arr[$s1t] $rg_b_arr[$s1t])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   295
	set s1r_rgb=($rc_r_arr[$s1t] $rc_g_arr[$s1t] $rc_b_arr[$s1t])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   296
	set s12t_rgb=($tn_r_arr[$s1t] $tn_g_arr[$s1t] $tn_b_arr[$s1t])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   297
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   298
if ($s4t != 1) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   299
	set s4r_rgb=($rc_r_arr[$s4t] $rc_g_arr[$s4t] $rc_b_arr[$s4t])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   300
	set s3r_rgb=($rg_r_arr[$s4t] $rg_g_arr[$s4t] $rg_b_arr[$s4t])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   301
	set s34t_rgb=($tn_r_arr[$s4t] $tn_g_arr[$s4t] $tn_b_arr[$s4t])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   302
else
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   303
	set s4r_rgb=($rg_r_arr[$s3t] $rg_g_arr[$s3t] $rg_b_arr[$s3t])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   304
	set s3r_rgb=($rc_r_arr[$s3t] $rc_g_arr[$s3t] $rc_b_arr[$s3t])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   305
	set s34t_rgb=($tn_r_arr[$s3t] $tn_g_arr[$s3t] $tn_b_arr[$s3t])
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   306
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   307
set s12c=1
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   308
echo "# Exterior surface s1 type: $sn_arr[$s1t]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   309
if ($?s1c) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   310
	echo "# s1 coating coverage: $s1c"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   311
	set s12c=$s1c
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   312
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   313
echo "# Inner surface s2 type: $sn_arr[$s2t]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   314
if ($?s2c) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   315
	echo "# s2 coating coverage: $s2c"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   316
	set s12c=$s2c
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   317
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   318
set s34c=1
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   319
echo "# Inner surface s3 type: $sn_arr[$s3t]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   320
if ($?s3c) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   321
	echo "# s3 coating coverage: $s3c"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   322
	set s34c=$s3c
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   323
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   324
echo "# Interior surface s4 type: $sn_arr[$s4t]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   325
if ($?s4c) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   326
	echo "# s4 coating coverage: $s4c"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   327
	set s34c=$s4c
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   328
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   329
# Approximate reflectance and transmittance for comment using gray values
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   330
set rglass=`ev ".265*$rg_r_arr[1]+.670*$rg_g_arr[1]+.065*$rg_b_arr[1]"`
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   331
set tglass=`ev ".265*$tn_r_arr[1]+.670*$tn_g_arr[1]+.065*$tn_b_arr[1]"`
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   332
set s1r_gry=`ev "$s12c*(.265*$s1r_rgb[1]+.670*$s1r_rgb[2]+.065*$s1r_rgb[3])+(1-$s12c)*$rglass"`
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   333
set s2r_gry=`ev "$s12c*(.265*$s2r_rgb[1]+.670*$s2r_rgb[2]+.065*$s2r_rgb[3])+(1-$s12c)*$rglass"`
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   334
set s12t_gry=`ev "$s12c*(.265*$s12t_rgb[1]+.670*$s12t_rgb[2]+.065*$s12t_rgb[3])+(1-$s12c)*$tglass"`
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   335
set s3r_gry=`ev "$s34c*(.265*$s3r_rgb[1]+.670*$s3r_rgb[2]+.065*$s3r_rgb[3])+(1-$s34c)*$rglass"`
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   336
set s4r_gry=`ev "$s34c*(.265*$s4r_rgb[1]+.670*$s4r_rgb[2]+.065*$s4r_rgb[3])+(1-$s34c)*$rglass"`
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   337
set s34t_gry=`ev "$s34c*(.265*$s34t_rgb[1]+.670*$s34t_rgb[2]+.065*$s34t_rgb[3])+(1-$s34c)*$tglass"`
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   338
echo -n "# Exterior normal hemispherical reflectance: "
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   339
ev "$s1r_gry + $s12t_gry^2*$s3r_gry"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   340
echo -n "# Interior normal hemispherical reflectance: "
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   341
ev "$s4r_gry + $s34t_gry^2*$s2r_gry"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   342
echo -n "# Normal hemispherical transmittance: "
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   343
ev "$s12t_gry*$s34t_gry"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   344
echo "#"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   345
echo "void BRTDfunc glaze2_unnamed"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   346
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   347
if ($part_arr[$s3t] || $part_arr[$s4t]) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   348
### Front pane has frit
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   349
if ($part_arr[$s1t] || $part_arr[$s2t]) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   350
	echo "Only one pane can have frit"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   351
	exit 1
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   352
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   353
if ($?s3c) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   354
	set sc=$s3c
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   355
	set s3g=`ev "1-$s3c"`
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   356
else
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   357
	set s3c=0
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   358
	set s3g=1
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   359
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   360
if ($?s4c) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   361
	set sc=$s4c
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   362
	set s4g=`ev "1-$s4c"`
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   363
else
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   364
	set s4c=0
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   365
	set s4g=1
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   366
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   367
echo "10"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   368
echo "if(Rdot,cr($s4g*rclr,$s3g*$s4g*tclr,fr($s2r_rgb[1])),cr(fr($s1r_rgb[1]),ft($s12t_rgb[1]),$s3g*rclr))"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   369
echo "if(Rdot,cr($s4g*rclr,$s3g*$s4g*tclr,fr($s2r_rgb[2])),cr(fr($s1r_rgb[2]),ft($s12t_rgb[2]),$s3g*rclr))"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   370
echo "if(Rdot,cr($s4g*rclr,$s3g*$s4g*tclr,fr($s2r_rgb[3])),cr(fr($s1r_rgb[3]),ft($s12t_rgb[3]),$s3g*rclr))"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   371
echo "$s3g*$s4g*ft($s12t_rgb[1])*tclr"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   372
echo "$s3g*$s4g*ft($s12t_rgb[2])*tclr"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   373
echo "$s3g*$s4g*ft($s12t_rgb[3])*tclr"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   374
echo "	0 0 0"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   375
echo "	glaze2.cal"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   376
echo "0"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   377
echo "9"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   378
ev "$sc*$s4r_rgb[1]-$s3c*$rg_r_arr[1]" \
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   379
	"$sc*$s4r_rgb[2]-$s3c*$rg_g_arr[1]" \
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   380
	"$sc*$s4r_rgb[3]-$s3c*$rg_b_arr[1]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   381
ev "$s12t_rgb[1]^2*($sc*$s3r_rgb[1]-$s4c*$rg_r_arr[1])" \
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   382
	"$s12t_rgb[2]^2*($sc*$s3r_rgb[2]-$s4c*$rg_g_arr[1])" \
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   383
	"$s12t_rgb[3]^2*($sc*$s3r_rgb[3]-$s4c*$rg_b_arr[1])"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   384
ev "$sc*$s12t_rgb[1]*$s34t_rgb[1]" \
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   385
	"$sc*$s12t_rgb[2]*$s34t_rgb[2]" \
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   386
	"$sc*$s12t_rgb[3]*$s34t_rgb[3]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   387
else if ($part_arr[$s1t] || $part_arr[$s2t]) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   388
### Back pane has frit
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   389
if ($?s1c) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   390
	set sc=$s1c
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   391
	set s1g=`ev "1-$s1c"`
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   392
else
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   393
	set s1c=0
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   394
	set s1g=1
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   395
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   396
if ($?s2c) then
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   397
	set sc=$s2c
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   398
	set s2g=`ev "1-$s2c"`
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   399
else
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   400
	set s2c=0
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   401
	set s2g=1
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   402
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   403
echo "10"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   404
echo "if(Rdot,cr(fr($s4r_rgb[1]),ft($s34t_rgb[1]),$s2g*rclr),cr($s1g*rclr,$s1g*$s2g*tclr,fr($s3r_rgb[1])))"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   405
echo "if(Rdot,cr(fr($s4r_rgb[2]),ft($s34t_rgb[2]),$s2g*rclr),cr($s1g*rclr,$s1g*$s2g*tclr,fr($s3r_rgb[2])))"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   406
echo "if(Rdot,cr(fr($s4r_rgb[3]),ft($s34t_rgb[3]),$s2g*rclr),cr($s1g*rclr,$s1g*$s2g*tclr,fr($s3r_rgb[3])))"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   407
echo "$s1g*$s2g*ft($s34t_rgb[1])*tclr"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   408
echo "$s1g*$s2g*ft($s34t_rgb[2])*tclr"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   409
echo "$s1g*$s2g*ft($s34t_rgb[3])*tclr"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   410
echo "	0 0 0"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   411
echo "	glaze2.cal"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   412
echo "0"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   413
echo "9"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   414
ev "$s34t_rgb[1]^2*($sc*$s2r_rgb[1]-$s1c*$rg_r_arr[1])" \
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   415
	"$s34t_rgb[2]^2*($sc*$s2r_rgb[2]-$s1c*$rg_g_arr[1])" \
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   416
	"$s34t_rgb[3]^2*($sc*$s2r_rgb[3]-$s1c*$rg_b_arr[1])"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   417
ev "$sc*$s1r_rgb[1]-$s2c*$rg_r_arr[1]" \
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   418
	"$sc*$s1r_rgb[2]-$s2c*$rg_g_arr[1]" \
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   419
	"$sc*$s1r_rgb[3]-$s2c*$rg_b_arr[1]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   420
ev "$sc*$s34t_rgb[1]*$s12t_rgb[1]" \
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   421
	"$sc*$s34t_rgb[2]*$s12t_rgb[2]" \
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   422
	"$sc*$s34t_rgb[3]*$s12t_rgb[3]"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   423
else
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   424
### Low-E and regular glazing only
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   425
echo "10"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   426
echo "if(Rdot,cr(fr($s4r_rgb[1]),ft($s34t_rgb[1]),fr($s2r_rgb[1])),cr(fr($s1r_rgb[1]),ft($s12t_rgb[1]),fr($s3r_rgb[1])))"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   427
echo "if(Rdot,cr(fr($s4r_rgb[2]),ft($s34t_rgb[2]),fr($s2r_rgb[2])),cr(fr($s1r_rgb[2]),ft($s12t_rgb[2]),fr($s3r_rgb[2])))"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   428
echo "if(Rdot,cr(fr($s4r_rgb[3]),ft($s34t_rgb[3]),fr($s2r_rgb[3])),cr(fr($s1r_rgb[3]),ft($s12t_rgb[3]),fr($s3r_rgb[3])))"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   429
echo "ft($s34t_rgb[1])*ft($s12t_rgb[1])"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   430
echo "ft($s34t_rgb[2])*ft($s12t_rgb[2])"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   431
echo "ft($s34t_rgb[3])*ft($s12t_rgb[3])"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   432
echo "	0 0 0"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   433
echo "	glaze2.cal"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   434
echo "0"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   435
echo "9"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   436
echo "	0 0 0"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   437
echo "	0 0 0"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   438
echo "	0 0 0"
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   439
endif
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   440
echo ""
0aa115157c9c Added original CSH script from HEAD-20110409.
Axel Jacobs <axel@jaloxa.eu>
parents:
diff changeset
   441
exit 0