Bivariate spline approximation over a rectangular mesh on a sphere.
Can be used for smoothing data.
Added in version 0.11.0.
Parameters:
uarray_like
1-D array of colatitude coordinates in strictly ascending order.
Coordinates must be given in radians and lie within the open interval
(0,pi).
varray_like
1-D array of longitude coordinates in strictly ascending order.
Coordinates must be given in radians. First element (v[0]) must lie
within the interval [-pi,pi). Last element (v[-1]) must satisfy
v[-1]<=v[0]+2*pi.
rarray_like
2-D array of data with shape (u.size,v.size).
sfloat, optional
Positive smoothing factor defined for estimation condition
(s=0 is for interpolation).
pole_continuitybool or (bool, bool), optional
Order of continuity at the poles u=0 (pole_continuity[0]) and
u=pi (pole_continuity[1]). The order of continuity at the pole
will be 1 or 0 when this is True or False, respectively.
Defaults to False.
pole_valuesfloat or (float, float), optional
Data values at the poles u=0 and u=pi. Either the whole
parameter or each individual element can be None. Defaults to None.
pole_exactbool or (bool, bool), optional
Data value exactness at the poles u=0 and u=pi. If True, the
value is considered to be the right function value, and it will be
fitted exactly. If False, the value will be considered to be a data
value just like the other data values. Defaults to False.
pole_flatbool or (bool, bool), optional
For the poles at u=0 and u=pi, specify whether or not the
approximation has vanishing derivatives. Defaults to False.
a function to evaluate a bivariate B-spline and its derivatives
Notes
Currently, only the smoothing spline approximation (iopt[0]=0 and
iopt[0]=1 in the FITPACK routine) is supported. The exact
least-squares spline approximation is not implemented yet.
When actually performing the interpolation, the requested v values must
lie within the same length 2pi interval that the original v values were
chosen from.
For more information, see the FITPACK site about this function.
Choosing the optimal value of s can be a delicate task. Recommended
values for s depend on the accuracy of the data values. If the user
has an idea of the statistical errors on the data, she can also find a
proper estimate for s. By assuming that, if she specifies the
right s, the interpolator will use a spline f(u,v) which exactly
reproduces the function underlying the data, she can evaluate
sum((r(i,j)-s(u(i),v(j)))**2) to find a good estimate for this s.
For example, if she knows that the statistical errors on her
r(i,j)-values are not greater than 0.1, she may expect that a good
s should have a value not larger than u.size*v.size*(0.1)**2.
If nothing is known about the statistical error in r(i,j), s must
be determined by trial and error. The best is then to start with a very
large value of s (to determine the least-squares polynomial and the
corresponding upper bound fp0 for s) and then to progressively
decrease the value of s (say by a factor 10 in the beginning, i.e.
s=fp0/10,fp0/100,... and more carefully as the approximation
shows more detail) to obtain closer fits.
The interpolation results for different values of s give some insight
into this process: