- Timestamp:
- May 26, 2009, 1:59:32 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
- Property svn:mergeinfo changed
-
branches/cnb_branches/cnb_branch_20090301/ppSub
- Property svn:mergeinfo changed
-
branches/cnb_branches/cnb_branch_20090301/ppSub/src
- Property svn:ignore
-
old new 10 10 stamp-h1 11 11 ppSubKernel 12 ppSubErrorCodes.h 13 ppSubErrorCodes.c 14 ppSubVersionDefinitions.h
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090301/ppSub/src/ppSub.h
r23352 r24244 14 14 #define PP_SUB_H 15 15 16 #include <stdio.h> 16 17 #include <pslib.h> 17 18 #include <psmodules.h> 19 20 #include "ppSubErrorCodes.h" 18 21 19 22 /// @addtogroup ppSub … … 21 24 22 25 #define PPSUB_RECIPE "PPSUB" /// Name of the recipe to use 26 #define WCS_TOLERANCE 0.001 // Tolerance for WCS 27 28 // Output files, for activation/deactivation 29 typedef enum { 30 PPSUB_FILES_INPUT = 0x01, // Input files 31 PPSUB_FILES_CONV = 0x02, // Convolved files (output) 32 PPSUB_FILES_SUB = 0x04, // Subtracted files (output) 33 PPSUB_FILES_INV = 0x08, // Inverse subtracted files (output) 34 PPSUB_FILES_PSF = 0x10, // PSF files (output) 35 PPSUB_FILES_PHOT_SUB = 0x20, // Subtraction photometry files (output) 36 PPSUB_FILES_PHOT_INV = 0x40, // Inverse subtraction photometry files (output) 37 PPSUB_FILES_PHOT = 0x80, // General photometry files (internal) 38 PPSUB_FILES_ALL = 0xFF, // All files 39 } ppSubFiles; 40 41 /// Data for processing 42 typedef struct { 43 pmConfig *config; // Configuration 44 psErrorCode quality; // Quality code; 0 for no problem 45 bool photometry; // Perform photometry? 46 bool inverse; // Output inverse subtraction as well? 47 psString stamps; // Stamps file 48 pmPSF *psf; // Point Spread Function 49 psString statsName; // Name of statistics file 50 FILE *statsFile; // Statistics file 51 psMetadata *stats; // Statistics 52 } ppSubData; 53 54 /// Constructor 55 ppSubData *ppSubDataAlloc(pmConfig *config ///< Configuration 56 ); 23 57 24 58 /// Setup the arguments parsing 25 bool ppSubArgumentsSetup(int argc, char *argv[], ///< Command-line arguments 26 pmConfig *config ///< Configuration 27 ); 28 29 /// Parse the arguments 30 bool ppSubArgumentsParse(pmConfig *config ///< Configuration 59 bool ppSubArguments(int argc, char *argv[], ///< Command-line arguments 60 ppSubData *data ///< Processing data 31 61 ); 32 62 33 63 /// Parse the camera input 34 bool ppSubCamera(p mConfig *config ///< Configuration64 bool ppSubCamera(ppSubData *data ///< Processing data 35 65 ); 36 66 37 67 /// Loop over the FPA hierarchy 38 bool ppSubLoop(pmConfig *config ///< Configuration 39 ); 40 41 /// Perform PSF-matched image subtraction on the readout 42 bool ppSubReadout(pmConfig *config, ///< Configuration 43 psMetadata *stats, ///< Statistics, for output 44 const pmFPAview *view ///< View of readout to subtract 68 bool ppSubLoop(ppSubData *data ///< Processing data 45 69 ); 46 70 47 71 /// Generate (if needed) and set or update the masks for input and reference images 48 bool ppSubSetMasks(pmConfig *config, ///< Configuration 49 const pmFPAview *view ///< View of active readout 72 bool ppSubSetMasks(pmConfig *config ///< Configuration 50 73 ); 51 74 52 75 /// Generate the PSF-matching kernel and convolve the images as needed. Most of this function involves 53 76 /// looking up the parameters in the recipe and supplying them to the function pmSubtractionMatch() 54 bool ppSubMatchPSFs(pmConfig *config, ///< Configuration 55 const pmFPAview *view ///< View of active readout 77 bool ppSubMatchPSFs(ppSubData *data ///< Processing data 56 78 ); 57 79 58 80 /// Generate the output readout and pass the kernel info to the header 59 bool ppSubDefineOutput( pmConfig *config, ///< Configuration60 const pmFPAview *view ///< View of active readout81 bool ppSubDefineOutput(const char *name,///< Name of output to define 82 pmConfig *config ///< Configuration 61 83 ); 62 84 63 85 /// Photometry stage 1: measure the PSF from the minuend image 64 bool ppSubMakePSF(pmConfig *config, ///< Configuration 65 const pmFPAview *view ///< View of active readout 86 bool ppSubMakePSF(ppSubData *data ///< Processing data 66 87 ); 67 88 68 89 /// Perform the actual image subtraction, update output concepts 69 bool ppSubReadoutSubtract(pmConfig *config, ///< Configuration 70 const pmFPAview *view ///< View of active readout 90 bool ppSubReadoutSubtract(pmConfig *config ///< Configuration 71 91 ); 72 92 73 93 74 94 /// Photometry stage 2: find and measure sources on the subtracted image 75 bool ppSubReadoutPhotometry(pmConfig *config, ///< Configuration 76 psMetadata *stats, ///< Statistics, for output 77 const pmFPAview *view ///< View of active readout 78 ); 79 80 /// Renormalize, update headers and generate JPEGs 81 bool ppSubReadoutUpdate(pmConfig *config, ///< Configuration 82 psMetadata *stats, ///< Statistics for output, or NULL 83 const pmFPAview *view ///< View of active readout 95 bool ppSubReadoutPhotometry(const char *name, ///< Name of file to photometer 96 ppSubData *data ///< Processing data 84 97 ); 85 98 86 99 /// Higher-order background subtraction 87 bool ppSubBackground(pmConfig *config, ///< Configuration 88 const pmFPAview *view ///< View to readout 100 bool ppSubBackground(pmConfig *config ///< Configuration 89 101 ); 90 102 … … 96 108 void ppSubVersionPrint(void); 97 109 110 /// Mark the data quality as bad and prepare to suspend processing 111 void ppSubDataQuality(ppSubData *data, ///< Processing data 112 psErrorCode error,///< Error code 113 ppSubFiles files ///< Files to deactivate 114 ); 115 116 117 /// Activate or deactivate files 118 void ppSubFilesActivate(pmConfig *config, // Configuration 119 ppSubFiles files, // File to activate/deactivate 120 bool state // Activation state 121 ); 122 123 /// Generate a view suitable for a readout 124 /// 125 /// Assumes we're working with skycells 126 pmFPAview *ppSubViewReadout(void); 127 128 /// Iterate down the FPA hierarchy, opening files 129 bool ppSubFilesIterateDown(pmConfig *config, // Configuration 130 ppSubFiles files // Files to open 131 ); 132 133 /// Iterate up the FPA hierarchy, closing files 134 bool ppSubFilesIterateUp(pmConfig *config, // Configuration 135 ppSubFiles files // Files to open 136 ); 137 138 /// Collect statistics 139 bool ppSubReadoutStats(ppSubData *data // Processing data 140 ); 141 142 /// Generate JPEG images 143 bool ppSubReadoutJpeg(pmConfig *config // Configuration 144 ); 145 146 /// Generate inverse subtraction 147 bool ppSubReadoutInverse(pmConfig *config // Configuration 148 ); 149 98 150 99 151 // Copy every instance of a single keyword from one metadata to another
Note:
See TracChangeset
for help on using the changeset viewer.
