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: print("Not a potential in one space dimension, silent return!") iom.finalize()
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 if args.parametersfile: PL = ParameterLoader() PP = PL.load_from_file(args.parametersfile) else: PP = None # 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] # The axes rectangle that is plotted view = args.xrange + args.yrange # Iterate over all blocks for blockid in blockids: print("Plotting frames of data block '{}'".format(blockid)) # See if we have wavefunction values
if __name__ == "__main__": iom = IOManager() # Read file with simulation data try: iom.open_file(filename=sys.argv[1]) except IndexError: iom.open_file() parameters = iom.load_parameters() # Read file with parameter data for grid try: PL = ParameterLoader() gridparams = PL.load_from_file(sys.argv[2]) except IndexError: gridparams = parameters # Manually adjust the plotting region # view = [xmin, xmax, ymin, ymax, zmin, zmax] view = [None, None, None, None, 0, 10] if view[0] is None: view[0] = gridparams["limits"][0][0] if view[1] is None: view[1] = gridparams["limits"][0][1] if view[2] is None: view[2] = gridparams["limits"][1][0] if view[3] is None: view[3] = gridparams["limits"][1][1]
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 + args.zrange # Plot if parameters["dimension"] == 2: Potential = BlockFactory().create_potential(parameters) Grid = TensorProductGrid(gridparams["limits"], gridparams["number_nodes"]) plot_potential(Grid, Potential, sparsify=args.sparsify, view=view,
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 if args.parametersfile: PL = ParameterLoader() PP = PL.load_from_file(parametersfile) else: PP = None # 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] # The axes rectangle that is plotted view = args.xrange + args.yrange + args.zrange # Iterate over all blocks for blockid in blockids: print("Plotting frames of data block '{}'".format(blockid)) # See if we have wavefunction values
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 if args.parametersfile: PL = ParameterLoader() PP = PL.load_from_file(args.parametersfile) else: PP = None # 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] # The axes rectangle that is plotted view = args.xrange + args.yrange # Iterate over all blocks for blockid in blockids: print("Plotting frames of data block '{}'".format(blockid)) # See if we have wavefunction values
if __name__ == "__main__": iom = IOManager() PL = ParameterLoader() # Read file with simulation data try: iom.open_file(filename=sys.argv[1]) except IndexError: iom.open_file() # Read file with parameter data for grid try: PP = PL.load_from_file(sys.argv[2]) except IndexError: PP = None # The axes rectangle that is plotted #view = [-3, 3, -3, 3] view = None # Iterate over all blocks and plot their data for blockid in iom.get_block_ids(): print("Plotting frames of data block '"+str(blockid)+"'") # See if we have wavepacket values if iom.has_wavepacket(blockid=blockid): plot_frames(PP, iom, blockid=blockid, limits=view) else: print("Warning: Not plotting any wavepackets in block '"+str(blockid)+"'!")
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 if args.parametersfile: PL = ParameterLoader() PP = PL.load_from_file(parametersfile) else: PP = None # 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] # The axes rectangle that is plotted view = args.xrange + args.yrange # Iterate over all blocks for blockid in blockids: print("Plotting frames of data block '{}'".format(blockid)) # See if we have wavefunction values