ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/colorcal.csh
Revision: 1.1
Committed: Sat Feb 22 02:07:21 2003 UTC (21 years, 2 months ago) by greg
Content type: application/x-csh
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad4R2P2, rad5R0, rad5R1, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R5, rad3R6, rad3R6P1, rad3R8, rad3R9, rad4R2P1, rad5R3, HEAD
Log Message:
Changes and check-in for 3.5 release
Includes new source files and modifications not recorded for many years
See ray/doc/notes/ReleaseNotes for notes between 3.1 and 3.5 release

File Contents

# Content
1 #!/bin/csh -f
2 # RCSid: $Id$
3 #
4 # Compute CIE chromaticities from spectral reflectance data
5 #
6 if ( $#argv < 1 ) goto userr
7 set cal = .
8 if ( $argv[1] == "-i" ) then
9 if ( $#argv < 3 ) goto userr
10 shift argv
11 set illum=$argv[1]
12 shift argv
13 foreach r ( $argv[*] )
14 tabfunc -i rf < $r > /tmp/rf$$.cal
15 rcalc -f $cal/cieresp.cal -f /tmp/rf$$.cal \
16 -e 'r=rf($1);ty=$2*triy($1)' \
17 -e '$1=ty;$2=$2*r*trix($1);$3=r*ty' \
18 -e '$4=$2*r*triz($1)' \
19 -e 'cond=if($1-359,831-$1,-1)' \
20 $illum | total -m >> /tmp/rc$$.dat
21 end
22 rm -f /tmp/rf$$.cal
23 else
24 foreach r ( $argv[*] )
25 rcalc -f $cal/cieresp.cal -e 'ty=triy($1);$1=ty' \
26 -e '$2=$2*trix($1);$3=$2*ty;$4=$2*triz($1)' \
27 -e 'cond=if($1-359,831-$1,-1)' $r \
28 | total -m >> /tmp/rc$$.dat
29 end
30 endif
31 rcalc -e 'X=$2/$1;Y=$3/$1;Z=$4/$1' \
32 -e 'x=X/(X+Y+Z);y=Y/(X+Y+Z);u=4*X/(X+15*Y+3*Z);v=9*Y/(X+15*Y+3*Z)' \
33 -o $cal/color.fmt /tmp/rc$$.dat
34 rm -f /tmp/rc$$.dat
35 exit 0
36 userr:
37 echo "Usage: $0 [-i illum.dat] refl.dat .."
38 exit 1