/** @file  pmSourceFitset.h
 *
 *  @author EAM, IfA; GLG, MHPCC
 *
 *  @version $Revision: 1.1.2.2 $ $Name: not supported by cvs2svn $
 *  @date $Date: 2006-04-13 06:18:46 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
 *
 */

# ifndef PM_SOURCE_FIT_SET_H
# define PM_SOURCE_FIT_SET_H

psF32 pmModelFitSet(psVector *deriv,
                    const psVector *params,
                    const psVector *x);

bool pmModelFitSetInit (pmModelType type);

void pmModelFitSetClear (void);

bool pmSourceFitSetInit (float nIter, float tol, bool poissonErrors);

/** pmSourceFitSet()
 *
 * Fit the requested model to the specified source. The starting guess for the
 * model is given by the input source.model parameter values. The pixels of
 * interest are specified by the source.pixelsand source.maskentries. This
 * function calls psMinimizeLMChi2() on the image data. The function returns TRUE
 * on success or FALSE on failure.
 *
 */
bool pmSourceFitSet(
    pmSource *source,   ///< The input pmSource
    psArray *modelSet,   ///< model to be fitted
    const bool PSF   ///< Treat model as PSF or EXT?
);

# endif /* PM_SOURCE_FIT_MODEL_H */
