Package org.esa.snap.core.datamodel
Class RationalFunctionModel
- java.lang.Object
-
- org.esa.snap.core.datamodel.RationalFunctionModel
-
-
Constructor Summary
Constructors Constructor Description RationalFunctionModel(int degreeP, int degreeQ, double[] x, double[] y, double[] g)
Constructs a rational function model for approximating a function g(x, y) with a rational function R(x, y) = P(x, y) / Q(x, y) where P and Q are polynomials of up to 4th degree.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
createCFunctionCode(String compute_x, String lat, String lon)
double
getMaxError()
Returns the maximum error of the approximation.double
getRmse()
Returns the root mean square error (RMSE) of the approximation.static int
getTermCountP(int degreeP)
static int
getTermCountQ(int degreeQ)
double
getValue(double x, double y)
Returns the rational function value approximating g(x, y).
-
-
-
Constructor Detail
-
RationalFunctionModel
public RationalFunctionModel(int degreeP, int degreeQ, double[] x, double[] y, double[] g)
Constructs a rational function model for approximating a function g(x, y) with a rational function R(x, y) = P(x, y) / Q(x, y) where P and Q are polynomials of up to 4th degree.- Parameters:
degreeP
- the degree of the numerator polynomial P.degreeQ
- the degree of the denominator polynomial Q.x
- the x-coordinates corresponding to the function values being approximated.y
- the y-coordinates corresponding to the function values being approximated.g
- the function values g(x, y) being approximated.- Throws:
IllegalArgumentException
- if the degree of the numerator or denominator polynomial is greater than four.IllegalArgumentException
- if the lengths of x, y, and g are not the same.
-
-
Method Detail
-
getTermCountP
public static int getTermCountP(int degreeP)
-
getTermCountQ
public static int getTermCountQ(int degreeQ)
-
getValue
public double getValue(double x, double y)
Returns the rational function value approximating g(x, y).- Parameters:
x
- the x-coordinate.y
- the y-coordinate.- Returns:
- the rational function value R(x, y).
-
getRmse
public double getRmse()
Returns the root mean square error (RMSE) of the approximation.- Returns:
- the root mean square error.
-
getMaxError
public double getMaxError()
Returns the maximum error of the approximation.- Returns:
- the maximum error.
-
-