#ifndef PM_FPA_CONCEPTS_GET_H
#define PM_FPA_CONCEPTS_GET_H

#include "pslib.h"
#include "pmAstrometry.h"
#include "psAdditionals.h"

psMetadataItem *p_pmFPAConceptGetFromCamera(pmCell *cell, // The cell
        const char *concept // Name of concept
                                           );
psMetadataItem *p_pmFPAConceptGetFromHeader(pmFPA *fpa, // The FPA that contains the chip
        pmChip *chip, // The chip that contains the cell
        pmCell *cell, // The cell
        const char *concept // Name of concept
                                           );
psMetadataItem *p_pmFPAConceptGetFromDefault(pmFPA *fpa, // The FPA that contains the chip
        pmChip *chip, // The chip that contains the cell
        pmCell *cell, // The cell
        const char *concept // Name of concept
                                            );
psMetadataItem *p_pmFPAConceptGetFromDB(pmFPA *fpa, // The FPA that contains the chip
                                        pmChip *chip, // The chip that contains the cell
                                        pmCell *cell, // The cell
                                        psDB *db,       // DB handle
                                        const char *concept // Name of concept
                                       );
psMetadataItem *p_pmFPAConceptGet(pmFPA *fpa, // The FPA
                                  pmChip *chip,// The chip
                                  pmCell *cell, // The cell
                                  psDB *db, // DB handle
                                  const char *concept // Concept name
                                 );
void p_pmFPAConceptGetF32(pmFPA *fpa,   // The FPA
                          pmChip *chip, // The chip
                          pmCell *cell, // The cell
                          psDB *db,     // DB handle
                          psMetadata *concepts, // The concepts MD
                          const char *name, // Name of the concept
                          const char *comment // Comment for concept
                         );
void p_pmFPAConceptGetF64(pmFPA *fpa,   // The FPA
                          pmChip *chip, // The chip
                          pmCell *cell, // The cell
                          psDB *db,     // DB handle
                          psMetadata *concepts, // The concepts MD
                          const char *name, // Name of the concept
                          const char *comment // Comment for concept
                         );
void p_pmFPAConceptGetS32(pmFPA *fpa,   // The FPA
                          pmChip *chip, // The chip
                          pmCell *cell, // The cell
                          psDB *db,     // DB handle
                          psMetadata *concepts, // The concepts MD
                          const char *name, // Name of the concept
                          const char *comment // Comment for concept
                         );
void p_pmFPAConceptGetString(pmFPA *fpa, // The FPA
                             pmChip *chip, // The chip
                             pmCell *cell, // The cell
                             psDB *db,  // DB handle
                             psMetadata *concepts, // The concepts MD
                             const char *name, // Name of the concept
                             const char *comment // Comment for concept
                            );


// Ingest a single cell concept; this is the workhorse for ingesting cell concepts
bool p_pmCellIngestConcept(pmFPA *fpa,  // The FPA
                           pmChip *chip, // The chip
                           pmCell *cell, // The cell
                           psDB *db,    // DB handle
                           const char *concept // Name of the concept
                          );

// Ingest concepts for the FPA
void pmFPAIngestConcepts(pmFPA *fpa,    // The FPA
                         psDB *db       // DB handle
                        );
// Ingest concepts for the chip
bool pmChipIngestConcepts(pmChip *chip, // The chip
                          psDB *db      // DB handle
                         );
// Ingest concepts for the cell
bool pmCellIngestConcepts(pmCell *cell, // The cell
                          psDB *db      // DB handle
                         );

// Set up concepts for blank image
bool pmFPABlankConcepts(pmFPA *fpa      // The FPA
                       );

// Copy concepts from one FPA to another
bool pmFPACopyConcepts(pmFPA *target,   // The target FPA
                       pmFPA *source    // The target FPA
                      );

// Retrieve a concept
psMetadataItem *pmCellGetConcept(pmCell *cell, // The cell
                                 const char *concept // The concept
                                );


#endif
