added new predefined mapping "abssum", which returns the sum of all absolute values
This commit is contained in:
parent
2cbfb69235
commit
5740e13485
|
@ -359,6 +359,7 @@ def mapIncremental(label, mapping, N, base, new):
|
||||||
'max': lambda n,b,a: max(b,a),
|
'max': lambda n,b,a: max(b,a),
|
||||||
'avg': lambda n,b,a: (n*b+a)/(n+1),
|
'avg': lambda n,b,a: (n*b+a)/(n+1),
|
||||||
'sum': lambda n,b,a: b+a,
|
'sum': lambda n,b,a: b+a,
|
||||||
|
'abssum': lambda n,b,a: b+abs(a),
|
||||||
'unique': lambda n,b,a: {True:a,False:'n/a'}[n==0 or b==a]
|
'unique': lambda n,b,a: {True:a,False:'n/a'}[n==0 or b==a]
|
||||||
}
|
}
|
||||||
if mapping in theMap:
|
if mapping in theMap:
|
||||||
|
@ -581,7 +582,7 @@ parser.add_option('-r','--range', dest='range', type='int', nargs=3, \
|
||||||
parser.add_option('--sloppy', action='store_true', dest='sloppy', \
|
parser.add_option('--sloppy', action='store_true', dest='sloppy', \
|
||||||
help='do not pre-check validity of increment range')
|
help='do not pre-check validity of increment range')
|
||||||
parser.add_option('-m','--map', dest='func', type='string', \
|
parser.add_option('-m','--map', dest='func', type='string', \
|
||||||
help='data reduction mapping ["%default"] out of min, max, avg, sum or user-lambda')
|
help='data reduction mapping ["%default"] out of min, max, avg, sum, abssum or user-lambda')
|
||||||
parser.add_option('-p','--type', dest='filetype', type='string', \
|
parser.add_option('-p','--type', dest='filetype', type='string', \
|
||||||
help = 'type of result file [%default]')
|
help = 'type of result file [%default]')
|
||||||
group_material = OptionGroup(parser,'Material identifier')
|
group_material = OptionGroup(parser,'Material identifier')
|
||||||
|
|
Loading…
Reference in New Issue