示例#1
0
                             fp_csv_metrics)

    if individualImages:
        if kpiimage != "None" and kpiimage != "" and kpiimage != "plot":
            if not (os.path.exists(outputDir)):
                os.makedirs(outputDir)
            SaveScreenshot(outputDir + "/out_" + kpi + ".png",
                           magnification=magnification,
                           quality=100)

    if 'animation' in metrichash:
        makeAnim = data_IO.str2bool(metrichash['animation'])
    else:
        makeAnim = False
    if makeAnim:
        pvutils.makeAnimation(outputDir, kpi, magnification)

    if 'blender' in metrichash:
        export2Blender = data_IO.str2bool(metrichash['blender'])
    else:
        export2Blender = False
    if export2Blender:
        try:
            blenderContext = metrichash['blendercontext'].split(",")
        except:
            blenderContext = []
        try:
            renderBody = metrichash['blenderbody'].split(",")
        except:
            renderBody = False
        pvutils.exportx3d(outputDir, kpi, d, dataReader, renderBody,
        d = pvutils.createBasic(metrichash, dataReader, readerDisplay)

    if extractStats:
        pvutils.extractStats(d, kpi, kpifield, kpiComp, kpitype,
                             fp_csv_metrics)

    if kpiimage != "None" and kpiimage != "plot":
        if not (os.path.exists(outputDir)):
            os.makedirs(outputDir)
        if caseNumber:
            metrichash['imageName'] = metrichash['imageName'].format(
                int(caseNumber))
        SaveScreenshot(outputDir + '/' + metrichash['imageName'],
                       magnification=magnification,
                       quality=100)

    if makeAnim:
        animationName = metrichash['animationName']
        if caseNumber:
            animationName = animationName.format(int(caseNumber))

        pvutils.makeAnimation(outputDir, kpi, magnification, animationName)

    if export2Blender:
        blenderContext = metrichash['blendercontext']
        renderBody = metrichash['blenderbody']
        pvutils.exportx3d(outputDir, kpi, d, dataReader, renderBody,
                          blenderContext)

fp_csv_metrics.close()