/* @file  pmConceptsRead.h
 * @brief Reading concepts from a variety of sources.
 *
 * @author Paul Price, IfA
 *
 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
 * @date $Date: 2007-03-30 21:12:56 $
 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii
 */

#ifndef PM_CONCEPTS_READ_H
#define PM_CONCEPTS_READ_H

/// Read concepts from the camera format file's CELLS.
///
/// Examines the CELLS metadata in the camera format file
/// for the current type of cell, and sucks in the concepts defined there.
/// This is a useful way of defining concepts that vary depending on the
/// type of the cell.
bool p_pmConceptsReadFromCells(psMetadata *target, ///< Place into which to read the concepts
                               const psMetadata *specs, ///< The concept specifications
                               const pmCell *cell ///< The cell
                              );

/// Read concepts from the DEFAULTS in the camera format file.
///
/// Examines the DEFAULTS metadata in the camera format file
/// for concepts in the specs, and imports them into the target.
bool p_pmConceptsReadFromDefaults(psMetadata *target, // Place into which to read the concepts
                                  const psMetadata *specs, // The concept specifications
                                  const pmFPA *fpa, // The FPA
                                  const pmChip *chip, // The chip
                                  const pmCell *cell // The cell
                                 );

/// Read concepts from the header TRANSLATION in the camera format file.
///
/// Examines the TRANSLATION metadata in the camera format file
/// for concepts in the specs, and imports them into the target.
bool p_pmConceptsReadFromHeader(psMetadata *target, // Place into which to read the concepts
                                const psMetadata *specs, // The concept specifications
                                const pmFPA *fpa, // The FPA
                                const pmChip *chip, // The chip
                                const pmCell *cell  // The cell
                               );

/// Read concepts from the header DATABASE in the camera format file.
///
/// Examines the DATABASE metadata in the camera format file
/// for concepts in the specs, and imports them into the target.
/// WARNING: This function has not been tested; use at your own risk!
bool p_pmConceptsReadFromDatabase(psMetadata *target, // Place into which to read the concepts
                                  const psMetadata *specs, // The concept specifications
                                  const pmFPA *fpa, // The FPA
                                  const pmChip *chip, // The chip
                                  const pmCell *cell,  // The cell
                                  psDB *db // The database handle
                                 );
/// @}
#endif
