#!/bin/tcsh -f # tomax # A script to find the approximate tilt axis angle in a tomographic series # Usage: # tomax -angles <start,increment,end> <files> # Example: # tomax -angles 40,1.5,60 "c*.star" # Author: Bernard Heymann # 20070209 - 20100218 # Defaults set ANG = "60,1,90" # Recreate command line echo -n tomax set a = 1 while ( $a <= $#argv ) echo -n " $argv[$a]" @ a++ end echo " " if ( $#argv < 1 ) then echo "No input!" exit endif # Interpret options set a = 1 while ( "x$argv[$a]" =~ x-* ) # echo $a $argv[$a] if ( "x$argv[$a]" =~ x-ang* ) then @ a++ set ANG = $argv[$a] endif @ a++ end set PF = $argv[$a] set A = `echo $ANG | cut -f1 -d","` set AI = `echo $ANG | cut -f2 -d","` set AE = `echo $ANG | cut -f3 -d","` echo "Tilt axis angle determination:" echo "-----------------------------" date echo "File = $PF" echo "Angles = $ANG" echo "" echo Angle Residual @ C = 1 @ NDN = 1 while ( $NDN ) set LN = `printf "tomax_%03d.log" $C` set CMD = "btrack -v 1 -exclude none -update -track 1 -axis $A -refine markers $PF" echo $CMD > $LN $CMD >> $LN set RES = `awk '$1=="Average" && $2=="residual" { print $4 }' $LN` echo $A $RES set A = `echo $A + $AI | bc` set NDN = `echo "if ($A <= $AE) { print 1 } else { print 0 }" | bc ` @ C++ end