PyPLUTO: Difference between revisions

From Arbeitsgruppe Kuiper
Jump to navigation Jump to search
m (tidy)
m (→‎Usage: slash)
Line 15: Line 15:


   import pyPLUTO.pload as pp
   import pyPLUTO.pload as pp
   wdir='/path/to/data/files'
   wdir="/path/to/data/files/"  # trailing slash!
   data=pp.pload(timestep, w_dir=wdir)  #  timestep = int, e.g. 1
   data=pp.pload(timestep, w_dir=wdir)  #  timestep = int, e.g. 1



Revision as of 11:46, 1 December 2024

... exists in different versions from different sources:

Installation

(... as non-administrator)

  • Grab the files off of gitlab e.g. in ZIP format and unzip them into a local folder.
  • Inside the extracted folder, enter your python environment (e.g. conda) and run python3 setup.py install.

Usage

 import pyPLUTO.pload as pp
 wdir="/path/to/data/files/"  # trailing slash!
 data=pp.pload(timestep, w_dir=wdir)  #  timestep = int, e.g. 1

Now, data contains all the information of the given timestep. To obtain a specific variable, e.g. x1, you can use data.x1 to get a numpy array with all the values in that timestep.

Note: Up to version 4.1 it used to be not import pyPLUTO.pload as pp but import pyPLUTO as pp, which still may appear in documentations.