# 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
# 
# class DataMismatch(Exception):
#     pass


import os
import numpy as np
import sys
import math as maths
import glob
from .mdfields import *
from .headerdata import *
from .postproc import PostProc
from .pplexceptions import NoResultsInDir, DataMismatch
                P1 = MD_hfVAField(self.resultsdir,fname='hfVA_c', **kwargs)
                self.plotlist.update({'hfVA_c':P1})
            except DataNotAvailable:
                pass
        if (('hfVA'   in self.fieldfiles1) or 
            ('hfVA_k' in self.fieldfiles1 and 
             'hfVA_c' in self.fieldfiles1    )):
            try:
                P1 = MD_heatfluxVAField(self.resultsdir,fname='hfVA', **kwargs)
                self.plotlist.update({'q':P1})
            except DataNotAvailable:
                pass

        #CV fluxes
        if 'mflux' in (self.fieldfiles1):
            flux1 = MD_mfluxField(self.resultsdir,'mflux', **kwargs)
            self.plotlist.update({'mflux':flux1})
            rhouCV = MD_CVmomField(self.resultsdir)
            self.plotlist.update({'rhou CV':rhouCV})

        if (('mflux' in self.fieldfiles1) and 
            ('vbins' in self.fieldfiles1)     ):
            rhouuCV =  MD_rhouuCVField(self.resultsdir)
            self.plotlist.update({'rhouu CV':rhouuCV})

        if (('mflux' in self.fieldfiles1) and 
            ('msurf' in self.fieldfiles1)     ):
            try:
                uCV =  MD_CVvField(self.resultsdir)
                self.plotlist.update({'u CV':uCV})

# 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
# 
# class DataMismatch(Exception):
#     pass


# Path: postproclib/mdpostproc.py
import os
import numpy as np
import sys
import math as maths
import glob
from .mdfields import *
from .headerdata import *
from .postproc import PostProc
from .pplexceptions import NoResultsInDir, DataMismatch

                P1 = MD_hfVAField(self.resultsdir,fname='hfVA_c', **kwargs)
                self.plotlist.update({'hfVA_c':P1})
            except DataNotAvailable:
                pass
        if (('hfVA'   in self.fieldfiles1) or 
            ('hfVA_k' in self.fieldfiles1 and 
             'hfVA_c' in self.fieldfiles1    )):
            try:
                P1 = MD_heatfluxVAField(self.resultsdir,fname='hfVA', **kwargs)
                self.plotlist.update({'q':P1})
            except DataNotAvailable:
                pass

        #CV fluxes
        if 'mflux' in (self.fieldfiles1):
            flux1 = MD_mfluxField(self.resultsdir,'mflux', **kwargs)
            self.plotlist.update({'mflux':flux1})
            rhouCV = MD_CVmomField(self.resultsdir)
            self.plotlist.update({'rhou CV':rhouCV})

        if (('mflux' in self.fieldfiles1) and 
            ('vbins' in self.fieldfiles1)     ):
            rhouuCV =  MD_rhouuCVField(self.resultsdir)
            self.plotlist.update({'rhouu CV':rhouuCV})

        if (('mflux' in self.fieldfiles1) and 
            ('msurf' in self.fieldfiles1)     ):
            try:
                uCV =  MD_CVvField(self.resultsdir)
                self.plotlist.update({'u CV':uCV})

            except DataMismatch: