def exportFile(options): """ Function used to export data. """ print '\n-------------------------------\nExporting information' + \ '\n-------------------------------\n' if(options.runname == None): print "Specify the complete node/run to export (--runname runNameOrPath)" exportpath = options.runname if(options.infile == None): print "Specify the in file (--infile filename)" exit() if(options.outfile == None): print "Specify the out file (--outfile theExportedFileName )" exit() extension = os.path.splitext(options.infile) extension = extension[1] if extension != '.h5': print "Can only export .h5 files: " + options.infile exit() else: theReader = SofiePyTableAccess(options.infile) theReader.readFile(options.runname, options.outfile) theReader.close()
def exportFile(filename,runName,outFilename): """ Exports a file node from a sofiehdfformat file. """ theReader = SofiePyTableAccess(filename) theReader.readFile(runName, outFilename) theReader.close()