#ifndef PM_FLAT_NORMALIZE_H
#define PM_FLAT_NORMALIZE_H

#include "pslib.h"

// Normalise the flat-field measurements (f_ij = g_i s_j where f_ij is the flux recorded for chip i and
// integration j, g_i is the gain for the i-th chip, s_j is the flux of the source in the j-th integration).
bool pmFlatNormalize(psVector **expFluxesPtr, // Flux in each exposure; modified for return
                     psVector **chipGainsPtr, // Initial guess of the chip gains; modified for return
                     const psImage *bgMatrix
                    );

#endif
