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.

- nfile_lp: int | None, default None

The file number for the lp methods. If None, the code finds the file number.

- 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, default True

If True, the folder and output are printed. In case the user needs a more detailed information of the structure and attributes loaded from the class, the __str__ method provides a easy display of all the important information.

- vars: 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)