示例#1
0
def data_metrics_append(jsonSimscore, data, filename):
    minmax = validate.findMinMax(data)
    isClipApply = isClipTask(filename)
    
    jsonSimscore.update({
        #Dead	Boolean	
        'DeadSensors' : validate.findDeadSensors(data, minmax, jsonSimscore['TaskType'], jsonSimscore['IsPractice'])
        #Out of Range	Boolean
        ,'OutOfRange' : validate.findOutOfRanges(minmax, jsonSimscore['TaskType'])
        #NaN	Boolean	
        ,'NaNSensors' : validate.findNans(data, isClipApply)  
        #Known errors to ignore on simscore.org
        ,'IgnoreErrors' : validate.ignoreErrors(jsonSimscore, minmax, isClipApply)
        #Max    Float    Min    Float                 
        ,'MinMax' : nan_replace(minmax)
    })
    return jsonSimscore
示例#2
0
(	"edge6/2013/01/25.21.33.58.393.0.txt"	,	["Rot_L," "ThG_L"]	,	["ThG_L"]	,	[]	),
(	"edge2/2013/01/09.16.06.18.378.3.txt"	,	["Fg_R"]	,	["Rot_L"]	,	[]	),
(	"edge2/2012/12/03.20.12.46.109.3.txt"	,	["Fg_R"]	,	["Lin_R"]	,	[]	),
(	"edge6/2013/01/25.22.30.14.312.0.txt"	,	["Fg_R", "ThG_R", "Rot_R"]	,	["ThG_R"]	,	[]	)

]

# <codecell>

new_deads = []
for test in unit_files:
    try:
        data, meta = myS3.getData(bucket, test[0], labeled=True)
        minmax = validate.findMinMax(data)
        
        new_dead = validate.findDeadSensors(data, minmax, meta['TaskId'], meta['IsPracticeTest'])
        old_dead = validate.oldFindDeadSensor(validate.findMinMax(data), isClipTask(test[0]))
        #oors = validate.findOutOfRange(minmax)
        
        print 'verifying',test[0]
        print 'Dead sensors should be:', test[1]
        print 'New method caught:', new_dead
        print 'Old method caught:', old_dead
        print 
    except Exception as e:
        print e
        print 'error in',fn

# <codecell>

'''