/* @file  pmSourceIO.h
 * @brief functions to read and write object files
 *
 * @author EAM, IfA; GLG, MHPCC
 *
 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
 * @date $Date: 2007-01-24 02:54:15 $
 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
 *
 */

# ifndef PM_SOURCE_IO_H
# define PM_SOURCE_IO_H

/// @addtogroup Objects Object Detection / Analysis Functions
/// @{

int pmSourceDophotType (pmSource *source);

bool pmSourcesWriteRAW (psArray *sources, char *filename);
bool pmSourcesWriteOBJ (psArray *sources, char *filename);
bool pmSourcesWriteSX (psArray *sources, char *filename);
bool pmSourcesWriteCMP (psArray *sources, char *filename, psMetadata *header);
bool pmSourcesWriteCMF (psFits *fits, psArray *sources, psMetadata *header, char *extname);

psArray *pmSourcesReadCMP (char *filename, psMetadata *header);
psArray *pmSourcesReadCMF (psFits *fits, psMetadata *header);

bool pmSourcesWritePSFs (psArray *sources, char *filename);
bool pmSourcesWriteEXTs (psArray *sources, char *filename, bool require);
bool pmSourcesWriteNULLs (psArray *sources, char *filename);
bool pmMomentsWriteText (psArray *sources, char *filename);
bool pmPeaksWriteText (psArray *peaks, char *filename);

bool pmFPAviewReadObjects (const pmFPAview *view, pmFPAfile *file, pmConfig *config);
bool pmFPAReadObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config);
bool pmChipReadObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config);
bool pmCellReadObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config);
bool pmReadoutReadObjects (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config);

bool pmFPAviewWriteObjects (const pmFPAview *view, pmFPAfile *file, pmConfig *config);
bool pmFPAWriteObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config);
bool pmChipWriteObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config);
bool pmCellWriteObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config);
bool pmReadoutWriteObjects (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config);

/// @}
# endif /* PM_SOURCE_IO_H */
