PyPLUTO: Difference between revisions
Jump to navigation
Jump to search
m (this) |
(Added instruction to install pypluto and how to read data using it) |
||
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 | * https://gitlab.mpcdf.mpg.de/sdoetsch/pypluto, modified version 4.4, maintained until 2022 ← use <nowiki>''this''</nowiki> | ||
To install: | |||
<code>import pyPLUTO as pp<code> | |||
* Grab the files off of gitlab and unzip them into a local folder | |||
* Inside the extracted folder enter your python environment (e.g. conda) and enter the command <code>python3 setup.py install</code> | |||
To load data: | |||
* <code>import pyPLUTO.pload as pp</code> | |||
* <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. | |||
Note: For versions < 4.1: Replace <code>import pyPLUTO.pload as pp</code> with <code>import pyPLUTO as pp</code> |
Revision as of 14:46, 19 March 2024
... exists in different versions from different sources:
- 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://gitlab.mpcdf.mpg.de/sdoetsch/pypluto, modified version 4.4, maintained until 2022 ← use ''this''
To install:
- Grab the files off of gitlab and unzip them into a local folder
- Inside the extracted folder enter your python environment (e.g. conda) and enter the command
python3 setup.py install
To load data:
import pyPLUTO.pload as pp
wdir='/path/to/data/files'
data=pp.pload(timestep (e.g. 1), w_dir=wdir)
Now 'data' contains all the information of the given timestep. To call a specific variable you can use data.x1
to get a numpy array of all values of the variable x1 in that timestep.
Note: For versions < 4.1: Replace import pyPLUTO.pload as pp
with import pyPLUTO as pp