# Path: postproclib/pplexceptions.py
# class OutsideRecRange(Exception):
#     pass


import numpy as np
import sys
        import scipy.interpolate as interp
            import matplotlib.pyplot as plt
            import scipy.interpolate as interp
            import scipy.ndimage
from .pplexceptions import OutsideRecRange
        from scipy.interpolate import RegularGridInterpolator
        
        This will instantiate a velocity field (see MDFields for details of 
        the complex inheritance and containment), read and store the data
        from multiple files to construct a velocity profile, and finally
        will plot the x-component of velocity against the y-axis.

        In line with RawData readers, axes correspond to:

            [ spatial ax1, spatial ax2, spatial ax3, record, component ] 
            [     0      ,      1     ,      2     ,    3  , 4 (&-1)   ] 

    """
    
    def __init__(self, RawDataObj):
        self.Raw = RawDataObj
        self.fdir = self.Raw.fdir
        self.grid = self.Raw.grid
        self.maxrec = self.Raw.maxrec

    def read(self,startrec,endrec,**kwargs):

        """
            TO BE OVERRIDDEN IN COMPLICATED FIELDS.
            Method that returns grid data that is read by Raw.
            
        """

        if (endrec > self.maxrec):
            print(('Record ' + str(endrec) + ' is greater than the maximum '
                  'available (' + str(self.maxrec) + ').'))

# Path: postproclib/pplexceptions.py
# class OutsideRecRange(Exception):
#     pass


# Path: postproclib/field.py
import numpy as np
import sys
        import scipy.interpolate as interp
            import matplotlib.pyplot as plt
            import scipy.interpolate as interp
            import scipy.ndimage
from .pplexceptions import OutsideRecRange
        from scipy.interpolate import RegularGridInterpolator

        
        This will instantiate a velocity field (see MDFields for details of 
        the complex inheritance and containment), read and store the data
        from multiple files to construct a velocity profile, and finally
        will plot the x-component of velocity against the y-axis.

        In line with RawData readers, axes correspond to:

            [ spatial ax1, spatial ax2, spatial ax3, record, component ] 
            [     0      ,      1     ,      2     ,    3  , 4 (&-1)   ] 

    """
    
    def __init__(self, RawDataObj):
        self.Raw = RawDataObj
        self.fdir = self.Raw.fdir
        self.grid = self.Raw.grid
        self.maxrec = self.Raw.maxrec

    def read(self,startrec,endrec,**kwargs):

        """
            TO BE OVERRIDDEN IN COMPLICATED FIELDS.
            Method that returns grid data that is read by Raw.
            
        """

        if (endrec > self.maxrec):
            print(('Record ' + str(endrec) + ' is greater than the maximum '
                  'available (' + str(self.maxrec) + ').'))

            raise OutsideRecRange