From df54cff8362cbb62ba7adcf6f084d4adddc337f0 Mon Sep 17 00:00:00 2001 From: curt Date: Sat, 16 Aug 2003 01:57:28 +0000 Subject: [PATCH] The TerraGear version of Michael Garland's "Terra" program now supports minnodes directly, so I have slightly tweaked the python wrapper script in light of this. --- src/Prep/TerraFit/Makefile.am | 1 + src/Prep/TerraFit/terrafit.py | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) create mode 100644 src/Prep/TerraFit/Makefile.am diff --git a/src/Prep/TerraFit/Makefile.am b/src/Prep/TerraFit/Makefile.am new file mode 100644 index 00000000..6d206b04 --- /dev/null +++ b/src/Prep/TerraFit/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST = terrafit.README terrafit.py diff --git a/src/Prep/TerraFit/terrafit.py b/src/Prep/TerraFit/terrafit.py index f044977b..b84af07c 100755 --- a/src/Prep/TerraFit/terrafit.py +++ b/src/Prep/TerraFit/terrafit.py @@ -36,9 +36,9 @@ def pre_terra(pgmName, data, span_x, span_y, max_z, min_z): ## -def run_terra(thresh, count, factor, objName, pgmName): +def run_terra(thresh, minnodes, count, factor, objName, pgmName): print - command = "terra -e %f -p %d -h %f -o %s obj %s"%(thresh, count, factor, objName, pgmName) + command = "terra -e %f -n %d -p %d -h %f -o %s obj %s"%(thresh, minnodes, count, factor, objName, pgmName) print command npts = -1 error = -99999.9 @@ -137,10 +137,7 @@ def terra_fit(fname, thresh=1, count=1000, factor=1.0/30.0, minnodes=50): pre_terra(pgmName, data, span_x, span_y, max_z, min_z) objName = basename+'.obj' - npts = -1 - while npts < minnodes: - npts = run_terra(thresh, count, factor, objName, pgmName) - thresh = 0.5 * thresh + npts = run_terra(thresh, minnodes, count, factor, objName, pgmName) gzName = basename+".fit.gz" post_terra(objName, gzName, step_x, step_y, min_x, min_y, min_z)