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.
This commit is contained in:
parent
9e38f10dc6
commit
df54cff836
2 changed files with 4 additions and 6 deletions
1
src/Prep/TerraFit/Makefile.am
Normal file
1
src/Prep/TerraFit/Makefile.am
Normal file
|
@ -0,0 +1 @@
|
||||||
|
EXTRA_DIST = terrafit.README 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
|
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
|
print command
|
||||||
npts = -1
|
npts = -1
|
||||||
error = -99999.9
|
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)
|
pre_terra(pgmName, data, span_x, span_y, max_z, min_z)
|
||||||
|
|
||||||
objName = basename+'.obj'
|
objName = basename+'.obj'
|
||||||
npts = -1
|
npts = run_terra(thresh, minnodes, count, factor, objName, pgmName)
|
||||||
while npts < minnodes:
|
|
||||||
npts = run_terra(thresh, count, factor, objName, pgmName)
|
|
||||||
thresh = 0.5 * thresh
|
|
||||||
|
|
||||||
gzName = basename+".fit.gz"
|
gzName = basename+".fit.gz"
|
||||||
post_terra(objName, gzName, step_x, step_y, min_x, min_y, min_z)
|
post_terra(objName, gzName, step_x, step_y, min_x, min_y, min_z)
|
||||||
|
|
Loading…
Add table
Reference in a new issue