if __name__ == "__main__": iomc = IOManager() iome = IOManager() # Read file with simulation data try: filename = sys.argv[1] except IndexError: filename = GD.file_resultdatafile iomc.open_file(filename=filename) # New file for eigen transformed data P = iomc.load_parameters() iome.create_file(P, filename=filename[:-5]+"_eigen.hdf5") # Iterate over all groups for groupid in iomc.get_group_ids(): # Create the group if necessary if not groupid in iome.get_group_ids(): iome.create_group(groupid=groupid) for blockid in iomc.get_block_ids(groupid=groupid): print("Computing eigentransformation of data in block '"+str(blockid)+"'") # Create the block if necessary if not blockid in iome.get_block_ids(groupid=groupid): iome.create_block(blockid=blockid, groupid=groupid)
# File with the simulation data resultspath = os.path.abspath(args.resultspath) if not os.path.exists(resultspath): raise IOError("The results path does not exist: {}".format(args.resultspath)) datafile = os.path.abspath(os.path.join(args.resultspath, args.datafile)) parametersfile = os.path.abspath(os.path.join(args.resultspath, args.parametersfile)) # Read file with simulation data iom = IOManager() iom.open_file(filename=datafile) # Read file with parameter data for grid parameters = iom.load_parameters() if args.parametersfile: PL = ParameterLoader() gridparams = PL.load_from_file(parametersfile) else: gridparams = parameters # The axes rectangle that is plotted view = args.xrange + args.yrange if parameters["dimension"] == 1: Potential = BlockFactory().create_potential(parameters) Grid = TensorProductGrid(gridparams["limits"], gridparams["number_nodes"]) plot_potential(Grid, Potential, view=view, path=resultspath) else:
args = parser.parse_args() # File with the simulation data resultspath = os.path.abspath(args.resultspath) if not os.path.exists(resultspath): raise IOError("The results path does not exist: {}".format( args.resultspath)) datafile = os.path.abspath(os.path.join(args.resultspath, args.datafile)) # Read file with simulation data iom = IOManager() iom.open_file(filename=datafile) parameters = iom.load_parameters() # Which blocks to handle blockids = iom.get_block_ids() if "all" not in args.blockid: blockids = [bid for bid in args.blockid if bid in blockids] # Iterate over all blocks for blockid in blockids: print("Plotting wavepacket coefficients in data block '{}'".format( blockid)) # NOTE: Add new algorithms here if iom.has_wavepacket(blockid=blockid): plot_coefficients(parameters,