#!/bin/csh # # The purpose of this script is to generate the MR representation of # the head data from floating point numbers to the cube representation. # Start with the coarsest level and work down. # # Robert S Laramee # Thurs 13 July 00 # # Modified to accomodate data with error information # PJR 11/00 # # # first compile the program echo 'compiling fromFloatToErrCube.c ...' gcc -Wall fromFloatToErrCube.c -Iinclude -lm -o fromFloatToErrCube.exe # # level 7 # -1 means output all octants set BASE = "../data" # # remove output from previous run of this script. # echo 'removing old, previous, output files...' @ level = 6 @ resolution = 2 while ($resolution <= 128) rm -fv $BASE/level${level}/headRes${resolution}ErrCube.ascii @ level = $level - 1 @ resolution = $resolution * 2 end # echo 'uncompressing input files...' @ level = 6 @ resolution = 2 @ resolutionPlus = 2 while ($resolution <= 128) @ resolutionPlus = $resolution + 1 gunzip -fv $BASE/level${level}/headRes${resolutionPlus}floats.ascii.gz gunzip -fv $BASE/level${level}/headRes${resolutionPlus}Error.ascii.gz @ level = $level - 1 @ resolution = $resolution * 2 end echo 'done de-compressing input files' # # run the conversion program echo 'generating cube files...' @ level = 6 @ resolution = 2 @ resolutionPlus = 2 while ($resolution <= 128) @ resolutionPlus = $resolution + 1 fromFloatToErrCube.exe \ $BASE/level${level}/headRes${resolutionPlus}floats.ascii \ $resolutionPlus $resolutionPlus $resolutionPlus -1 > \ $BASE/level${level}/headRes${resolution}ErrCube.ascii \ @ level = $level - 1 @ resolution = $resolution * 2 end # echo 'compressing input files...' @ level = 6 @ resolution = 2 @ resolutionPlus = 2 while ($resolution <= 128) @ resolutionPlus = $resolution + 1 gzip -fv $BASE/level${level}/headRes${resolutionPlus}floats.ascii gzip -fv $BASE/level${level}/headRes${resolutionPlus}Error.ascii @ level = $level - 1 @ resolution = $resolution * 2 end echo 'done compressing input files (again)' # echo 'compressing output files...' @ level = 6 @ resolution = 2 while ($resolution <= 128) gzip -fv $BASE/level${level}/headRes${resolution}ErrCube.ascii @ level = $level - 1 @ resolution = $resolution * 2 end echo 'done compressing output files' exit