added test to check if lab-to-load rotation is done properly, small improvement on test.py
This commit is contained in:
parent
f5e7d576f1
commit
87bec7eafa
|
@ -172,10 +172,7 @@ class Test():
|
||||||
refFile.close()
|
refFile.close()
|
||||||
refArray = numpy.nan_to_num(numpy.genfromtxt(File1,missing_values='n/a',skip_header = len(table.info)+1))
|
refArray = numpy.nan_to_num(numpy.genfromtxt(File1,missing_values='n/a',skip_header = len(table.info)+1))
|
||||||
curArray = numpy.nan_to_num(numpy.genfromtxt(File2,missing_values='n/a',skip_header = len(table.info)+1))
|
curArray = numpy.nan_to_num(numpy.genfromtxt(File2,missing_values='n/a',skip_header = len(table.info)+1))
|
||||||
refNonZero = refArray[refArray.nonzero()]
|
max_err=numpy.max(abs(refArray[curArray.nonzero()]/curArray[curArray.nonzero()]-1.))
|
||||||
curNonZero = curArray[curArray.nonzero()]
|
|
||||||
err = abs((refNonZero/curNonZero)-1.) # relative tolerance
|
|
||||||
max_err = numpy.max(err)
|
|
||||||
print ' ********\n * maximum relative error',max_err,'\n ********'
|
print ' ********\n * maximum relative error',max_err,'\n ********'
|
||||||
return max_err
|
return max_err
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue