romspline/convergence.py
def make(self, x, y, levs=None):
    """Decimate the input data at the required levs and compute the 
    resulting reduced-order spline interpolants.
    
    Input
    -----
      x    -- samples
      y    -- data to be downsampled
      levs -- decimation levels (levs) such that if levs=4 then 
              every fourth entry is skipped for building the spline
              (default None)
    
    Attributes
    ----------
      splines      -- reduced-order spline objects for each lev
      errors       -- L-infinity spline errors for each lev as
                      compared to the full input data
      compressions -- compression factors of the reduced data
                      for each lev
    """
    if levs is None:
      self.levs = np.array([8, 4, 2])
    else:
      self.levs = np.array(levs)
    if 1 not in self.levs:
      self.levs = np.hstack([self.levs, 1])
    
    # Build reduced-order spline on full data (e.g., lev=1)
    if self._spline:
      self.splines[1] = self._spline
    else:
      self.splines[1] = greedy.ReducedOrderSpline(x, y, deg=self._deg, tol=self._tol, rel=self._rel, seeds=self._seeds)
    
    # Build reduced-order splines for each requested decimation level
    for ll in self.levs:
      
      # Build a reduced_order spline
      if ll != 1:
        x_lev = x[::ll]
        y_lev = y[::ll]
        if x[-1] not in x_lev:
          x_lev = np.hstack([x_lev, x[-1]])
          y_lev = np.hstack([y_lev, y[-1]])
        
        # Adjust the indices of the seeds for the different lev
        if self._seeds is None:
          seeds = None
        else:
          seeds = [int(float(ss)/ll) for ss in self._seeds]
        
        self.splines[ll] = greedy.ReducedOrderSpline(x_lev, y_lev, deg=self._deg, tol=self._tol, rel=self._rel, seeds=seeds)
      
      # Compute the compression factor and L-infinity absolute error for this lev
      self.errors[ll] = Linfty(self.splines[ll].eval(x), y)
      self.compressions[ll] = self.splines[ll].compression
    
    self._made = True
Decimate the input data at the required levs and compute the 
    resulting reduced-order spline interpolants.
    
    Input
    -----
      x    -- samples
      y    -- data to be downsampled
      levs -- decimation levels (levs) such that if levs=4 then 
              every fourth entry is skipped for building the spline
              (default None)
    
    Attributes
    ----------
      splines      -- reduced-order spline objects for each lev
      errors       -- L-infinity spline errors for each lev as
                      compared to the full input data
      compressions -- compression factors of the reduced data
                      for each lev
    
Decimate the input data at the required levs and compute the
resulting reduced-order spline interpolants.

Input



Attributes


Decimate the input data at the required levs and compute the resulting reduced - order spline interpolants . Input Attributes
def make(self, x, y, levs=None):
    if levs is None:
      self.levs = np.array([8, 4, 2])
    else:
      self.levs = np.array(levs)
    if 1 not in self.levs:
      self.levs = np.hstack([self.levs, 1])
    if self._spline:
      self.splines[1] = self._spline
    else:
      self.splines[1] = greedy.ReducedOrderSpline(x, y, deg=self._deg, tol=self._tol, rel=self._rel, seeds=self._seeds)
    for ll in self.levs:
      if ll != 1:
        x_lev = x[::ll]
        y_lev = y[::ll]
        if x[-1] not in x_lev:
          x_lev = np.hstack([x_lev, x[-1]])
          y_lev = np.hstack([y_lev, y[-1]])
        if self._seeds is None:
          seeds = None
        else:
          seeds = [int(float(ss)/ll) for ss in self._seeds]
        self.splines[ll] = greedy.ReducedOrderSpline(x_lev, y_lev, deg=self._deg, tol=self._tol, rel=self._rel, seeds=seeds)
      self.errors[ll] = Linfty(self.splines[ll].eval(x), y)
      self.compressions[ll] = self.splines[ll].compression
    self._made = True
def make ( self , x , y , levs = None ) : if levs is None : self . levs = np . array ( [ 8 , 4 , 2 ] ) else : self . levs = np . array ( levs ) if 1 not in self . levs : self . levs = np . hstack ( [ self . levs , 1 ] ) if self . _spline : self . splines [ 1 ] = self . _spline else : self . splines [ 1 ] = greedy . ReducedOrderSpline ( x , y , deg = self . _deg , tol = self . _tol , rel = self . _rel , seeds = self . _seeds ) for ll in self . levs : if ll != 1 : x_lev = x [ : : ll ] y_lev = y [ : : ll ] if x [ - 1 ] not in x_lev : x_lev = np . hstack ( [ x_lev , x [ - 1 ] ] ) y_lev = np . hstack ( [ y_lev , y [ - 1 ] ] ) if self . _seeds is None : seeds = None else : seeds = [ int ( float ( ss ) / ll ) for ss in self . _seeds ] self . splines [ ll ] = greedy . ReducedOrderSpline ( x_lev , y_lev , deg = self . _deg , tol = self . _tol , rel = self . _rel , seeds = seeds ) self . errors [ ll ] = Linfty ( self . splines [ ll ] . eval ( x ) , y ) self . compressions [ ll ] = self . splines [ ll ] . compression self . _made = True
Decimate the input data at the required levs and compute the
resulting reduced-order spline interpolants.
Decimate the input data at the required levs and compute the resulting reduced - order spline interpolants .
"""Decimate the input data at the required levs and compute the 
    resulting reduced-order spline interpolants.
    
    Input
    -----
      x    -- samples
      y    -- data to be downsampled
      levs -- decimation levels (levs) such that if levs=4 then 
              every fourth entry is skipped for building the spline
              (default None)
    
    Attributes
    ----------
      splines      -- reduced-order spline objects for each lev
      errors       -- L-infinity spline errors for each lev as
                      compared to the full input data
      compressions -- compression factors of the reduced data
                      for each lev
    """ # Build reduced-order spline on full data (e.g., lev=1) # Build reduced-order splines for each requested decimation level # Build a reduced_order spline # Adjust the indices of the seeds for the different lev # Compute the compression factor and L-infinity absolute error for this lev
self
x
y
levs