#!/bin/csh # # This script expands each resolution of data floats and error floats by # 1 in each x,y,z dimension. See the source code, expander.c, for more # details # # Robert S Laramee # 20 Feb 01 # # compile the program: echo 'compiling expander.c...' gcc -Wall expander.c -Iinclude -lm -o expander.exe # set BASE = "../data" echo 'removing previously expanded output data files...' # @ level = 6 @ resolution = 2 @ resolutionPlus = $resolution + 1 while ($resolution <= 128) rm -vf $BASE/level${level}/headRes${resolutionPlus}floats.ascii* rm -vf $BASE/level${level}/headRes${resolutionPlus}Error.ascii* @ level = $level - 1 @ resolution = $resolution * 2 @ resolutionPlus = $resolution + 1 end echo 'uncompressing input data files...' @ level = 6 @ resolution = 2 while ($resolution <= 128) gunzip -fv $BASE/level${level}/headRes${resolution}floats.ascii.gz gunzip -fv $BASE/level${level}/headRes${resolution}Error.ascii.gz @ level = $level - 1 @ resolution = $resolution * 2 end # @ level = 6 @ resolution = 2 @ resolutionPlus = $resolution + 1 while ($resolution <= 128) expander.exe $BASE/level${level}/headRes${resolution}floats.ascii \ $resolution $resolution $resolution > \ $BASE/level${level}/headRes${resolutionPlus}floats.ascii expander.exe $BASE/level${level}/headRes${resolution}Error.ascii \ $resolution $resolution $resolution > \ $BASE/level${level}/headRes${resolutionPlus}Error.ascii @ level = $level - 1 @ resolution = $resolution * 2 @ resolutionPlus = $resolution + 1 end # the old way # RES 2 -> 3 #echo 'expanding headRes2floats.ascii...' #./expander.exe $BASE/level6/headRes2floats.ascii 2 2 2 > \ # $BASE/level6/headRes3floats.ascii #echo 'expanding headRes2Error.ascii...' #./expander.exe $BASE/level6/headRes2Error.ascii 2 2 2 > \ # $BASE/level6/headRes3Error.ascii # # disk space in the CS department is tough to come by! # echo 'compressing input and output data files...' @ level = 6 @ resolution = 2 @ resolutionPlus = $resolution + 1 while ($resolution <= 128) gzip -fv $BASE/level${level}/headRes${resolution}floats.ascii gzip -fv $BASE/level${level}/headRes${resolution}Error.ascii gzip -fv $BASE/level${level}/headRes${resolutionPlus}floats.ascii gzip -fv $BASE/level${level}/headRes${resolutionPlus}Error.ascii @ level = $level - 1 @ resolution = $resolution * 2 @ resolutionPlus = $resolution + 1 end echo 'expander script is done'