Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

pmDetrendDB.h

Go to the documentation of this file.
00001 /** @file  pmDetrendDB.h
00002 *
00003 *  @brief Tools to query the detrend database system
00004 *
00005 *  the functions in here do not perform the detrend database queries directly.  all interfaces
00006 *  to the detrend database go through the external dettools functions.  this allows the modules
00007 *  and directly dependent program to be sufficiently independent of the database schema that it
00008 *  can be used with any properly defined detrend database tables.  
00009 *
00010 *  XXX place the specific name of the detrend database query command in the configuration data
00011 *
00012 *  @ingroup Detrend
00013 *
00014 *  @author EAM, IfA
00015 *
00016 *  @version $Revision: 1.2 $ $Name: rel12 $
00017 *  @date $Date: 2006/07/01 00:00:11 $
00018 *
00019 *  Copyright 2004-2005 Institute for Astronomy, University of Hawaii
00020 */
00021 
00022 #ifndef PM_DETREND_DB_H
00023 #define PM_DETREND_DB_H
00024 
00025 typedef enum {
00026     PM_DETREND_TYPE_MASK,
00027     PM_DETREND_TYPE_BIAS,
00028     PM_DETREND_TYPE_DARK,
00029     PM_DETREND_TYPE_FLAT,
00030     PM_DETREND_TYPE_FLAT_CORRECTION,
00031     PM_DETREND_TYPE_FRINGE_IMAGE,
00032     PM_DETREND_TYPE_FRINGE_TABLE,
00033     PM_DETREND_TYPE_BACKGROUND,
00034 } pmDetrendType;
00035 
00036 typedef struct
00037 {
00038     char *camera;   // name of camera
00039     psTime time;   // time of input data
00040     pmDetrendType type;   // type of detrend data
00041     char *filter;   // name of filter
00042     float exptime;   // exposure time (for dark, maybe flat & fringe)
00043     float airmass;   // for fringe
00044 }
00045 pmDetrendSelectOptions;
00046 
00047 typedef struct
00048 {
00049     char *detID;   // identifier of detrend image
00050     pmFPALevel level;   // level in FPA hierarchy of individual file
00051 }
00052 pmDetrendSelectResults;
00053 
00054 typedef struct
00055 {
00056     char *detID;   // identifier of detrend image
00057     char *classID;   // level in FPA hierarchy of individual file
00058 }
00059 pmDetrendFileOptions;
00060 
00061 psString pmDetrendTypeToString (pmDetrendType type);
00062 
00063 pmDetrendSelectOptions *pmDetrendSelectOptionsAlloc(char *camera, psTime time, pmDetrendType type);
00064 pmDetrendSelectResults *pmDetrendSelectResultsAlloc();
00065 pmDetrendSelectResults *pmDetrendSelect (pmDetrendSelectOptions *options);
00066 char *pmDetrendFile (char *detID, char *classID);
00067 
00068 // move these to pslib??
00069 typedef struct
00070 {
00071     int stdin;
00072     int stdout;
00073     int stderr;
00074 }
00075 psPipe;
00076 
00077 typedef struct
00078 {
00079     char *data;
00080     int nAlloc;    // current size of allocated buffer
00081     int nReset;    // size to set buffer after flush
00082     int nBlock;    // number of bytes to try to read at a time
00083     int n;    // current size of filled data
00084 }
00085 psIOBuffer;
00086 
00087 // psIOBuffer functions
00088 psIOBuffer *psIOBufferAlloc (int nBuffer);
00089 bool psIOBufferFlush (psIOBuffer *buffer);
00090 int psIOBufferRead (psIOBuffer *buffer, int fd);
00091 int psIOBufferReadEmpty (psIOBuffer *buffer, int maxRetries, int fd);
00092 
00093 // psPipe functions
00094 psPipe *psPipeAlloc ();
00095 psPipe *psPipeOpen (char *command);
00096 bool psPipeClose (psPipe *pipe);
00097 
00098 # endif

Generated on Mon Jul 3 14:24:27 2006 for Pan-STARRS Module Library by  doxygen 1.4.4