diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /math/gsurfit/gsfit.gx | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'math/gsurfit/gsfit.gx')
-rw-r--r-- | math/gsurfit/gsfit.gx | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/math/gsurfit/gsfit.gx b/math/gsurfit/gsfit.gx new file mode 100644 index 00000000..60251596 --- /dev/null +++ b/math/gsurfit/gsfit.gx @@ -0,0 +1,49 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <math/gsurfit.h> +$if (datatype == r) +include "gsurfitdef.h" +$else +include "dgsurfitdef.h" +$endif + +# GSFIT -- Procedure to solve the normal equations for a surface. +# The inner products of the basis functions are calculated and +# accumulated into the GS_NCOEFF(sf) ** 2 matrix MATRIX. +# The main diagonal of the matrix is stored in the first row of +# MATRIX followed by the remaining non-zero diagonals. +# The inner product +# of the basis functions and the data ordinates are stored in the +# GS_NCOEFF(sf)-vector VECTOR. The Cholesky factorization of MATRIX +# is calculated and stored in CHOFAC. Forward and back substitution +# is used to solve for the GS_NCOEFF(sf)-vector COEFF. + +$if (datatype == r) +procedure gsfit (sf, x, y, z, w, npts, wtflag, ier) +$else +procedure dgsfit (sf, x, y, z, w, npts, wtflag, ier) +$endif + +pointer sf # surface descriptor +PIXEL x[npts] # array of x values +PIXEL y[npts] # array of y values +PIXEL z[npts] # data array +PIXEL w[npts] # array of weights +int npts # number of data points +int wtflag # type of weighting +int ier # ier = OK, everything OK + # ier = SINGULAR, matrix is singular, 1 or more + # coefficients are 0. + # ier = NO_DEG_FREEDOM, too few points to solve matrix + +begin + $if (datatype == r) + call gszero (sf) + call gsacpts (sf, x, y, z, w, npts, wtflag) + call gssolve (sf, ier) + $else + call dgszero (sf) + call dgsacpts (sf, x, y, z, w, npts, wtflag) + call dgssolve (sf, ier) + $endif +end |