def merge_data_filenames(filelist, outputfile): print "The following input files were found:\n" for f in filelist: print "\t - %s" % f data = OrderedDict() attrs = OrderedDict() for f in filelist: data[f], attrs[f] = hdf5.load(f) hdf5.save(outputfile, *merge_data(data, attrs)) msg.info("Done")
msg.list_dataset(data) check.key_exists(match, data, filename) if keys: msg.info("Using only: " + keys) update_data(data, [k.strip() for k in keys.split(',')], args.match) return data if __name__ == '__main__': msg.box("HDF5 MANIPULATOR: COMBINE") args = parser() data1 = get_data(args.input1, args.match, args.keys1) data2 = get_data(args.input2, args.match, args.keys2) check.different_keys(data1, data2, args.match) data = merge_data(data1, data2, args.match, args.print_warnings, args.show_progress) print "\nThe following datasets will be saved in %s:\n" % args.output msg.list_dataset(data) hdf5.save(args.output, data) msg.info("Done")
start=dt.datetime.now()#start is the precise moment where we begin the rayshooting #rayShooting()#execute rayShooting with datas in Donnees raysMatrix,raysIndex=rayShooting() duration=dt.datetime.now()-start print("ray shooting done") print("{} rays between {} and {} rad".format(nbRay,-angleMax,angleMax)) print("Execution time: {}".format(duration)) raysData=np.array([]) if caracteristic: raysData=rc.RaysData(raysMatrix,raysIndex,fV) sb.run(["powercfg","/X","standby-timeout-ac","15"])#restablish the #standby parameter #the number is the time (in minutes) you want your computer goes on stanby #when he is plugged if plotting or savePlot: rayPlotting.plot(raysMatrix,distance,height,fmt,nbPoint,lineColor,lineWidth,name,savePlot,plotting) if hdf5Saving==True: hdf5.save(raysMatrix,raysIndex,raysData, path, name) #sb.run("pause",shell=True)
for key in data_list[f]: data[key] = np.append(data[key], data_list[f][key], axis=0) return data if __name__ == '__main__': print("HDF5 MANIPULATOR: MERGE") args = parser() filelist = get_filelist([f.strip() for f in args.input_files.split(',')]) if not filelist: msg.error("No files matching --input were found.") sys.exit(1) print "The following input files were found:\n" for f in filelist: print "\t - %s" % f data = OrderedDict() for f in filelist: data[f] = hdf5.load(f) hdf5.save(args.output, merge_data(data)) msg.info("Done")