Changeset 5976 for trunk/ppImage/src/ppImage.h
- Timestamp:
- Jan 13, 2006, 5:14:07 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ppImage/src/ppImage.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImage.h
r5860 r5976 1 #ifndef PP_IMAGE_H 2 #define PP_IMAGE_H 3 1 4 #include <stdio.h> 2 5 #include <strings.h> … … 22 25 23 26 #define RECIPE "PHASE2" // Name of the recipe to use 27 #define TIMERNAME "ppImage" // Name of timer 24 28 29 // How much of the FPA to load at a time 25 30 typedef enum { 26 PP_LOAD_NONE, 27 PP_LOAD_FPA, 28 PP_LOAD_CHIP, 29 PP_LOAD_CELL, 31 PP_LOAD_NONE, // Don't load anything 32 PP_LOAD_FPA, // Load the entire FPA at once 33 PP_LOAD_CHIP, // Load by chip 34 PP_LOAD_CELL, // Load by cell 30 35 } ppImageLoadDepth; 31 36 37 // Configuration data 32 38 typedef struct { 33 psMetadata *site; 34 psMetadata *camera; 35 psMetadata *recipe; 36 psMetadata *arguments; 37 psDB *database; 39 psMetadata *site; // The site configuration 40 psMetadata *camera; // The camera configuration 41 psMetadata *recipe; // The recipe (i.e., specific setups) 42 psMetadata *arguments; // The command-line arguments 43 psDB *database; // Database handle 38 44 } ppConfig; 39 45 46 // Options 40 47 typedef struct { 41 bool doMask; // Mask bad pixles42 bool doBias; // Bias subtraction43 bool doDark; // Dark subtraction44 bool doFlat; // Flat-field normalisation45 bool doFringe; // Fringe subtraction46 bool doSource; // Source identification and photometry47 bool doAstrom; // Astrometry48 bool doMask; // Mask bad pixels 49 bool doBias; // Bias subtraction 50 bool doDark; // Dark subtraction 51 bool doFlat; // Flat-field normalisation 52 bool doFringe; // Fringe subtraction 53 bool doSource; // Source identification and photometry 54 bool doAstrom; // Astrometry 48 55 49 bool doOverscan; // Overscan subtraction50 int overscanBins; // Number of pixels per bin for overscan51 psStats *overscanStats; // Statistics for overscan52 void *overscanFit; // Overscan fit (polynomial or spline)53 pmFit overscanFitType; // Fit type for overscan54 pmOverscanAxis overscanMode; // Axis for overscan56 bool doOverscan; // Overscan subtraction 57 int overscanBins; // Number of pixels per bin for overscan 58 psStats *overscanStats; // Statistics for overscan 59 void *overscanFit; // Overscan fit (polynomial or spline) 60 pmFit overscanFitType; // Fit type for overscan 61 pmOverscanAxis overscanMode; // Axis for overscan 55 62 56 bool doNonLin; // Non-linearity correction63 bool doNonLin; // Non-linearity correction 57 64 psDataType nonLinearType; 58 65 psMetadataItem *nonLinearData; 59 66 void *nonLinearSource; 60 67 61 ppImageLoadDepth imageLoadDepth; 68 ppImageLoadDepth imageLoadDepth; // How much of the FPA to load at once 62 69 } ppOptions; 63 70 71 // A file to process 64 72 typedef struct { 65 char *filename; 66 p mFPA *fpa;67 ps Fits *fits;68 p sMetadata *header;69 } ppF PA;73 char *filename; // File name 74 psFits *fits; // The FITS file handle 75 psMetadata *phu; // The FITS header 76 pmFPA *fpa; // The FPA, with pixels and extensions 77 } ppFile; 70 78 79 // The data to be processed 71 80 typedef struct { 72 ppFPA *input; 73 ppFPA *mask; 74 ppFPA *bias; 75 ppFPA *dark; 76 ppFPA *flat; 77 ppFPA *fringe; 78 ppFPA *process; 81 ppFile *input; // The input, to be operated upon 82 ppFile *mask; // The bad pixel mask image 83 ppFile *bias; // The bias correction image 84 ppFile *dark; // The dark correction image 85 ppFile *flat; // The flat-field correction image 86 ppFile *fringe; // The fringe correction image 87 #if 0 88 ppFile *process; // A dummy file pointing out what needs to be processed 89 #endif 79 90 } ppData; 80 91 92 // Cells to be used in the detrend 81 93 typedef struct { 82 pmCell *input; 83 pmCell *mask; 84 pmCell *bias; 85 pmCell *dark; 86 pmCell *flat; 94 pmCell *input; // The input cell, to be operated upon 95 pmCell *mask; // The bad pixel mask 96 pmCell *bias; // The bias correction 97 pmCell *dark; // The dark correction 98 pmCell *flat; // The flat-field correction 87 99 } ppDetrend; 88 100 89 bool ppImageConfig (ppConfig *config, int argc, char **argv);90 bool ppImageLoadPixels (ppFPA *input, ppFPA *process, psDB *db, int nChip, int nCell);91 bool ppImageLoop (ppData *data, ppOptions *options, ppConfig *config);92 bool ppImageOptions (ppData *data, ppOptions *options, ppConfig *config);93 bool ppImageParseCamera (ppData *data, ppConfig *config);94 bool ppImageParseDetrend (ppData *data, ppOptions *options, ppConfig *config);95 101 96 bool ppReadoutWeights (pmReadout *readout); 102 // Allocators 103 ppFile *ppFileAlloc(void); 97 104 98 bool ppDetrendCell (ppDetrend *detrend, ppOptions *options, ppConfig *config);99 105 100 bool ppDetrendMask (pmCell *cell, pmReadout *input, pmReadout *mask);101 bool ppDetrendNonLinear (pmCell *cell, pmReadout *input, ppOptions *options);102 bool ppDetrendNonLinearLookup (pmReadout *input, psMetadataItem *dataItem);103 bool ppDetrendNonLinearPolynomial (pmReadout *input, psMetadataItem *dataItem);104 bool ppDetrendBias (pmCell *inputCell, pmReadout *inputReadout, pmReadout *pedestal, ppOptions *options);105 pmReadout* ppDetrendPedestal (pmReadout *pedestal, pmCell *input, pmReadout *bias, pmReadout *dark, float darkTime, ppOptions *options);106 pmReadout* ppDetrendSelectFirst (pmCell *cell, char *name, bool doThis);107 106 108 bool ppFPAOpen (ppFPA *fpa, psMetadata *camera, char *name, bool doThis); 107 // Parse the site configuration (and camera and recipe if specified); read the command-line arguments 108 bool ppImageConfig(ppConfig *config, // The configuration(output) 109 int argc, char **argv // Command-line arguments 110 ); 111 112 // Determine what type of camera, and initialise 113 bool ppImageParseCamera(ppData *data, // The data to be processed 114 ppConfig *config // Configuration 115 ); 116 117 // Determine the procession options 118 bool ppImageOptions(ppData *data, // The data to be processed 119 ppOptions *options, // Processing options 120 ppConfig *config // Configuration 121 ); 122 123 124 // Loop over the 125 bool ppImageLoop(ppData *data, ppOptions *options, ppConfig *config); 126 127 // Load the pixels for the given file 128 bool ppImageLoadPixels(ppFile *input, // File for which to load the pixels 129 psDB *db, // Database handle (for reading concepts) 130 int nChip, // Chip number to load 131 int nCell // Cell number to load 132 ); 133 134 bool ppImageParseDetrend(ppData *data, ppOptions *options, ppConfig *config); 135 136 bool ppReadoutWeights(pmReadout *readout); 137 138 bool ppDetrendCell(ppDetrend *detrend, ppOptions *options, ppConfig *config); 139 140 bool ppDetrendMask(pmCell *cell, pmReadout *input, pmReadout *mask); 141 bool ppDetrendNonLinear(pmCell *cell, pmReadout *input, ppOptions *options); 142 bool ppDetrendNonLinearLookup(pmReadout *input, psMetadataItem *dataItem); 143 bool ppDetrendNonLinearPolynomial(pmReadout *input, psMetadataItem *dataItem); 144 bool ppDetrendBias(pmCell *inputCell, pmReadout *inputReadout, pmReadout *pedestal, ppOptions *options); 145 pmReadout* ppDetrendPedestal(pmReadout *pedestal, pmCell *input, pmReadout *bias, pmReadout *dark, float darkTime, ppOptions *options); 146 pmReadout* ppDetrendSelectFirst(pmCell *cell, char *name, bool doThis); 147 148 #if 0 149 bool ppFileOpen(ppFile *fpa, psMetadata *camera, char *name, bool doThis); 150 #endif 151 152 153 #endif // Pau.
Note:
See TracChangeset
for help on using the changeset viewer.
