PLUTO
pyPLUTO.pyPLUTO Namespace Reference

Classes

class  Image
 
class  pload
 
class  Tools
 

Functions

def curdir ()
 
def get_nstepstr (ns)
 
def nlast_info
 

Variables

 hasH5 = True
 

Function Documentation

def pyPLUTO.pyPLUTO.curdir ( )
Get the current working directory.

Definition at line 19 of file pyPLUTO.py.

19 def curdir():
20  """ Get the current working directory.
21  """
22  curdir = os.getcwd()+'/'
23  return curdir
24 
def curdir()
Definition: pyPLUTO.py:19

Here is the caller graph for this function:

def pyPLUTO.pyPLUTO.get_nstepstr (   ns)
Convert the float input *ns* into a string that would match the data file name.

**Inputs**:

 ns -- Integer number that represents the time step number. E.g., The ns for data.0001.dbl is 1.\n

**Outputs**:

 Returns the string that would be used to complete the data file name. E.g., for data.0001.dbl, ns = 1 and pyPLUTO.get_nstepstr(1) returns '0001'

Definition at line 25 of file pyPLUTO.py.

25 def get_nstepstr(ns):
26  """ Convert the float input *ns* into a string that would match the data file name.
27 
28  **Inputs**:
29 
30  ns -- Integer number that represents the time step number. E.g., The ns for data.0001.dbl is 1.\n
31 
32  **Outputs**:
33 
34  Returns the string that would be used to complete the data file name. E.g., for data.0001.dbl, ns = 1 and pyPLUTO.get_nstepstr(1) returns '0001'
35  """
36  nstepstr = str(ns)
37  while len(nstepstr) < 4:
38  nstepstr= '0'+nstepstr
39  return nstepstr
40 
def get_nstepstr(ns)
Definition: pyPLUTO.py:25
def pyPLUTO.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\n
  datatype -- If the data is of 'float' type then datatype = 'float' else by default the datatype is set to 'double'.

    **Outputs**:

  This function returns a dictionary with following keywords - \n

  nlast -- The ns for the last file saved.\n
  time -- The simulation time for the last file saved.\n
  dt -- The time step dt for the last file. \n
  Nstep -- The Nstep value for the last file saved.


**Usage**:

  In case the data is 'float'.

  ``wdir = /path/to/data/directory``\n
  ``import pyPLUTO as pp``\n
  ``A = pp.nlast_info(w_dir=wdir,datatype='float')``    

Definition at line 41 of file pyPLUTO.py.

41 def nlast_info(w_dir=None,datatype=None):
42  """ Prints the information of the last step of the simulation as obtained from out files
43 
44  **Inputs**:
45 
46  w_dir -- path to the directory which has the dbl.out(or flt.out) and the data\n
47  datatype -- If the data is of 'float' type then datatype = 'float' else by default the datatype is set to 'double'.
48 
49  **Outputs**:
50 
51  This function returns a dictionary with following keywords - \n
52 
53  nlast -- The ns for the last file saved.\n
54  time -- The simulation time for the last file saved.\n
55  dt -- The time step dt for the last file. \n
56  Nstep -- The Nstep value for the last file saved.
57 
58 
59  **Usage**:
60 
61  In case the data is 'float'.
62 
63  ``wdir = /path/to/data/directory``\n
64  ``import pyPLUTO as pp``\n
65  ``A = pp.nlast_info(w_dir=wdir,datatype='float')``
66  """
67  if w_dir is None: w_dir=curdir()
68  if datatype == 'float':
69  fname_v = w_dir+"flt.out"
70  elif datatype == 'vtk':
71  fname_v = w_dir+"vtk.out"
72  else:
73  fname_v = w_dir+"dbl.out"
74  last_line = file(fname_v,"r").readlines()[-1].split()
75  nlast = int(last_line[0])
76  SimTime = float(last_line[1])
77  Dt = float(last_line[2])
78  Nstep = int(last_line[3])
79 
80  print "------------TIME INFORMATION--------------"
81  print 'nlast =',nlast
82  print 'time =',SimTime
83  print 'dt =', Dt
84  print 'Nstep =',Nstep
85  print "-------------------------------------------"
86 
87  return {'nlast':nlast,'time':SimTime,'dt':Dt,'Nstep':Nstep}
88 
89 
def nlast_info
Definition: pyPLUTO.py:41
def curdir()
Definition: pyPLUTO.py:19
Definition: file.py:1

Here is the call graph for this function:

Variable Documentation

pyPLUTO.pyPLUTO.hasH5 = True

Definition at line 15 of file pyPLUTO.py.