orig/illumcal.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
axel@0
     1
#!/bin/csh -f
axel@0
     2
# RCSid: $Id: illumcal.csh,v 1.2 2006/04/05 06:22:29 greg Exp $
axel@0
     3
#
axel@0
     4
# Compute color characteristics of light sources
axel@0
     5
#
axel@0
     6
# Each input file should contain evenly-spaced pairs of wavelength (nm) and
axel@0
     7
# power values (watts/nm), one per line.
axel@0
     8
#
axel@0
     9
if ( $#argv < 1 ) then
axel@0
    10
	echo Usage: $0 illum.dat ..
axel@0
    11
	exit 1
axel@0
    12
endif
axel@0
    13
set cal = .
axel@0
    14
foreach illum ($*)
axel@0
    15
set spc=(`sed -e 1d -e 's/^[ 	]*\([1-9][.0-9]*\)[ 	].*$/\1/' -e 3q $illum`)
axel@0
    16
rcalc -f $cal/cieresp.cal -f $cal/stdrefl.cal -e "intvl=abs($spc[2]-$spc[1])" \
axel@0
    17
	-f $cal/conv1.cal $illum | total >> /tmp/il$$.dat
axel@0
    18
end
axel@0
    19
rcalc -f $cal/conv2.cal -f $cal/cct.cal -f $cal/cri.cal \
axel@0
    20
	-o $cal/illum.fmt /tmp/il$$.dat
axel@0
    21
rm -f /tmp/il$$.dat