LoadPart class#
- class pyPLUTO.LoadPart[source]#
Load the particles from the simulation.
The class is used to load the particles from the simulation and store the data in the class attributes. The data are loaded in a memory mapped numpy multidimensional array. Such approach does not load the full data until needed. Basic operations (i.e. no numpy) are possible, as well as slicing the arrays, without fully loading the data. At the moment, only one output can be loaded at a time.
- Parameters:
- - datatype: str, default None
The format of the data files to be loaded. If None, the code finds the format between dbl, flt and vtk.
- - endian: str | None, default None
The endianess of the data files. If None, the code finds the endianess.
- - chnk: int | Sequence[int] | None, default None
The chunk(s) to load. If None, all chunks are loaded. If a requested chunk does not exist for a given output, a
UserWarningis issued and that output is skipped; for multi-output loads only the outputs that contain the requested chunk are returned.- - nout: int | str | list | None, default ‘last’
The output number to be loaded. If ‘last’ the last output is loaded. If None, the data are not loaded.
- - path: str, default ‘./’
The path to the simulation directory.
- - text: bool | None, default None
Controls output verbosity. None (default) prints standard load info at INFO level. False silences all output. True enables full DEBUG logging.
- - var: str | list | bool | None, default True
The variables to be loaded. If True, all the variables are loaded. If None, the data are not loaded.
- Returns:
- None
Examples
Example #1: Load the last output from the simulation
>>> LoadPart()
- Example #2: Load the last output from the simulation with a specific
endianess
>>> LoadPart(endian="big")
- Example #3: Load the last output from the simulation with a specific
set of variables
>>> LoadPart(vars=["rho", "vx", "vy", "vz"])
- Example #4: Load the last output from the simulation without printing
the folder and the specific output loaded
>>> LoadPart(0, text=False)
- Example #5: Load the last output from the simulation without loading
the data
>>> LoadPart(nout=None)
- Example #6: Load the last output from the simulation with a specific
file number for the lp methods
>>> LoadPart(nfile_lp=1)
Initialize the LoadPart class.