# Path: postproclib/postproc.py
# class PostProc:
# 
#     def __str__(self):
#         string =  ('\nAvailable outputs in ' + self.resultsdir + ' include:\n\n')
#         string += ('\t{0:^24s}\t{1:>10s}\n'.format('field', 'records'))
#         #string += ('\t{0:^24s}\t{1:^10s}\n'.format('-'*24, '-'*10))
#         for key,field in sorted(self.plotlist.items()):
#             line = '\t{0:<24s}=\t{1:>10f},\n'.format(key, field.maxrec)
#             string += line
#         return string 
# 
# Path: postproclib/pplexceptions.py
# class NoResultsInDir(Exception):
#     pass


import numpy as np
import os
import struct
import glob
    import matplotlib.pyplot as plt
from scipy.io import FortranFile
from .headerdata import *
from .postproc import PostProc
from .pplexceptions import NoResultsInDir
    from mpl_toolkits import mplot3d
                            else:
                                print(rec, "Extra record of size = ", data.size, " with N mols = ", self.n)
                                pos[:,ixyz,cntrec] = f.read_record('f4')
                        except TypeError as e:
                            print("Corruped data at record=", rec, " in " 
                                  + self.fname, " Error is ", e)
                            datacorrupt = True
                    if datacorrupt:
                        break
                    cntrec += 1

            read_success = True

        if (not read_success):
            raise IOError("Failed to read data from" + self.fname)

        return pos



    def read_moltype(self, fname="vmd_out.psf"):
                   
        #Load tag data (assumes same ordering)
        #tagDict = {"free": 0, "fixed": 1, "fixed_slide": 2, "teth": 3, "thermo": 4, 
        #            "teth_thermo": 5, "teth_slide": 6, "teth_thermo_slide": 7}     

        fpsf = self.fdir + "/" +  fname
        if (os.path.exists(fpsf)):
            with open(fpsf) as f:
                rd = True

# Path: postproclib/postproc.py
# class PostProc:
# 
#     def __str__(self):
#         string =  ('\nAvailable outputs in ' + self.resultsdir + ' include:\n\n')
#         string += ('\t{0:^24s}\t{1:>10s}\n'.format('field', 'records'))
#         #string += ('\t{0:^24s}\t{1:^10s}\n'.format('-'*24, '-'*10))
#         for key,field in sorted(self.plotlist.items()):
#             line = '\t{0:<24s}=\t{1:>10f},\n'.format(key, field.maxrec)
#             string += line
#         return string 
# 
# Path: postproclib/pplexceptions.py
# class NoResultsInDir(Exception):
#     pass


# Path: postproclib/mdmols.py
import numpy as np
import os
import struct
import glob
    import matplotlib.pyplot as plt
from scipy.io import FortranFile
from .headerdata import *
from .postproc import PostProc
from .pplexceptions import NoResultsInDir
    from mpl_toolkits import mplot3d

                            else:
                                print(rec, "Extra record of size = ", data.size, " with N mols = ", self.n)
                                pos[:,ixyz,cntrec] = f.read_record('f4')
                        except TypeError as e:
                            print("Corruped data at record=", rec, " in " 
                                  + self.fname, " Error is ", e)
                            datacorrupt = True
                    if datacorrupt:
                        break
                    cntrec += 1

            read_success = True

        if (not read_success):
            raise IOError("Failed to read data from" + self.fname)

        return pos



    def read_moltype(self, fname="vmd_out.psf"):
                   
        #Load tag data (assumes same ordering)
        #tagDict = {"free": 0, "fixed": 1, "fixed_slide": 2, "teth": 3, "thermo": 4, 
        #            "teth_thermo": 5, "teth_slide": 6, "teth_thermo_slide": 7}     

        fpsf = self.fdir + "/" +  fname
        if (os.path.exists(fpsf)):
            with open(fpsf) as f:
                rd = True

                moltype = []