orig/debugcal.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: debugcal.csh,v 2.6 2003/02/22 02:07:30 greg Exp $
axel@0
     3
#
axel@0
     4
# Script to debug cal files for Radiance
axel@0
     5
#
axel@0
     6
# Takes octree and rcalc options as arguments.
axel@0
     7
# One of the rcalc options should be -f calfile.
axel@0
     8
# Note that the real arguments A1, A2, etc must also be given.
axel@0
     9
# Input is a ray origin and direction, such as that produced by ximage.
axel@0
    10
#
axel@0
    11
if ( $#argv < 2 ) then
axel@0
    12
	echo "Usage: $0 octree [rcalc options]"
axel@0
    13
	exit 1
axel@0
    14
endif
axel@0
    15
if ( ! $?RAYPATH ) then
axel@0
    16
	set RAYPATH=.:/usr/local/lib/ray
axel@0
    17
endif
axel@0
    18
set initfile=
axel@0
    19
foreach d (`echo $RAYPATH | sed 's/:/ /g'`)
axel@0
    20
	if ( -r $d/rayinit.cal ) then
axel@0
    21
		set initfile="-f $d/rayinit.cal"
axel@0
    22
		break
axel@0
    23
	endif
axel@0
    24
end
axel@0
    25
axel@0
    26
rtrace -h- -x 1 -odNplL $1 | rcalc -u -e 'Dx=$1;Dy=$2;Dz=$3' \
axel@0
    27
		-e 'Nx=$4;Ny=$5;Nz=$6;Px=$7;Py=$8;Pz=$9' \
axel@0
    28
		-e 'T=$10;Ts=$11' -e 'S:1;Tx:0;Ty:0;Tz:0' \
axel@0
    29
		-e 'Ix:1;Iy:0;Iz:0;Jx:0;Jy:1;Jz:0;Kx:0;Ky:0;Kz:1' \
axel@0
    30
		-e 'Rdot=-Dx*Nx-Dy*Ny-Dz*Nz' -e 'RdotP=Rdot' \
axel@0
    31
		-e 'NxP=Nx;NyP=Ny;NzP=Nz' -e 'CrP=A1;CgP=A2;CbP=A3' \
axel@0
    32
		-e 'DxA:0;DyA:0;DzA:0' \
axel@0
    33
		$initfile $argv[2-]:q