/* @file pmBias.h
 * @brief Subtract the overscan, bias and dark
 *
 * @author George Gusciora, MHPCC
 * @author Paul Price, IfA
 *
 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
 * @date $Date: 2007-08-15 20:21:18 $
 * Copyright 2004--2006 Institute for Astronomy, University of Hawaii
 */

#ifndef PM_BIAS_H
#define PM_BIAS_H

/// @addtogroup detrend Detrend Creation and Application
/// @{

/// Subtract the overscan, bias and/or dark
///
/// Subtracts the overscan, as measured from the bias member of the input readout (if options are non-NULL),
/// bias (if non-NULL) and dark (if non-NULL) scaled by the CELL.DARKTIME concept.
bool pmBiasSubtract(pmReadout *in,      ///< Input readout, to be overscan/bias/dark corrected
                    pmOverscanOptions *overscanOpts, ///< Options for overscan subtraction, or NULL
                    const pmReadout *bias, ///< Bias to subtract, or NULL
                    const pmReadout *dark, ///< Dark to scale and subtract, or NULL
                    const pmFPAview *view ///< View for readout of interest
                   );

// pmBiasSubtractFrame(): this routine will take as input a readout for the input image and a readout for the bias
// image.  The bias image is subtracted in place from the input image.
bool pmBiasSubtractFrame(pmReadout *in, // Input readout
                          const pmReadout *sub, // Readout to be subtracted from input
                          float scale   // Scale to apply before subtracting
    );

/// @}
#endif
