Welcome to pyPLUTO’s documentation!

Information

Author

Bhargav Vaidya (bvaidya at iiti dot ac dot in)

Contributors

Antoine Strugarek (HDF5 Reader), Denis Stepanov (Polar plotting)

Date

Oct 29, 2020

TASK : Quick Tool for Visualization of PLUTO 4.4 data (Mignone2007)

DESCRIPTION : The code is completely written using the Python Language and it now is compatible for Python v3

pyPLUTO Module.

The pyPLUTO module can be loaded as follows.

import pyPLUTO as pypl

QUICK START:

import pyPLUTO as pypl
import pyPLUTO.pload as pp
wdir = /path/to/datafiles #Default is current directory.
To read the data file # 1, say data.0001.dbl
D = pp.pload(1, w_dir=wdir)
To read data file in float format, say data.0010.flt
D = pp.pload(10, datatype='float')
To read data file in vtk format, say data.0005.vtk
D = pp.pload(5, datatype='vtk')
To read data file in hdf5 format, say data.0005.hdf5 at AMR level 3
D = pp.pload(5, datatype='hdf5', level=3)
Then array of density will be in D.rho and that of X1 velocity
will be in D.vx1 and so on.

The functions associated with this module are listed below :

pyPLUTO.nlast_info(w_dir=None, datatype=None)

Prints the information of the last step of the simulation as obtained from out files

Inputs:

w_dir – path to the directory which has the dbl.out(or flt.out) and the data

datatype – If the data is of ‘float’ type then datatype = ‘flt’ else by default the datatype is set to ‘dbl’ (Double precision).

Outputs:

This function returns a dictionary with following keywords -

nlast – The ns for the last file saved.

time – The simulation time for the last file saved.

dt – The time step dt for the last file.

Nstep – The Nstep value for the last file saved.

Usage:

In case the data is ‘float’.

wdir = /path/to/data/directory

import pyPLUTO as pp

A = pp.nlast_info(w_dir=wdir,datatype='float')

Indices and tables