7 |
|
echo "Usage: $0 optics.mat .." |
8 |
|
exit 1 |
9 |
|
endif |
10 |
< |
cat > /tmp/opt.fmt << '_EOF_' |
10 |
> |
set optf=`mktemp /tmp/optfmt.XXXXXXX` |
11 |
> |
cat > $optf << '_EOF_' |
12 |
|
void glass $(name)_glass |
13 |
|
0 |
14 |
|
0 |
36 |
|
echo "# Output generated by $0 from $*" |
37 |
|
sed -e '/^[^#]/d' -e '/^$/d' $* |
38 |
|
|
39 |
< |
cat > /tmp/out$$.fmt << '_EOF_' |
39 |
> |
set outf=`mktemp /tmp/outfmt.XXXXXX` |
40 |
> |
cat > $outf << '_EOF_' |
41 |
|
|
42 |
|
void glass $(name) |
43 |
|
0 |
50 |
|
-e 'trans=lum(Rtau,Gtau,Btau)' \ |
51 |
|
-e 'rfront=lum(fRrho,fGrho,fBrho);rback=lum(bRrho,bGrho,bBrho)' \ |
52 |
|
-e 'cond=0.005-abs(rfront-rback)' \ |
53 |
< |
-i /tmp/opt.fmt -o /tmp/out$$.fmt $* |
53 |
> |
-i $optf -o $outf $* |
54 |
|
|
55 |
< |
cat > /tmp/out$$.fmt << '_EOF_' |
55 |
> |
cat > $outf << '_EOF_' |
56 |
|
|
57 |
|
void BRTDfunc $(name) |
58 |
|
10 |
71 |
|
-e 'trans=lum(Rtau,Gtau,Btau)' \ |
72 |
|
-e 'rfront=lum(fRrho,fGrho,fBrho);rback=lum(bRrho,bGrho,bBrho)' \ |
73 |
|
-e 'cond=and(trans-.645, not(0.005-abs(rfront-rback)))' \ |
74 |
< |
-i /tmp/opt.fmt -o /tmp/out$$.fmt $* |
74 |
> |
-i $optf -o $outf $* |
75 |
|
|
76 |
< |
cat > /tmp/out$$.fmt << '_EOF_' |
76 |
> |
cat > $outf << '_EOF_' |
77 |
|
|
78 |
|
void BRTDfunc $(name) |
79 |
|
10 |
92 |
|
-e 'trans=lum(Rtau,Gtau,Btau)' \ |
93 |
|
-e 'rfront=lum(fRrho,fGrho,fBrho);rback=lum(bRrho,bGrho,bBrho)' \ |
94 |
|
-e 'cond=and(not(trans-.645), not(0.005-abs(rfront-rback)))' \ |
95 |
< |
-i /tmp/opt.fmt -o /tmp/out$$.fmt $* |
95 |
> |
-i $optf -o $outf $* |
96 |
|
|
97 |
< |
rm -f /tmp/opt.fmt /tmp/out$$.fmt |
97 |
> |
rm -f $optf $outf |