#ifndef TA_STARS_PARAM_H
#define TA_STARS_PARAM_H

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Stars Working Group target selection interface
 */

#include <dervish.h>
#include "taCalibObj.h"

/* Stars Working Group target selection parameters */
typedef struct taStarsParams
{
  float brightLimitG;           /* don't target stars brigher than this in g' */
  float brightLimitR;           /* don't target stars brigher than this in r' */
  float brightLimitI;           /* don't target stars brigher than this in i' */
  float spectralLimit;		/* don't target stars fainter than this in r' */
  float BHBugV;                 /* these various values of u-g and g-r */
  float BHBugW;                 /*    define a polygon, target objects inside */
  float BHBugX;                 /*    for more information, see the comments */
  float BHBugY;                 /*    in ../examples/tsStarsParams.par */
  float BHBugZ;
  float BHBgrA;
  float BHBgrB;
  float BHBgrC;
  float BHBgrD;
  float BHBgrE;
  float BHBdensity;		/* expected number per plate */
  float CARBONgrBlue;           /* g-r > this */
  float CARBONriBlue;           /* r-i > this */
  float CARBONizBlue;           /* i-z > this */
  float CARBONriSlope;          /* r-i < Slope*(g-r) + Intercept */
  float CARBONriIntercept;
  float CARBONgrDusty;          /* g-r > this, dusty candidate */
  float CARBONgrRed;            /* g-r > this, high priority */
  float CARBONdensity;          /* expected number per plate */
  float BWNDWRFzFaint;          /* z < this */
  float BWNDWRFriBlue;          /* r-i > this */
  float BWNDWRFizBlue;          /* i-z > this */
  float BWNDWRFiErr;            /* error(i) < this */
  float BWNDWRFdensity;		/* expected number per plate */
  float LOWLUMSUBDWRFgrBlue;    /* g-r > this */
  float LOWLUMSUBDWRFriBlue;    /* r-i > this */
  float LOWLUMSUBDWRFriRed;     /* r-i < this */
  float LOWLUMSUBDWRFlo;	/* r-i > this */
  float LOWLUMSUBDWRFhi;	/* r-i < this */
  float LOWLUMSUBDWRFpmLim;     /* goose priority if p.m. > this */
  float LOWLUMSUBDWRFdensity;	/* expected number per plate */
  float CATYVARugRed;           /* u-g < this */
  float CATYVARgrRed;           /* g-r < this */
  float CATYVARriRed;           /* r-i < this */
  float CATYVARizRed;           /* i-z < this */
  float CATYVARdensity;		/* expected number per plate */
  float REDDWARFzFaint;         /* z < this */
  float REDDWARFiErr;           /* error(i) < this */
  float REDDWARFriBlue;         /* r-i > this */
  float REDDWARFizBlue;         /* i-z > this */
  float REDDWARFdensity;        /* number per plate */
  float WHITEDWARFgrSlope;      /* g-r > Slope*(r-i) + Intercept */
  float WHITEDWARFgrIntercept;
  float WHITEDWARFrizBlue;
  float WHITEDWARFrizRed;
  float WHITEDWARFriFactor;	/* rizBlue < riFactor*(r-i)+izFactor*(i-z) */
  float WHITEDWARFizFactor;     /* rizRed  > riFactor*(r-i)+izFactor*(i-z) */
  float WHITEDWARFgrBlue;	/* g-r > this */
  float WHITEDWARFgrRed;	/* g-r < this */
  float WHITEDWARFpmLim;        /* goose priority if p.m. > this */
  float WHITEDWARFdensity;	/* expected number per plate */
  float PNgrRed;		/* g-r < this */
  float PNriRed;		/* r-i < this */
  float PNizBlue;		/* i-z > this */
  float PNgErr;			/* error(g) < this */
  float PNrErr;			/* error(r) < this */
  float PNzErr;			/* error(z) < this */
  float PNrBright;		/* psfCounts(r) > this */
  float PNrFaint;		/* psfCounts(r) < this */
} TA_STARS_PARAMS;  /* pragma SCHEMA */

/* Prototypes */
int taStarsTargetSelect(TA_CALIB_OBJ *obj, const TA_STARS_PARAMS *params);

#ifdef __cplusplus
}
#endif

#endif
