• smFuncNew
  • smFuncDel
  • smMethNew
  • smMethDel
  • smaFuncEval
  • smaFuncUnknown
  • smaFuncGauss
  • smaFuncHubble
  • smaFuncDevauc
  • smaFuncFreeman
  • smaFuncDpol
  • smaFuncBspline
  • smaFuncLin
  • smaFuncLinMulti
  • smaGlobalSet
  • smaMethChi2
  • smaFuncAddrGetFromName
  • smaMethAddrGetFromName
  • smaCovFromFit
  • smaFuncPlot
  • smaFunc.c

    Interface to FUNC (function) and METH (method) structures in sdssmath
    
    
    
    

    smFuncNew

      Create a new FUNC
    
    SIGNATURE:
      FUNC *smFuncNew(
      		char *name,	/* name of the function: gauss, dpol, bspline, 
      				   lin */
      		VECTOR **va,	/* array of vectors with parameter values */
      		int nHandle	/* number of vectors in va */
      		)
    

    smFuncDel

      Delete a FUNC
    
    SIGNATURE:
      RET_CODE smFuncDel(
      		   FUNC *func	/* the FUNC to delete */
      		   )
    

    smMethNew

      Create a new METH
    
    SIGNATURE:
      METH *smMethNew(
      		char *name	/* name of the method; chi2 */
      		)
    

    smMethDel

      Delete a METH
    
    SIGNATURE:
      RET_CODE smMethDel(
      		   METH *meth	/* the METH to delete */
      		   )
    

    smaFuncEval

      Evaluate at FUNC at one value of x.  Return SH_SUCCESS if the value is 
      valid, or SH_GENERIC_ERROR if there is trouble.
    
    SIGNATURE:
      RET_CODE smaFuncEval(
      		     FUNC *func, /* the FUNC to evaluate */
      		     double x,	/* where to evaluate it */
      		     double *y	/* the return value */
      		     )
    

    smaFuncUnknown

      Function definition for an "unknown" which only returns zeros
    
    SIGNATURE:
      RET_CODE smaFuncUnknown(
                              int nVector,
                              VECTOR **va,
                              double *param,
                              double x,
                              double *y
                              )
    

    smaFuncGauss

      Function definition for gauss
      One vector of dimen=3 in va with the position, sigma, and normalization.
    
    SIGNATURE:
      RET_CODE smaFuncGauss(
      		      int nVector,
      		      VECTOR **va,
      		      double *param,
      		      double x,
      		      double *y
      		      )
    

    smaFuncHubble

      Function definition for Hubble
      One vector of dimen=2 in va with I0 and a.
    
    SIGNATURE:
      RET_CODE smaFuncHubble(
      		       int nVector,
      		       VECTOR **va,
      		       double *param,
      		       double x,
      		       double *y
      		       )
    

    smaFuncDevauc

      Function definition for devauc
      One vector of dimen=2 in va with Ie and re.
    
    SIGNATURE:
      RET_CODE smaFuncDevauc(
      		      int nVector,
      		      VECTOR **va,
      		      double *param,
      		      double x,
      		      double *y
      		      )
    

    smaFuncFreeman

      Function definition for Freeman
      One vector of dimen=2 in va with I0 and r0.
    
    SIGNATURE:
      RET_CODE smaFuncFreeman(
      		      int nVector,
      		      VECTOR **va,
      		      double *param,
      		      double x,
      		      double *y
      		      )
    

    smaFuncDpol

      Function definition for dpol
      We expect to get two vectors in the va:
      va[0] is returned from dpolft
      va[1] is a vector of length 1, containing the degree of the polynomial
    
    SIGNATURE:
      RET_CODE smaFuncDpol(
      		      int nVector,
      		      VECTOR **va,
      		      double *param,
      		      double x,
      		      double *y
      		      )
    

    smaFuncBspline

      Function definition for bspline
    We expect 6 vectors here:
         va[0] is the knot array of length n+4 (t)
         va[1] is the coefficient vector of length n (a)
         va[2] is the order of the fit spline k >= 1 (k)
         va[3] is the derivative to evaluate (0 for example)
         va[4] is the inbv parameter; set to 1 and retains state of v[5] (inbv)
         va[5] is a work array of length 3*k (work)
    
    SIGNATURE:
      RET_CODE smaFuncBspline (
      		      int nVector,
      		      VECTOR **va,
      		      double *param,
      		      double x,
      		      double *y
      		      )
    

    smaFuncLin

      Function definition for lin
      One vector in va has intercept and slope of the straight line
    
    SIGNATURE:
      RET_CODE smaFuncLin(
      		    int nVector,
      		    VECTOR **va,
      		    double *param,
      		    double x,
      		    double *y
      		    )
    

    smaFuncLinMulti

      Function definition for linMulti
      returned by vLinFit
      A linear equation with n terms and one unknown, 
    i.e.,  Sigma_{0}^{i} a_i x_i = y, with one x_i unknown )
      va[0] = constants determined by linear fit
      va[1] = values for each x_i (include place holder value for unknown)
      va[2] = the y value in va[2]->vec[0] 
      x = index for the  x_i that is the unknown (zero based indexing)
      y = the returned value for the unknown x_i 
    
    SIGNATURE:
      RET_CODE smaFuncLinMulti( 
                                int nVector,
                                VECTOR **va,
                                double *param,
                                double x,
                                double *y
                               )
    

    smaGlobalSet

      Set some global pointers
    
    SIGNATURE:
      void smaGlobalSet(VECTOR *x, VECTOR *y, VECTOR *w, FUNC *func, VECTOR *mask)
    

    smaMethChi2

      Method definition for Chi2
    
    SIGNATURE:
      void smaMethChi2 (
      		  int *iflag, 
      		  int *m,	 /* number of data points */
      		  int *n,	 /* number of parameters */
      		  double *param, /* input array of length n */
      		  double *fvec,	 /* output array of length m */
      		  double *fjac, 
      		  int *ldfjac)
    

    smaFuncAddrGetFromName

      Get the address of the function given its name and do some sanity checks
    
    SIGNATURE:
      SMA_FUNC smaFuncAddrGetFromName(
      				char *name, /* name of the function */
      				VECTOR **va, /* the va to set */
      				int nVector /* the number of vectors in va */
      				)
    

    smaMethAddrGetFromName

      Get the method address from the name
    
    SIGNATURE:
      SMA_METH smaMethAddrGetFromName(
      				char *name /* the name of the method */
      				)
    

    smaCovFromFit

      Fill in the covariance matrix 
    
    SIGNATURE:
      RET_CODE smaCovFromFit(
      		       METH *meth, /* the method to use */
      		       FUNC *func, /* the fit function; 
      				      cov sigma and chi2 filled in here */
      		       double epsfcn /* step size to use;
      				      0.0 defaults to machine precision */
      		       )
    

    smaFuncPlot

      Plot a FUNC on a PGSTATE
    
    SIGNATURE:
      int smaFuncPlot(
      		PGSTATE *pg,	/* where to plot and how to plot it */
      		FUNC *func,	/* what to plot */
      		FUNC *resFunc,  /* what to subtract at each point */
      		double xmin,	/* beginning x */
      		double xmax,	/* ending x */
      		int npt		/* number of points to plot */
      		)