Loading the Data

class pyPLUTO.pload(ns, w_dir=None, datatype=None)

This Class has all the routines loading the data from the binary files output from PLUTO Simulations. Assign an object when the data is loaded for some ns.

Inputs:

ns – Time step of the data, data.ns.dbl or data.ns.flt

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 = ‘float’ else by default the datatype is set to ‘double’.

Outputs:

A pyPLUTO.pload object having all the relevant information of the corresponding data file

Usage:

import pyPLUTO as pp

wdir = '/path/to/the data files/'

D = pp.pload(1,w_dir=wdir)

Now D is the pyPLUTO.pload object having all the relevant information of the corresponding data file - data.0001.dbl.

data(datatype)

This method loads the data from the file name “data.ns.dbl”(in case of single_file) or “varname.ns.dbl”(in case of multiple files).

Inputs:

datatype – If the data is of ‘float’ type then datatype = ‘float’ else by default the datatype is set to ‘double’.

Outputs:

It returns a dictionary with all the variable names as the keys. NOTE All these variable names are set as attributes to the pyPLUTO.pload object like the grid() function.
geometry()

This method has the geometry information of the problem considered.

get_varinfo(datatype)

This method reads the dbl.out (or flt.out) and stores the information in a dictionary.

Inputs:

datatype – If the data is of ‘float’ type then datatype = ‘float’ else by default the datatype is set to ‘double’.

Outputs:

A dictionary with the following keywords -

fltype – returns the filetype of storing data (single_file or multiple_file)

nvar – Number of variables

allvars – A list of variables names. Each of the variable name will be the attributes to the pyPLUTO.pload object.

grid()

This method returns the necessary grid information in form a dictionary after reading the grid.out.

Outputs:

This function outputs a dictionary with following keys.

n1 – number of grid cells in x1 direction

n2 – number of grid cells in x2 direction

n3 – number of grid cells in x3 direction

x1 – Array x1

x2 - Array x2

x3 - Array x3

dx1 - Array dx1

dx2 - Array dx2

dx3 - Array dx3

Usage:

import pyPLUTO as pp

D = pp.pload(1)

G = D.grid()

Now, G is a dictionary such that G[‘x1’] will give the x-array. NOTE - Even x1 is set as attribute for the pyPLUTO.pload object i.e., the x-array can be obtained as D.x1. Infact all the keys of this routine are set as attributes for the pyPLUTO.pload object D.

time_info(datatype)

This method returns a dictionary that has the time information for the step ns.

Inputs:

datatype – If the data is of ‘float’ type then datatype = ‘float’ else by default the datatype is set to ‘double’.

Outputs:

A dictionary which has a following keys -

time – Gets the simulation time at step ns.

dt – Get the time step dt for step ns.

Nstep – Get the value of nstep for the step ns.

Previous topic

Installation

Next topic

Viewing the Data

This Page