Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ccd.h

Go to the documentation of this file.
00001 /*************************************************************************
00002 * E.S.O. - VLT project
00003 *
00004 * "@(#) $Id: ccd.h,v 4.1 2003/10/30 15:32:46 vltsccm Exp $"
00005 *
00006 * who       when      what
00007 * --------  --------  ----------------------------------------------
00008 * pduhoux  08/07/99   SPR990046 : Added macro ccdFITSDATASUFF = "fits" 
00009 *                     for FITS file extensions
00010 * alongino  24/07/95  created
00011 * alongino  17/08/95  ccdCAMERANAME_LEN moved from ccdInternal.h
00012 * alongino  18/08/95  SETUP parameters moved from ccdInternal.h and modified
00013 * alongino  23/08/95  added ccdSETUPRES and ccdCheckSetup
00014 * alongino  24/08/95  added ccdWINDOW and ccdSETUP
00015 *                     modified macro for commands (added CMD in front)
00016 * alongino  31/08/95  added ccdFITSHIERSUFF
00017 * alongino  04/09/95  ccdGetIndexFromId moved from ccdInternal.h
00018 * alongino  29/09/95  ccdDatabase.h replaced with ccdDbPublic.h
00019 * alongino  30/01/96  added definitions for command parameters
00020 * pduhoux   07/03/96  removed 'const' from prototypes
00021 * pduhoux   24/05/96  added WAIT modes               
00022 * alongino  10/06/96  moved from module ccdcon to ccd             
00023 * alongino  09/07/96  added ccdIP_NO_USER_FUN and ccdIP_NO_USER_BUF           
00024 * alongino  12/07/96  added ccdCMD_WAIT          
00025 * pduhoux   22/07/96  added doTransfer/doProcess flags in ccdSETUPRES
00026 * alongino  09/10/96  DET.FRAM.TYPE DET.FRAM.BIAS DET.FRAM.FLATF implemented
00027 * pduhoux   11/11/96  added setup parameters to ccdIPIMAGE data structure
00028 * alongino  15/11/96  added ccdObj.h
00029 * alongino  13/12/96  added ccdCMD_STAND_ALONE
00030 * alongino  16/12/96  added parameters for ccdCMD_STAND_ALONE
00031 * pduhoux   17/01/97  added macro ccdMAXLENFILE = 31 (SPR960683)
00032 * pduhoux   12/02/97  added setup macros ccdTIME_START/REP/DEF
00033 * pduhoux   04/03/97  added ccdPROCESS data structure
00034 *                     replaced IP setup by array for multiple window IP
00035 * pduhoux   12/03/97  VERSION_DATE is MAY97
00036 * pduhoux   12/03/97  added cmd STARTTL/STOPTL and STARTTM/STOPTM
00037 *                     moved cmd OFF/ONLINE from ccdInternal.h
00038 * pduhoux   13/03/97  removed setup keywords for former one window processing
00039 * pduhoux   14/03/97  added ccdKEY_TMPSTAT & ccdKEY_TELSTAT for STATUS cmd
00040 * pduhoux   16/04/97  added <gainIndex> in ccdCONFCLOCK
00041 * pduhoux   02/06/97  new data structure ccdIPIMAGE
00042 *                     enhanced ccdSETUP/ccdPROCESS data structures
00043 * pduhoux   30/06/97  added <timeDefIdem>, <linesToShiftType> and
00044 *                     <linesToShiftMulti[]> in ccdSETUP data structure
00045 *                     added setup macros ccdEXP_STEP_DEF, ccdTIME_DEF_IDEM,
00046 *                     ccdTIME_DEF1 to ccdTIME_DEF10, ccdREAD_SHIFT_TYPE,
00047 *                     ccdREAD_SHIFT1 to ccdREAD_SHIFT10
00048 * pduhoux   30/06/97  added <elAdu[]> in ccdCONFCLOCK
00049 * pduhoux   26/07/97  added ccdTHRMIN_5SIGMA_WINDOW_SELF/PREV
00050 *                     added setup macro ccdREAD_IMAGE_SIM
00051 *                     added field <fileNameSimu> in ccdSETUP
00052 * pduhoux   04/08/97  generalized support to ccdTHRMIN & ccdBACKGND
00053 * pduhoux   16/09/97  removed timeStart from ccdSETUP (unused)
00054 * pduhoux   10/11/97  moved ccdVERSION & ccdVERSION_DATE to 
00055 *                     ccdint/include/ccdintDefines.h
00056 * alongino  09/05/98  ccdIPEXPOSURE enhanced with more time info
00057 * alongino  12/05/98  added ccdDO_WIPE and ccdXFER_SYNC
00058 *                     wipeTime and itSync in ccdSETUP
00059 * pduhoux   25/05/98  added some fields in ccdIPEXPOSURE
00060 * pduhoux   12/08/98  added command ccdCMD_STOP_WAIT (STPWAIT)
00061 *                     renamed DET.WINi.ASUIT into DET.WINi.ASUIT1
00062 */
00063 /*************************************************************************
00064 *  This file contains all definitions used by external modules using the 
00065 *  CCD sw
00066 *************************************************************************/
00067 
00068 #ifndef CCD_H
00069 #define CCD_H
00070 
00071 #ifdef __cplusplus
00072 extern "C" {
00073 #endif
00074 
00075 /*
00076  * CCS & LCC header files
00077  */
00078 #include "CCS.h"
00079 #include "cai.h"
00080 
00081 /*
00082  * CCD header files
00083  */
00084 #include "ccdDbPublic.h"
00085 #include "ccdErrors.h"
00086 #include "ccdObj.h"
00087 
00088 /* CCD module name */
00089 #define ccdMODULE       "ccd"
00090 
00091 /*
00092  * Constants
00093  */
00094 #define ccdENV_LENV       "CCDLENV"   /* name of env. var. for LCU env.      */
00095 #define ccdENV_DID        "CCDDID"    /* name of env. var. for Dictionary    */
00096 #define ccdDID            "CCDDCS"    /* name of default CCD Data Dictionary */
00097 #define ccdCAT            slxDETECTOR /* name of FITS category               */
00098 #define ccdEXP_NEXT       -1          /* ID for next exposure to start       */
00099 #define ccdEXP_LAST       0           /* ID for last started exposure        */
00100 #define ccdCAMERANAME_LEN 8           /* maximum length of camera name       */
00101 #define ccdMAXLENFILE     63          /* maximum length of FITS file names   */
00102 #define ccdMAXBINX        8           /* maximum binning allowed along x     */
00103 #define ccdMAXBINY        8           /* maximum binning allowed along y     */
00104 #define ccdFITSHIERSUFF   "det"       /* suffix for FITS HIER DET file       */
00105 #define ccdFITSDATASUFF   "fits"      /* suffix for FITS data file           */
00106 #define ccdDCSHEADLINES   21      /* lines written by CCD DCS in FITS header */
00107 #define ccdDCSXTNDLINES   22      /* lines written by CCD DCS in FITS header */
00108                                   /* XTENSION part                           */
00109 
00110 /* commands implemented */
00111 #define ccdCMD_ABORT       "ABORT"
00112 #define ccdCMD_BIAS        "BIAS"
00113 #define ccdCMD_CONTINUE    "CONT"
00114 #define ccdCMD_DISPLAY     "DISPLAY"
00115 #define ccdCMD_DUMP        "DUMP"
00116 #define ccdCMD_END         "END"
00117 #define ccdCMD_EXIT        "EXIT"
00118 #define ccdCMD_FLAT        "FLAT"
00119 #define ccdCMD_GRAB        "GRAB"
00120 #define ccdCMD_INIT        "INIT"
00121 #define ccdCMD_OFF         "OFF"
00122 #define ccdCMD_ONLINE      "ONLINE"
00123 #define ccdCMD_OPERATE     "OPERATE"
00124 #define ccdCMD_PAUSE       "PAUSE"
00125 #define ccdCMD_PDOWN       "PDOWN"
00126 #define ccdCMD_SETUP       "SETUP"
00127 #define ccdCMD_STAND_ALONE "STANDAL"
00128 #define ccdCMD_STANDBY     "STANDBY"
00129 #define ccdCMD_START       "START"
00130 #define ccdCMD_STARTAG     "STARTAG"
00131 #define ccdCMD_STARTLP     "STARTLP"
00132 #define ccdCMD_START_WIPE  "STARTWP"
00133 #define ccdCMD_STARTTL     "STARTTL"
00134 #define ccdCMD_STARTTM     "STARTTM"
00135 #define ccdCMD_STATUS      "STATUS"
00136 #define ccdCMD_STOP        "STOP"
00137 #define ccdCMD_STOP_WAIT   "STPWAIT"
00138 #define ccdCMD_STOP_WIPE   "STOPWP"
00139 #define ccdCMD_STOPTL      "STOPTL"
00140 #define ccdCMD_STOPTM      "STOPTM"
00141 #define ccdCMD_VERS        "VERSION"
00142 #define ccdCMD_WAIT        "WAIT"
00143 
00144 /* commands implemented in WS simulation only (not supported by LCU yet ) */
00145 #define ccdCMD_DISABLE     "DISABLE"
00146 #define ccdCMD_ENABLE      "ENABLE"
00147 #define ccdCMD_ENHANCE     "ENHANCE"
00148 #define ccdCMD_PROCESS     "PROCESS"
00149 #define ccdCMD_PXQUERY     "PXQUERY"
00150 #define ccdCMD_SELFTST     "SELFTST"
00151 #define ccdCMD_VERBOSE     "VERBOSE"
00152 
00153 /* commands not yet implemented */
00154 #define ccdCMD_CONFIG      "CONFIG"
00155 #define ccdCMD_SIM         "SIM"
00156 #define ccdCMD_STOPSIM     "STOPSIM"
00157 
00158 /* parameters */
00159 /* command ccdCMD_STATUS */
00160 #define ccdPAR_STATUS_EXPOID   "expoId"          /* exposure ID parameter name  */
00161 #define ccdPAR_STATUS_FUNCTION "function"        /* function parameter name     */
00162 
00163 /* paremeters currently used for ccdPAR_STATUS_FUNCTION */
00164 #define ccdALL                "all"
00165 #define ccdGLOBAL             "global"
00166 #define ccdKEY_OPMODE         "DET.MODE"         /* see also ccdOPMODE          */
00167 #define ccdKEY_OPSTATE        "DET.STATE"        /* see also ccdSTATE           */
00168 #define ccdKEY_SHTSTAT        "DET.SHUT"         /* see also ccdSHT_STATUS      */
00169 #define ccdKEY_TMPSTAT        "DET.TEMP"         /* Temperature values          */
00170 #define ccdKEY_TELSTAT        "DET.TELE"         /* Telemetry values            */
00171 
00172 /* reply parameters for ccdCMD_STATUS */
00173 #define ccdPAR_STATUS_EXPSTATUS  "expStatus"     /* exposure status par. name   */
00174                          /* see also ccdEXP_xxx         */
00175 #define ccdPAR_STATUS_FUNCSTATUS "funcStatus"    /* function status par. name   */
00176 
00177 /* command ccdCMD_SETUP */
00178 #define ccdPAR_SETUP_EXPOID   "expoId"           /* exposure ID parameter name  */
00179 #define ccdPAR_SETUP_FILE     "file"             /* setup file parameter name   */
00180 #define ccdPAR_SETUP_FUNCTION "function"         /* setup function name         */
00181 #define ccdPAR_SETUP_CHECK    "check"            /* setup check required        */
00182 
00183 /* command ccdCMD_START */
00184 #define ccdPAR_START_AT       "at"               /* start at UTC                */
00185 
00186 /* paremeters currently used for ccdPAR_SETUP_FUNCTION */
00187 #define ccdEXP_TYPE           "DET.EXP.TYPE"     /* exposure type               */
00188                          /* see also ccdEXPTYPE         */
00189 #define ccdEXP_STEP_DEF       "DET.WIN1.NDIT"    /* Number of steps for MULTI   */
00190 
00191 #define ccdTIME_DEF_IDEM      "DET.WIN1.ASUIT1" /* integration time as UIT1    */
00192 #define ccdTIME_DEF_BASE      "DET.WIN1.UIT"
00193 #define ccdTIME_DEFi          "DET.WIN1.UIT%i"   /* integration time            */
00194 #define ccdTIME_DEF           "DET.WIN1.UIT1"    /* integration time single     */
00195 
00196 #define ccdREPEAT_DEF         "DET.EXP.NREP"     /* exp. repetition count       */
00197                          /* see also ccdREPEAT_FOREVER  */
00198 #define ccdDO_WIPE            "DET.EXP.WIPETIM"  /* wipe at the begin of exp.   */
00199 #define ccdTIME_REP           "DET.EXP.TIMEREP"  /* Interval between 2 exposures*/
00200 #define ccdFILE_UNC           "DET.FRAM.FITSUNC" /* file for uncompr. image data*/
00201 #define ccdDISK_SAVE          "DET.FRAM.FITSMTD" /* disk save method            */
00202 #define ccdXFER_SYNC          "DET.FRAM.XFERSYN" /* image transfer synchronous  */
00203                          /* see also ccdDISKSAVE        */
00204 #define ccdSAMPLE             "DET.FRAM.SAMPLE"  /* transfer sampling rate      */
00205 #define ccdDISPLAY            "DET.DISPLAY"      /* real-time display frame Id  */
00206                          /* see also ccdNO_DISPLAY      */
00207 #define ccdREAD_CLOCK         "DET.READ.CLKIND"  /* clock index                 */
00208 #define ccdREAD_GAIN          "DET.OUT1.GAININD" /* readout gain                */
00209 #define ccdREAD_FRAME_TYPE    "DET.FRAM.TYPE"    /* frame type                  */
00210                          /* see also ccdFRAME_xxx       */
00211 #define ccdREAD_SHIFT_TYPE    "DET.READ.SHIFTYP" /* line shift type for MULTI  */
00212 #define ccdREAD_SHIFT_BASE    "DET.READ.SHIFT"   /* line shift                  */
00213 #define ccdREAD_SHIFTi        "DET.READ.SHIFT%i" /* line shift step #i          */
00214 
00215 #define ccdREAD_IMAGE_SIM     "DET.READ.SIMIMG"  /* image to load for ACE sim   */
00216 
00217 /*===========*/
00218 /* WINDOW #1 */
00219 /*===========*/
00220 #define ccdREAD_WIN1_BIN_X    "DET.WIN1.BINX"    /* readout x binning           */
00221 #define ccdREAD_WIN1_BIN_Y    "DET.WIN1.BINY"    /* readout y binning           */
00222 #define ccdREAD_WIN1_ENAB     "DET.WIN1.ST"      /* enabled flag                */
00223 #define ccdREAD_WIN1_FIR_X    "DET.WIN1.STRX"    /* first x pixel               */
00224 #define ccdREAD_WIN1_DIM_X    "DET.WIN1.NX"      /* x dimensions                */
00225 #define ccdREAD_WIN1_FIR_Y    "DET.WIN1.STRY"    /* first y pixel               */
00226 #define ccdREAD_WIN1_DIM_Y    "DET.WIN1.NY"      /* y dimensions                */
00227 #define ccdPROC_WIN1_MINMAX   "DET.WIN1.MINMAX"  /* search image extrema        */
00228 #define ccdPROC_WIN1_BIAS     "DET.WIN1.BIAS"    /* bias subtraction wanted     */
00229 #define ccdPROC_WIN1_FLAT     "DET.WIN1.FLATF"   /* flat field division wanted  */
00230 #define ccdPROC_WIN1_CENTROID "DET.WIN1.CENTROID"/* type of centroiding         */
00231                          /* see also ccdCENTROID_xxx    */
00232 #define ccdPROC_WIN1_REF_X    "DET.WIN1.REFX"    /* X ref. star for centroiding */
00233 #define ccdPROC_WIN1_REF_Y    "DET.WIN1.REFY"    /* Y ref. star for centroiding */
00234 #define ccdPROC_WIN1_USERFUNC "DET.WIN1.IPFUNC"  /* User Function name          */
00235 #define ccdPROC_WIN1_USERBUFF "DET.WIN1.IPBUFF"  /* User Buffer name            */
00236 #define ccdPROC_WIN1_THRMIN   "DET.WIN1.THRMIN"  /* threshold for min intensity */
00237 #define ccdPROC_WIN1_THRMAX   "DET.WIN1.THRMAX"  /* threshold for max intensity */
00238 #define ccdPROC_WIN1_BACKGND  "DET.WIN1.BACKGND" /* sky background              */
00239 #define ccdPROC_WIN1_IPLLX    "DET.WIN1.IPLLX"   /* proc subWin offsets         */
00240 #define ccdPROC_WIN1_IPLLY    "DET.WIN1.IPLLY"   /* proc subWin offsets         */
00241 #define ccdPROC_WIN1_IPURX    "DET.WIN1.IPURX"   /* proc subWin offsets         */
00242 #define ccdPROC_WIN1_IPURY    "DET.WIN1.IPURY"   /* proc subWin offsets         */
00243 
00244 /*===========*/
00245 /* WINDOW #2 */
00246 /*===========*/
00247 #define ccdREAD_WIN2_BIN_X    "DET.WIN2.BINX"    /* readout x binning           */
00248 #define ccdREAD_WIN2_BIN_Y    "DET.WIN2.BINY"    /* readout y binning           */
00249 #define ccdREAD_WIN2_ENAB     "DET.WIN2.ST"      /* enabled flag                */
00250 #define ccdREAD_WIN2_FIR_X    "DET.WIN2.STRX"    /* first x pixel               */
00251 #define ccdREAD_WIN2_DIM_X    "DET.WIN2.NX"      /* x dimensions                */
00252 #define ccdREAD_WIN2_FIR_Y    "DET.WIN2.STRY"    /* first y pixel               */
00253 #define ccdREAD_WIN2_DIM_Y    "DET.WIN2.NY"      /* y dimensions                */
00254 #define ccdPROC_WIN2_MINMAX   "DET.WIN2.MINMAX"  /* search image extrema        */
00255 #define ccdPROC_WIN2_BIAS     "DET.WIN2.BIAS"    /* bias subtraction wanted     */
00256 #define ccdPROC_WIN2_FLAT     "DET.WIN2.FLATF"   /* flat field division wanted  */
00257 #define ccdPROC_WIN2_CENTROID "DET.WIN2.CENTROID"/* type of centroiding         */
00258                          /* see also ccdCENTROID_xxx    */
00259 #define ccdPROC_WIN2_REF_X    "DET.WIN2.REFX"    /* X ref. star for centroiding */
00260 #define ccdPROC_WIN2_REF_Y    "DET.WIN2.REFY"    /* Y ref. star for centroiding */
00261 #define ccdPROC_WIN2_USERFUNC "DET.WIN2.IPFUNC"  /* User Function name          */
00262 #define ccdPROC_WIN2_USERBUFF "DET.WIN2.IPBUFF"  /* User Buffer name            */
00263 #define ccdPROC_WIN2_THRMIN   "DET.WIN2.THRMIN"  /* threshold for min intensity */
00264 #define ccdPROC_WIN2_THRMAX   "DET.WIN2.THRMAX"  /* threshold for max intensity */
00265 #define ccdPROC_WIN2_BACKGND  "DET.WIN2.BACKGND" /* sky background              */
00266 #define ccdPROC_WIN2_IPLLX    "DET.WIN2.IPLLX"   /* proc subWin offsets         */
00267 #define ccdPROC_WIN2_IPLLY    "DET.WIN2.IPLLY"   /* proc subWin offsets         */
00268 #define ccdPROC_WIN2_IPURX    "DET.WIN2.IPURX"   /* proc subWin offsets         */
00269 #define ccdPROC_WIN2_IPURY    "DET.WIN2.IPURY"   /* proc subWin offsets         */
00270 
00271 /* paremeters foreseen but not used (the list is not finalized) */
00272 #define ccdREADPIX            "DET.READ.NO"      /* pixel readout times (skip)  */
00273 #define ccdMPPMODE            "DET.READ.MODE"    /* mpp mode                    */
00274 #define ccdFILE_COM           "DET.FRAM.FITSCMP" /* file for compr. image data  */
00275 
00276 /* command ccdCMD_START */
00277 #define ccdPAR_START_EXPOID   "expoId"           /* exposure ID parameter name  */
00278 
00279 /* command ccdCMD_VERS */
00280 #define ccdPAR_VERS_CCDVERS   "ccdVersion"       /* version of CCD software     */
00281 
00282 /* parameters for ccdCMD_STAND_ALONE */
00283 #define ccdPAR_STANDAL_ON     "on"              /* stand-alone flag          */
00284 #define ccdPAR_STANDAL_ARC    "archive"         /* archive images            */
00285 
00286 /* 
00287  * exposure status (ccdPAR_STATUS_EXPSTATUS). Bit-field
00288  */
00289 #define ccdEXP_NONE             0
00290 #define ccdEXP_INACTIVE         1
00291 #define ccdEXP_PENDING          2
00292 #define ccdEXP_INTEGRATING      4
00293 #define ccdEXP_PAUSED           8
00294 #define ccdEXP_READING         16
00295 #define ccdEXP_PROCESSING      32
00296 #define ccdEXP_TRANSFERING     64
00297 #define ccdEXP_COMPLETED      128
00298 #define ccdEXP_FAILED         256
00299 #define ccdEXP_ABORTED        512
00300 #define ccdEXP_LOOP_FINITE   1024
00301 #define ccdEXP_LOOP_INFINITE 2048
00302 
00303 #define ccdEXP_DONE \
00304        (ccdEXP_COMPLETED | ccdEXP_FAILED | ccdEXP_ABORTED)
00305 #define ccdEXP_RUNNING \
00306        (ccdEXP_PENDING | ccdEXP_INTEGRATING | ccdEXP_PAUSED | \
00307   ccdEXP_READING | ccdEXP_PROCESSING | ccdEXP_TRANSFERING )
00308 #define ccdEXP_LOOP \
00309        (ccdEXP_LOOP_FINITE | ccdEXP_LOOP_INFINITE)
00310 
00311 /*
00312  * Infinite loop (ccdREPEAT_DEF)
00313  */
00314 #define ccdREPEAT_FOREVER 0
00315 
00316 /*
00317  * Display types
00318  */
00319 #define ccdNO_DISPLAY -1
00320 
00321 /*
00322  * Wait modes
00323  */
00324 #define ccdWAIT_SINGLE 0
00325 #define ccdWAIT_GLOBAL 1
00326 
00327 #define ccdWAIT_SINGLE_STR "Single"
00328 #define ccdWAIT_GLOBAL_STR "Global" 
00329 
00330 /* ccdEXP_TYPE */
00331 typedef enum
00332     {
00333     ccdEXP_NORMAL = 1,
00334     ccdEXP_DARK,
00335     ccdEXP_MULTI
00336     } ccdEXPTYPE;
00337 #define ccdEXP_NORMAL_STR "Normal"
00338 #define ccdEXP_DARK_STR   "Dark"
00339 #define ccdEXP_MULTI_STR  "Multiple"   /* not implemented yet */
00340 
00341 typedef char ccdCAMERANAME[ccdCAMERANAME_LEN + 1];   /* name of CCD camera  */
00342 
00343 /* operational modes */
00344 typedef enum                       /* possible operational modes           */
00345     {
00346     ccdNOT_AVAILABLE = 1,          /* CCD sw is not available              */
00347     ccdNORMAL,                     /* CCD sw and hw available              */
00348     ccdSIM_WS,                     /* LCU CCD sw is simulated at WS level  */
00349     ccdSIM_LCU,                    /* CCD hw is simulated at LCU level     */
00350     ccdSIM_ACE                     /* CCD hw is simulated at ACE level     */
00351     } ccdOPMODE;
00352 
00353 /*
00354  * operational states
00355  */
00356 typedef enum {
00357     ccdUNKNOWN   = ccsSTATE_UNK,     /* unknown                              */
00358     ccdOFF       = ccsSTATE_OFF,     /* terminating                          */
00359     ccdLOADED    = ccsSTATE_LOADED,  /* need to be initialised               */
00360     ccdSTANDBY   = ccsSTATE_STANDBY, /* stand-by                             */
00361     ccdONLINE    = ccsSTATE_ONLINE,  /* ready for exposures                  */
00362 } ccdSTATE;
00363 
00364 #define ccdOPERATING ccsSTATE_ONLINE
00365 
00366 /*
00367  * shutter status definition
00368  */
00369 typedef enum
00370     {
00371     ccdSHT_ERROR = -1,
00372     ccdSHT_CLOSED,
00373     ccdSHT_OPENED,
00374     ccdSHT_CLOSING,
00375     ccdSHT_OPENING
00376     } ccdSHT_STATUS;
00377 
00378 /* Various ways of saving an image in disk file(s) */
00379 typedef enum
00380     {
00381     ccdDISK_NONE = 0,
00382     ccdDISK_COMPRESS,               /* not implemented yet */
00383     ccdDISK_UNCOMPRESS,
00384     ccdDISK_BOTH                    /* not implemented yet */     
00385     } ccdDISKSAVE;
00386 
00387 #define ccdDISK_NONE_STR       "None"
00388 #define ccdDISK_COMPRESS_STR   "Compress"
00389 #define ccdDISK_UNCOMPRESS_STR "Uncompress"
00390 #define ccdDISK_BOTH_STR       "Both"
00391 
00392 /*
00393  * Frame type (for storage in LCU memory, see setup param. ccdREAD_FRAME_TYPE)
00394  */
00395 #define ccdFRAME_NORMAL "Normal"          /* normal frame: temporary storage */
00396 #define ccdFRAME_BIAS   "Bias"    /* reference bias frame: permanent storage */
00397 #define ccdFRAME_DARK   "Dark"              /* dark frame: permanent storage */
00398 #define ccdFRAME_FLAT   "FF" /* reference flatfield frame: permanent storage */
00399 
00400 typedef enum
00401     {
00402     ccdFRM_NORMAL = 0,
00403     ccdFRM_BIAS,
00404     ccdFRM_DARK,
00405     ccdFRM_FLAT
00406     } ccdFRMTYPE;
00407 
00408 /*
00409  * Multi-Step Integration time
00410  */
00411 #define ccdEXPTIME_IDEM ccsTRUE  /* use DET.WIN1.UIT1 for all steps */
00412 #define ccdEXPTIME_LIST ccsFALSE /* use DET.WIN1.UITi as defined    */
00413 
00414 /*
00415  * Line Shift type
00416  */
00417     /* Setup values for Line Shift type */
00418 typedef enum 
00419     {
00420     ccdLINE_SHIFT_ALT = -1,      /* use DET.READ.SHIFT1 alt. pos & neg*/
00421                                  /* Alternate exposure mode           */
00422     ccdLINE_SHIFT_IDEM = 0,      /* use DET.READ.SHIFT1 for all steps */
00423                                  /* Focus & Sky Coherence modes       */
00424     ccdLINE_SHIFT_LIST = 1       /* use DET.READ.SHIFTi as defined    */
00425     } ccdLINESHIFT_TYPE;
00426 
00427 #define ccdLINE_SHIFT_ALT_STR  "alternate"
00428 #define ccdLINE_SHIFT_IDEM_STR "idem"
00429 #define ccdLINE_SHIFT_LIST_STR "list"
00430 
00431 /*
00432  * Centroiding type (see setup param. ccdIP_CENTROID)
00433  */
00434 typedef enum
00435     {
00436     ccdCENTROID_NONE = 0,
00437     ccdCENTROID_STANDARD,
00438     ccdCENTROID_THRESHOLD
00439     } ccdCENTYPE;
00440 
00441 #define ccdCEN_NONE_STR      "none"       /* no centroiding calculation      */
00442 #define ccdCEN_STANDARD_STR  "standard"   /* standard centroiding calc.      */
00443 #define ccdCEN_THRESHOLD_STR "threshold"  /* standard centroiding calc.      */
00444 
00445     /* 
00446      * Maximum Threshold :
00447      * ===================
00448      * - Ignored in the current implementation
00449      */
00450 
00451     /* 
00452      * Minimum Threshold :
00453      * ===================
00454      * => value >= 0 : use this value
00455      * => value within the integer range [-1;-9] : 
00456      *    the threshold min is preset to N StdDev of Intensity distribution 
00457      *    over this window
00458      * => value within the integer range [-11;-19] : 
00459      *    the threshold min is preset to N StdDev of Intensity distribution 
00460      *    over the first window
00461      *    This setting is only valid for the second window
00462      */
00463     /* The following macros are standard settings */
00464 #define ccdTHRMIN_3SIGMA_WINDOW_SELF  -3
00465 #define ccdTHRMIN_3SIGMA_WINDOW_PREV -13
00466 #define ccdTHRMIN_5SIGMA_WINDOW_SELF  -5
00467 #define ccdTHRMIN_5SIGMA_WINDOW_PREV -15
00468 
00469     /* 
00470      * BackGround :
00471      * ============
00472      * => value within the >= 0 : use this value
00473      * => value set to -1 : 
00474      *    the BackGround is preset to the Average Intensity 
00475      *    over this window
00476      * => value set to -11 : 
00477      *    the BackGround is preset to the Average Intensity 
00478      *    over the first window
00479      *   This setting is only valid for the second window
00480      */
00481     /* The following macros are standard settings */
00482 #define ccdBCKGND_FLUX_WINDOW_SELF    -1
00483 #define ccdBCKGND_FLUX_WINDOW_PREV   -11
00484 
00485 /* real-time image processing user function definitions */
00486 #define ccdIP_NO_USER_FUN   "None"        /* no user function to be called   */
00487 #define ccdIP_NO_USER_BUF   "None"        /* user function has no buffer     */
00488 
00489 /*
00490  * IMAGE PROCESSING DATA STRUCTURES
00491  * --------------------------------
00492  * The coordinates are, unless specified, absolute to the lower left corner
00493  * of the detector. This pixel has the coordinates (1,1).
00494  */
00495 typedef struct 
00496     {            
00497     /*
00498      * The exposure structure provides general information on the
00499      * exposure.
00500      */
00501     ccdEXPTYPE   expType;
00502     vltINT32     stepsDef;            /* number of steps (MULTI)             */
00503     ccsTIMEVAL   wipeStart;           /* actual wipe start time (UTC)        */
00504     vltDOUBLE    wipeTime;            /* actual wipe duration                */
00505     ccsTIMEVAL   expStart;            /* actual integration start time (UTC) */
00506     vltDOUBLE    expTime;             /* Effective exposure time             */
00507     vltDOUBLE    expTimeMulti[ccdMAXINTEGR];
00508     vltINT32     shiftLine[ccdMAXINTEGR];
00509     ccsTIMEVAL   shiftStart[ccdMAXINTEGR]; /* Line shift start time (UTC)    */
00510     vltDOUBLE    shiftTime;           /* Effective line shift time           */
00511     ccsTIMEVAL   readStart;           /* actual readout start time (UTC)     */
00512     vltDOUBLE    readTime;            /* actual readout duration             */
00513     ccsTIMEVAL   procStart;           /* actual image proc. start time (UTC) */
00514     } ccdIPEXPOSURE;
00515 
00516 /* data types */
00517 typedef enum
00518     {
00519     ccdIMAGE_CHAR = 0,               /* 8 bit unsigned                     */  
00520     ccdIMAGE_INT,                    /* 16 bit signed                      */
00521     ccdIMAGE_FLOAT                   /* 32 bit floating point              */
00522     } ccdIMAGE_REP;
00523 
00524 typedef struct 
00525     {            
00526     /*
00527      * The window structure describes the current window passed to the
00528      * IP function. Besides the information on the window position on
00529      * the detector and its dimensions, available are also the window
00530      * index (starting from 0 as first window defined), the pixel 
00531      * representation (integer 8 or 16 bits, or 32-bit floating point)
00532      * which is required for proper casting of the data pointer.
00533      */
00534     vltINT32     winNum;              /* Window index                        */
00535     ccdIMAGE_REP pixelRep;            /* Pixel value representation          */
00536     vltINT32     xPos,yPos;           /* Location of lower left corner       */
00537     vltINT32     xDim,yDim;           /* Window dimension                    */
00538     void        *data;                /* Pointer to image data               */
00539     } ccdIPWINDOW;
00540 
00541 typedef struct 
00542     {            
00543     /*
00544      * The setup structure contains the setup parameters used by the 
00545      * image processing functions.
00546      */
00547     vltINT32     llx,lly;             /* Offset to Lower Left  corner        */
00548     vltINT32     urx,ury;             /* Offset to Upper Right corner        */
00549     vltDOUBLE    xRef,yRef;           /* Reference point                     */
00550     vltDOUBLE    minThr,maxThr;       /* Thresholds                          */
00551     vltDOUBLE    bckGnd;              /* Estimation of Sky Back Ground       */
00552     } ccdIPSETUP;
00553 
00554 typedef struct 
00555     {  
00556     /*
00557      * The result structure is filled in according to the setup
00558      * The first part (STATISTICS) is automatically updated 
00559      * whenever the centroid calculation or a user-function is
00560      * invoked. 
00561      * Since the two advanced image processing functions 
00562      * ccdipAG(3) and ccdipIQE(3) have the same interface (ccdIPUSERFUNC),
00563      * it is possible to design a more complex function complying the
00564      * interface and invoking these functions in the processing sequence.
00565      * However, the designer has to considere the computation times which
00566      * are involved (for 20x20 window) :
00567      *       ccdipAG  : <20ms
00568      *       ccdipIQE : 800ms
00569      */
00570   /* STATISTICS : ccdipStatistic() */
00571     vltDOUBLE    max;                 /* First Maximum Intensity             */
00572     vltDOUBLE    xMax,yMax;           /* Location                            */
00573     vltDOUBLE    min;                 /* First Minimum Intensity             */
00574     vltDOUBLE    xMin,yMin;           /* Location                            */
00575     vltDOUBLE    flux;                /* Raw Average ADC counts / pixel      */
00576     vltDOUBLE    sigma;               /* Standard-Deviation on the flux      */
00577     vltINT32     numSpot;             /* Number of spots in image            */
00578     vltINT32     numPix;              /* Number of valid pixels in image     */
00579   /* CENTROID : ccdipCentroid() or ccdipAG() or ccdipWCE() */
00580     vltDOUBLE    cen;                 /* Centroid Intensity (closest pixel)  */
00581     vltDOUBLE    xCen,yCen;           /* Location                            */
00582     vltDOUBLE    xErr,yErr;           /* Error vector (relative to Ref Point)*/
00583     vltDOUBLE    SNR;                 /* Signal-to-Noise Ratio               */
00584     vltDOUBLE    xFWHM,yFWHM;         /* FWHM estimation                     */
00585   /* ANALYSIS : ccdipIQE() */
00586     vltDOUBLE    xFWHM_SD,yFWHM_SD;   /* FWHM Std Dev                        */
00587     vltDOUBLE    ObjAngle,ObjAngle_SD;/* Object position angle  + Std Dev    */
00588   /* BACKGROUND : ccdipBackground() */
00589     vltDOUBLE    BckGnd,BckGnd_SD;    /* Back Ground estimation + Std Dev    */
00590     } ccdIPRESULT;
00591 
00592 typedef struct 
00593     {    
00594     ccdIPEXPOSURE exposure;
00595     ccdIPWINDOW   window;
00596     ccdIPSETUP    setup[ccdMAXWINDOW];
00597     ccdIPRESULT   result[ccdMAXWINDOW];
00598     } ccdIPIMAGE;
00599 
00600 /* Function prototype for LCU real-time image processing user function */
00601 typedef ccsCOMPL_STAT (* ccdIPUSERFUNC)(ccdIPIMAGE *,void *,ccsERROR *);
00602 
00603 /* info about chip configuration */
00604 typedef struct 
00605     {                     
00606     vltLOGICAL available;            /* available                          */
00607     vltINT32   xLocation;            /* x location in mosaic               */
00608     vltINT32   yLocation;            /* y location in mosaic               */
00609     } ccdCONFCHIP;
00610 
00611 /* info about chip configuration */
00612 typedef struct 
00613     {
00614     vltLOGICAL available;            /* available                          */
00615     vltINT32   chipIndex;            /* index of chip it belongs to        */
00616     vltINT32   xLocation;            /* x location in mosaic               */
00617     vltINT32   yLocation;            /* y location in mosaic               */
00618     vltINT32   leftToRight;          /* horizontal readout direction       */
00619     vltINT32   downToUp;             /* vertical readout direction         */
00620     vltINT32   xPrescan;             /* prescan pixels along x             */
00621     vltINT32   yPrescan;             /* prescan pixels along y             */
00622     vltINT32   xPix;                 /* active pixels along x              */
00623     vltINT32   yPix;                 /* active pixels along y              */
00624     vltINT32   xOverscan;            /* overscan pixels along x            */
00625     vltINT32   yOverscan;            /* overscan pixels along y            */
00626     } ccdCONFOUTPUT;
00627 
00628 /* info about clock pattern */
00629 typedef struct 
00630     {                     
00631     vltBYTES16 description;          /* description of clock pattern used  */
00632     vltINT32   firstOutput;          /* output generating first pixel value*/
00633     vltINT32   gainIndex;            /* default gain index                 */
00634     vltINT32   nWindows;             /* maximum number of windows supported*/
00635     vltINT32   adcTime;              /* usec needed to digitize one pixel  */
00636     vltINT32   lineShiftMode;        /* supported line shift mode          */
00637     vltLOGICAL outEnab[ccdMAXOUTPUT];/* outputs enabled                    */
00638     vltDOUBLE  elAdu[ccdMAXOUTPUT];
00639     } ccdCONFCLOCK;
00640 
00641 /* info about camera shutter          */
00642 typedef struct 
00643     {
00644     vltLOGICAL available;            /* available                          */
00645     } ccdCONFSHUTTER;
00646 
00647 /* info about camera configuration    */
00648 typedef struct 
00649     {                     
00650     ccdCAMERANAME name;              /* camera name                        */
00651     ccsENVNAME    envName;           /* environment name                   */
00652     } ccdCAMERA;
00653 
00654 /* info about camera configuration  */
00655 typedef struct 
00656     {                       
00657     vltLOGICAL     frameTransfer;       /* frame transfer CCD               */
00658     vltLOGICAL     skipper;             /* skipper CCD                      */
00659     vltLOGICAL     mpp;                 /* mpp mode supported               */
00660     vltINT32       xPixels;             /* Number of columns                */
00661     vltINT32       yPixels;             /* Number of rows                   */
00662     vltINT32       bitsPixel;           /* ADC resolution                   */
00663     vltINT32       numOutputs;          /* Number of outputs                */
00664     ccdCONFCHIP    chip[ccdMAXCHIPS];   /* single chip description          */
00665     ccdCONFOUTPUT  output[ccdMAXOUTPUT];/* single output description        */
00666     ccdCONFCLOCK   clock[ccdMAXCLOCKS]; /* single clock pattern information */
00667     ccdCONFSHUTTER shutter;             /* shutter information              */
00668     } ccdCONFIG;
00669 
00670 /* window readout definition */
00671 typedef struct
00672     { 
00673     vltLOGICAL enabled;             /* this window is enabled for readout  */
00674     vltLOGICAL idem;                /* same binning as Window #1           */
00675     vltINT32   xBinning;            /* horizontal binning factor           */
00676     vltINT32   yBinning;            /* vertical binning factor             */
00677     vltINT32   xFirst;              /* first column                        */
00678     vltINT32   xDim;                /* number of columns                   */
00679     vltINT32   yFirst;              /* first row                           */
00680     vltINT32   yDim;                /* number of rows                      */
00681     } ccdWINDOW;
00682 
00683 /* window process definition */
00684 typedef struct
00685     { 
00686     vltLOGICAL   minMax;            /* do MinMax                         */
00687     vltLOGICAL   bias;              /* do Bias correction                */
00688     vltLOGICAL   dark;              /* do Dark correction                */
00689     vltLOGICAL   flat;              /* do Flat Field correction          */
00690     vltINT32     averageN;          /* do average over N frames          */
00691     vltINT32     centroiding;       /* do Centroid calculation (mode)    */
00692     vltDOUBLE    centrRefX;         /* Reference Point X                 */
00693     vltDOUBLE    centrRefY;         /* Reference Point Y                 */
00694     vltDOUBLE    centrThreshMin;    /* Centroid Threshold Min            */
00695     vltDOUBLE    centrThreshMax;    /* Centroid Threshold Max            */
00696     vltDOUBLE    backGround;        /* Sky BackGround                    */
00697     vltBYTES32   userFuncName;      /* User-Defined function name        */
00698     vltBYTES32   userBuffName;      /* User-Defined buffer address       */
00699     vltINT32     procLLX,procLLY;   /* Lower Left & Upper Right corners  */
00700     vltINT32     procURX,procURY;   /* of Processing window (offset from */
00701                               /* physical window)                  */
00702     } ccdPROCESS;
00703 
00704 /* exposure setup parameters */
00705 typedef struct 
00706     {                 
00707     ccdEXPTYPE   expType;        /* exposure type                           */
00708     vltINT32     stepsDef;       /* number of steps (MULTI)                 */
00709     vltINT32     repeatDef;      /* repetition number (0 is forever)        */
00710     vltINT32     wipeTime;       /* wipe wanted (>= 0) or not (<0)          */
00711     ccdFRMTYPE   frameType;      /* frame type                              */
00712     vltLOGICAL   timeDefIdem;    /* exposure time UITi as UIT1 ?            */
00713     vltDOUBLE    timeDef;        /* exposure time (step 1)                  */
00714     vltDOUBLE    timeDefMulti[ccdMAXINTEGR];
00715                                  /* exposure time (steps 2+ for MULTI)      */
00716     vltDOUBLE    timeRepeat;     /* sec between repeated exposures          */
00717     vltLOGICAL   fitsInfoCollect;/* Collect info for FITS header            */
00718     vltLOGICAL   tempExp;        /* Store tmp. periodically during exposure */
00719     vltINT32     tempSecs;       /* sec between temperature checks          */
00720     vltLOGICAL   teleExp;        /* Store tel. periodically during exposure */
00721     vltINT32     teleSecs;       /* sec between telemetry checks            */
00722   /* IT  : */
00723     ccdDISKSAVE  diskSave;             /* disk save method                  */
00724     vltBYTES64   fileNameUnComp;       /* uncompressed FITS file name       */
00725     vltBYTES64   fileNameComp;         /* compressed FITS file name         */
00726     vltINT32     pixRepr;              /* # bit for representation          */
00727     vltINT32     bitShift;             /* # bit shift for RTD               */
00728     vltINT32     compression;          /* compression type                  */
00729     vltINT32     sampling;             /* 1 image transferred out of N read */
00730     vltLOGICAL   itSync;               /* image transfer synchronous        */
00731   /* RTD : */
00732     vltINT32     frameId;              /* real-time display frame Id        */
00733   /* IP  : */
00734     ccdPROCESS   process[ccdMAXWINDOW];/* single window setup               */ 
00735   /* RDT : */ 
00736     vltINT32     linesToShiftType;     /* how lines shall be shifted        */
00737     vltINT32     linesToShift;         /* # lines to be shifted step 1      */ 
00738     vltINT32     linesToShiftMulti[ccdMAXINTEGR];
00739                                  /* # lines to be shifted steps 2+    */ 
00740     vltINT32     readPixelN;           /* # times the same pixel is read    */ 
00741     vltLOGICAL   mpp;                  /* MPP mode flag                     */
00742     vltINT32     clockIndex;           /* readout clock to use              */
00743     vltINT32     gainIndex;            /* readout gain index                */
00744     vltBYTES64   fileNameSimu;         /* simulated image (ccdSIM_LCU)      */
00745     ccdWINDOW    window[ccdMAXWINDOW]; /*  single window setup              */
00746     } ccdSETUP;
00747 
00748 /* results of setup check */
00749 typedef struct 
00750     {                     
00751     vltLOGICAL changed;              /* some setup values have been changed*/
00752     vltLOGICAL doTransfer;           /* Image transfer required            */
00753     vltLOGICAL doProcess;            /* Image processing required          */
00754     vltDOUBLE  readTime;             /* estimated readout time (sec)       */
00755     vltDOUBLE  wipeTime;             /* estimated wiping  time (sec)       */
00756     } ccdSETUPRES;
00757 
00758 /* 
00759  * Macros 
00760  */
00761 
00762 /*
00763  * function prototypes
00764  */
00765 /* Get information about a CCD camera configuration */
00766 ccsCOMPL_STAT ccdGetConf    ( ccdCAMERA *camera, ccdCONFIG *config,
00767             ccsERROR  *error);
00768 
00769 /* Check a complete exposure setup */
00770 ccsCOMPL_STAT ccdCheckSetup ( ccdCONFIG *config, ccdSETUP *setup,
00771                               ccdSETUPRES *results, ccsERROR *error);
00772 
00773 /* Check the setup for a windowed readout */
00774 ccsCOMPL_STAT ccdCheckSetupWindow ( ccdCONFIG *config, ccdSETUP *setup,
00775                                     ccdSETUPRES *results, ccsERROR *error); 
00776 
00777 /* Get information about a CCD camera configuration */
00778 void ccdGetCIName           ( ccdCAMERANAME camera, ccsPROCNAME procName );
00779 
00780 /* Extract index of DB point describing an exposure from the exposure ID     */
00781 vltINT32 ccdGetIndexFromId  ( vltINT32 expId );
00782 
00783 #ifdef __cplusplus
00784 }
00785 #endif
00786 
00787 #endif /* ! CCD_H */

Generated on Wed Dec 3 14:52:10 2003 for ATCS API by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001