PyPLUTO: Difference between revisions

From Arbeitsgruppe Kuiper
Jump to navigation Jump to search
(Added instruction to install pypluto and how to read data using it)
m (tidy)
Line 3: Line 3:
* https://github.com/bellatrics/pyPLUTO, alpha state from 2011, don't use
* https://github.com/bellatrics/pyPLUTO, alpha state from 2011, don't use
* https://github.com/coolastro/pyPLUTO, version 1.0 from 2012, don't use
* https://github.com/coolastro/pyPLUTO, version 1.0 from 2012, don't use
* https://gitlab.mpcdf.mpg.de/sdoetsch/pypluto, modified version 4.4, maintained until 2022 ← use <nowiki>''this''</nowiki>
* https://gitlab.mpcdf.mpg.de/sdoetsch/pypluto, modified version 4.4, maintained until 2022 ← use ''this''


To install:
= Installation =


* Grab the files off of gitlab and unzip them into a local folder
(... as non-administrator)
* Inside the extracted folder enter your python environment (e.g. conda) and enter the command <code>python3 setup.py install</code>


To load data:
* Grab the files off of gitlab e.g. in [https://gitlab.mpcdf.mpg.de/sdoetsch/pypluto/-/archive/main/pypluto-main.zip ZIP format] and unzip them into a local folder.
* Inside the extracted folder, enter your python environment (e.g. conda) and run <code>python3 setup.py install</code>.


* <code>import pyPLUTO.pload as pp</code>
= Usage =
* <code>wdir='/path/to/data/files'</code>
* <code>data=pp.pload(timestep (e.g. 1), w_dir=wdir)</code>


Now 'data' contains all the information of the given timestep. To call a specific variable you can use <code>data.x1</code> to get a numpy array of all values of the variable x1 in that timestep.
  import pyPLUTO.pload as pp
  wdir='/path/to/data/files'
  data=pp.pload(timestep, w_dir=wdir)  #  timestep = int, e.g. 1


Note: For versions < 4.1: Replace <code>import pyPLUTO.pload as pp</code> with <code>import pyPLUTO as pp</code>
Now, <code>data</code> contains all the information of the given timestep. To obtain a specific variable, e.g. <code>x1</code>, you can use <code>data.x1</code> to get a numpy array with all the values in that timestep.
 
Note: Up to version 4.1 it used to be not <code>import pyPLUTO.pload as pp</code> but <code>import pyPLUTO as pp</code>, which still may appear in documentations.

Revision as of 15:13, 19 March 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'
 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.