orig/phisto.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: phisto.csh,v 3.5 2008/08/25 04:50:32 greg Exp $
axel@0
     3
#
axel@0
     4
# Compute foveal histogram for picture set
axel@0
     5
#
axel@0
     6
set tf=`mktemp /tmp/phdat.XXXXX`
axel@0
     7
onintr quit
axel@0
     8
if ( $#argv == 0 ) then
axel@0
     9
	pfilt -1 -x 128 -y 128 -p 1 \
axel@0
    10
			| pvalue -o -h -H -d -b > $tf
axel@0
    11
else
axel@0
    12
	rm -f $tf
axel@0
    13
	foreach i ( $* )
axel@0
    14
		pfilt -1 -x 128 -y 128 -p 1 $i \
axel@0
    15
				| pvalue -o -h -H -d -b >> $tf
axel@0
    16
		if ( $status ) exit 1
axel@0
    17
	end
axel@0
    18
endif
axel@0
    19
set Lmin=`total -l $tf | rcalc -e 'L=$1*179;$1=if(L-1e-7,log10(L)-.01,-7)'`
axel@0
    20
set Lmax=`total -u $tf | rcalc -e '$1=log10($1*179)+.01'`
axel@0
    21
rcalc -e 'L=$1*179;cond=L-1e-7;$1=log10(L)' $tf \
axel@0
    22
	| histo $Lmin $Lmax 100
axel@0
    23
quit:
axel@0
    24
rm -f $tf