25 from .chebyshevBoundedField 
import ChebyshevBoundedField, ChebyshevBoundedFieldControl
 
   35                     nStepX=100, nStepY=100):
 
   37         Approximate a bounded field as a ChebyshevBoundedField. 
   41         boundedField : `lsst.afw.math.BoundedField` 
   42             A bounded field to approximate 
   43         orderX : `int`, optional 
   44             Order of the Chebyshev polynomial in the x direction. 
   46         orderY : `int`, optional 
   47             Order of the Chebyshev polynomial in the y direction. 
   49         nStepX : `int`, optional 
   50             Number of x steps to approximate boundedField. 
   52         nStepY : `int`, optional 
   53             Number of y steps to approximate boundedField. 
   58         chebyshevBoundedField : `lsst.afw.math.ChebyshevBoundedField` 
   61         ctrl = ChebyshevBoundedFieldControl()
 
   64         ctrl.triangular = 
False 
   66         bbox = boundedField.getBBox()
 
   68         xSteps = np.linspace(bbox.getMinX(), bbox.getMaxX(), nStepX)
 
   69         ySteps = np.linspace(bbox.getMinY(), bbox.getMaxY(), nStepY)
 
   71         x = np.tile(xSteps, nStepY)
 
   72         y = np.repeat(ySteps, nStepX)
 
   74         return cls.fit(bbox, x, y, boundedField.evaluate(x, y), ctrl)