def controlStatZ(statz,refstatz):
"""
- Compare min and max of z of regions with a reference,
- with a precision of 0.05m by default.
+ Compare min, max, mean, standard deviation, percentile 5 and 95 of z of regions with a reference,
+ with a precision of 0.05m by default and 1.0m for min and max.
"""
for nomreg, valsref in refstatz.iteritems():
vals = statz[nomreg]
- tolerance =0.05
- if len(valsref) > 2:
- tolerance = valsref[2]
- if abs(vals[0] - valsref[0]) > tolerance \
- or abs(vals[1] - valsref[1]) > tolerance:
+ tolerance =0.1
+ if len(valsref) > 6:
+ tolerance = valsref[6]
+ if abs(vals[0] - valsref[0]) > 10*tolerance \
+ or abs(vals[1] - valsref[1]) > 10*tolerance \
+ or abs(vals[2] - valsref[2]) > tolerance \
+ or abs(vals[3] - valsref[3]) > tolerance \
+ or abs(vals[4] - valsref[4]) > 10*tolerance \
+ or abs(vals[5] - valsref[5]) > 10*tolerance :
print nomreg
- print "value: ", vals, " reference: ", valsref, "tolerance: ", tolerance
+ print "value: ", vals
+ print "reference: ", valsref, "tolerance for mean, std dev: ", tolerance, "and ", 10*tolerance, "for other values"
raise ValueError("z interpolation error")
else:
print nomreg
- print "value: ", vals, " reference: ", valsref, "tolerance: ", tolerance, " OK"
+ print "value: ", vals
+ print "reference: ", valsref, "tolerance for mean, std dev: ", tolerance, "and ", 10*tolerance, "for other values: OK"
import MEDLoader