- Timestamp:
- Mar 17, 2009, 12:08:50 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk merged eligible /branches/eam_branches/eam_branch_20090303 23158-23228
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/cnb_branches/cnb_branch_20090301/ppStack
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/cnb_branches/cnb_branch_20090215/ppStack merged eligible /trunk/ppStack merged eligible /branches/cnb_branch_20090215/ppStack 21495-22685 /branches/eam_branches/eam_branch_20090303/ppStack 23158-23228
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/cnb_branches/cnb_branch_20090301/ppStack/src/ppStack.h
r21477 r23352 1 #ifndef PP _STACK_H2 #define PP _STACK_H1 #ifndef PPSTACK_H 2 #define PPSTACK_H 3 3 4 4 #define PPSTACK_RECIPE "PPSTACK" // Name of the recipe … … 10 10 // Mask values for inputs 11 11 typedef enum { 12 PPSTACK_MASK_MATCH = 0x01, // PSF-matching failed 13 PPSTACK_MASK_CHI2 = 0x02, // Chi^2 too deviant 14 PPSTACK_MASK_REJECT = 0x04, // Rejection failed 15 PPSTACK_MASK_BAD = 0x08, // Bad image (too many pixels rejected) 12 PPSTACK_MASK_CAL = 0x01, // Photometric calibration failed 13 PPSTACK_MASK_MATCH = 0x02, // PSF-matching failed 14 PPSTACK_MASK_CHI2 = 0x04, // Chi^2 too deviant 15 PPSTACK_MASK_REJECT = 0x08, // Rejection failed 16 PPSTACK_MASK_BAD = 0x10, // Bad image (too many pixels rejected) 16 17 PPSTACK_MASK_ALL = 0xff // All errors 17 18 } ppStackMask; 18 19 19 // Thread for stacking chunks 20 // 21 // Each input file contributes a readout, into which is read a chunk from that file 22 typedef struct { 23 psArray *readouts; // Input readouts to read and stack 24 bool read; // Has the scan been read? 25 bool busy; // Is the scan being processed? 26 int firstScan; // First row of the chunk to be read for this group 27 int lastScan; // Last row of the chunk to be read for this group 28 } ppStackThread; 20 // List of files 21 typedef enum { 22 PPSTACK_FILES_PREPARE, // Files for preparation 23 PPSTACK_FILES_CONVOLVE, // Files for convolution 24 PPSTACK_FILES_COMBINE, // Files for combination 25 PPSTACK_FILES_PHOT // Files for photometry 26 } ppStackFileList; 29 27 30 // Allocator31 ppStackThread *ppStackThreadAlloc(psArray *readouts // Inputs readouts to read and stack32 );33 34 // Data for threads35 typedef struct {36 psArray *threads; // Threads doing stacking37 int lastScan; // Last row that's been read38 psArray *imageFits; // FITS file pointers for images39 psArray *maskFits; // FITS file pointers for masks40 psArray *varianceFits; // FITS file pointers for variances41 } ppStackThreadData;42 43 // Set up thread data44 ppStackThreadData *ppStackThreadDataSetup(const psArray *cells, // Array of input cells45 const psArray *imageNames, // Names of images to read46 const psArray *maskNames, // Names of masks to read47 const psArray *varianceNames, // Names of variance maps to read48 const psArray *covariances, // Covariance matrices (already read)49 const pmConfig *config // Configuration50 );51 52 // Read chunk into the first available file thread53 ppStackThread *ppStackThreadRead(bool *status, // Status of read54 ppStackThreadData *stack, // Stacks available for reading55 pmConfig *config, // Configuration56 int numChunk, // Chunk number (only for interest)57 int overlap // Overlap between subsequent scans58 );59 60 // Initialise the threads61 void ppStackThreadInit(void);62 28 63 29 // Setup command-line arguments … … 74 40 ); 75 41 76 // Loop over the inputs, doing the combination77 bool ppStackLoop(pmConfig *config // Configuration78 );79 80 42 // Determine target PSF for input images 81 43 pmPSF *ppStackPSF(const pmConfig *config, // Configuration 82 44 int numCols, int numRows, // Size of image 83 const psArray *psfs // List of input PSFs 45 const psArray *psfs, // List of input PSFs 46 const psVector *inputMask // Mask for inputs 84 47 ); 85 48 … … 125 88 ); 126 89 127 // Perform photometry on stack128 bool ppStackPhotometry(pmConfig *config, // Configuration129 const pmReadout *readout, // Readout to be photometered130 const pmFPAview *view // View to readout131 );132 133 90 // Return software version 134 91 psString ppStackVersion(void); 92 93 /// Return software source 94 psString ppStackSource(void); 135 95 136 96 // Return long description of software version 137 97 psString ppStackVersionLong(void); 138 98 139 // Supplement metadatawith software version140 void ppStackVersionMetadata(psMetadata *metadata // Metadatato supplement99 // Supplement header with software version 100 bool ppStackVersionHeader(psMetadata *header // Header to supplement 141 101 ); 102 103 /// Print version information 104 void ppStackVersionPrint(void); 142 105 143 106 /// Convolve image to match specified seeing … … 158 121 /// Corrects the source PSF photometry to a common system. Return the sum of the exposure times. 159 122 float ppStackSourcesTransparency(const psArray *sourceLists, // Sources for each input 123 psVector *inputMask, // Indicates bad input 160 124 const pmFPAview *view, // View to readout 161 125 const pmConfig *config // Configuration 162 126 ); 163 127 128 /// Dump memory debugging information 129 void ppStackMemDump( 130 const char *name ///< Stage name, for inclusion in the output file name 131 ); 132 133 /// Activate/deactivate a list of files 134 void ppStackFileActivation( 135 pmConfig *config, // Configuration 136 ppStackFileList list, // Files to turn on/off 137 bool state // Activation state 138 ); 139 140 // Activate/deactivate a single element for a list 141 void ppStackFileActivationSingle( 142 pmConfig *config, // Configuration 143 ppStackFileList list, // Files to turn on/off 144 bool state, // Activation state 145 int num // Number of file in sequence 146 ); 147 148 /// Iterate down the hierarchy, loading files 149 /// 150 /// We can get away with this simplistic treatment of the FPA hierarchy because we're working on skycells. 151 pmFPAview *ppStackFilesIterateDown( 152 pmConfig *config // Configuration 153 ); 154 155 /// Iterate up the hierarchy, writing files 156 /// 157 /// We can get away with this simplistic treatment of the FPA hierarchy because we're working on skycells. 158 bool ppStackFilesIterateUp( 159 pmConfig *config // Configuration 160 ); 161 162 /// Write an image to a FITS file 163 bool ppStackWriteImage( 164 const char *name, // Name of image 165 psMetadata *header, // Header 166 const psImage *image, // Image 167 pmConfig *config // Configuration 168 ); 169 170 164 171 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
