#! /bin/sh set -e if test $# -ne 2; then echo "$0: missing argument"; exit 1;fi # find awk executable for myawk in nawk gawk awk do test -f $myawk && break done # Process amore tabling log to derive a sensible integration limit and # model cell. # Use it like this: # eval `amore-sphere ` # and it will set environment variable `radius' to a suitable argument for # CLMN SPHERE variable and `box' to a suitable argument for GENERATE CELL. # NB assumes only one table is made by the tabling step. mtzdmp $1 -s -n 0 | cat $2 - | $myawk ' BEGIN {pi=3.14159; dr=pi/180.0} # degrees/radians conversion # First set to the molecular radius to 75% of minimum box dimension. # (Ian Tickle suggestion after David Blow observation for the spherical case) # For model box calculation: / *Minimal Box/ {abox=$4; bbox=$5; cbox=$6; radius=abox if (bbox&2") exit 1} if (abox == "" || bbox == "" || cbox == "") { system("echo " prog ": Failed to find info for cell arithmetic 1>&2") exit 1} v=v/nsymm; # a.u. volume vol=4.0*pi*(radius^3)/3.0 # sphere volume # reduce sphere radius so volv) {radius=0.95*radius*(v/vol)^(0.3333333)} print "radius=" radius # Navaza says use for model CELL dimensions: # minimal_box_length+integration_radius+resolution # EJD says cell should be cubic always... add=radius+resol print "box=\"" abox+add , bbox+add , cbox+add , "\"" } ' #