#if !defined(PS_PHOTOM_H)
#define PS_PHOTOM_H

/** \file psPhotom.h
 *  \brief Photometric transformations
 *  \ingroup AstroGroup
 */

/** photometry system transformation types */
typedef enum {
    PS_PHOT_SYS,
    PS_PHOT_REF
} psPhotTransformType;

/** photometry system definition */
typedef struct {
    const int ID;			///< ID number for this photometric system
    const char *name;			///< Name of photometric system
    const char *camera;			///< Camera for photometric system
    const char *filter;			///< Filter used for photometric system
    const char *detector;		///< Detector used for photometric system
} psPhotSystem;

/** photometry transformations */
typedef struct {
    psPhotSystem src;			///< Source photometric system
    psPhotSystem dst;			///< Destination photometric system
    psPhotSystem pP, pM;		///< Primary colour reference
    psPhotSystem sP, sM;		///< Secondary colour reference
    float pA, sA;			///< Colour offset for primary and secondary references
    psPolynomial3D transform;		///< Transformation from source to destination
} psPhotTransform;

# endif

/**** examples & explanations 
 *
 * examples of psPhotSystem values:
 * data from Megacam, g' filter, CCD 01:
 *
 * magnitude conversions
 * instrumental mag -> rough mag -> system mag -> reference mag
 *  
 * Mruf = -2.5*log(DN) + 2.5*log(exptime) + PS_ZERO_POINT
 * Minst = Mruf - 2.5*log(exptime) - PS_ZERO_POINT
 * Msys = Mruf + C_w + K_w (airmass - 1) + SUM (X_{w,i} (color - color_ref)^i)
 * Mref = Msys + C_w + SUM (X_{w,i} (color - color_ref)^i)
 *  
 */

