print('plotting complete, results saved under ./outputFigures/\n') def printUsage(): print('usage: \n\t python extractMultiSQLite.py directoryName showAllMessages maxEntranceTime') print('directoryName: the directory in which the sqlite databases are stored') print('showAllMessages: use "true" to output all messages, recommended') print('system exiting...') sys.exit() def std2Call(dirName, maxTime): print('---------------------------------------') print(' executing std2 plots ') print('---------------------------------------') fileList = getAllFilenames(dirName) percentage, appTTime, nonAppTTime, totalTTime = traverseMultiDB(fileList, True, maxTime) generatePlot(percentage, appTTime, nonAppTTime, totalTTime) # Main code starts here if __name__ == '__main__': if len(sys.argv) != 4: printUsage() dirName = sys.argv[1] debug = sys.argv[2] maxTime = int(sys.argv[3]) fileList = getAllFilenames(dirName) dm.printObjFiles(fileList, debug) percentage, appTTime, nonAppTTime, totalTTime = traverseMultiDB(fileList, debug, maxTime) dm.printTraverseResults(percentage, appTTime, nonAppTTime, debug) generatePlot(percentage, appTTime, nonAppTTime, totalTTime)
with open(outname, 'w') as fout: for i in range(len(percentage)): fout.write(str(percentage[i]) + ',' + str(absND[i]) + ',' + str(rltND[i])) if i != (len(percentage) - 1): fout.write('\n') if __name__ == '__main__': if len(sys.argv) != 4: printUsage() #-------------------------------------------------------------------# # Parsing input arguments and building list of all directories in # # target (mother) directory # #-------------------------------------------------------------------# dirList, outputDir, maxTime, minTime = parseArgv(sys.argv, "percentND") #-------------------------------------------------------------------# # Traverse, extract, and write data # #-------------------------------------------------------------------# for dirName in dirList: runIdx = getRunIdx(dirName) fileList = getAllFilenames(dirName) dm.printObjFiles(fileList, True) percentage, absND, rltND = traverseMultiDB(fileList, maxTime, minTime) store2CSV(percentage, absND, rltND, runIdx, outputDir) #-------------------------------------------------------------------# # Read data from csv file, calculate standard deviation, and plot # #-------------------------------------------------------------------# percentage, absND, rltND, absNDStd, rltNDStd = averageND(outputDir) generatePlot(percentage, absND, rltND, absNDStd, rltNDStd)