Changeset 23166
- Timestamp:
- Mar 3, 2009, 5:27:43 PM (17 years ago)
- Location:
- trunk/ppMerge/src
- Files:
-
- 4 edited
-
ppMerge.h (modified) (12 diffs)
-
ppMergeLoop_Threaded.c (modified) (2 diffs)
-
ppMergeMask.c (modified) (4 diffs)
-
ppMergeVersion.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppMerge/src/ppMerge.h
r21244 r23166 28 28 /// @{ 29 29 30 #define TIMERNAME "ppMerge" ///< Name for timer 31 #define PPMERGE_RECIPE "PPMERGE" ///< Recipe name 32 #define THREADED 1 ///< Compile with threads? 30 #define TIMERNAME "ppMerge" ///< Name for timer 31 #define PPMERGE_RECIPE "PPMERGE" ///< Recipe name 32 #define THREADED 1 ///< Compile with threads? 33 33 34 34 /** … … 36 36 */ 37 37 typedef enum { 38 PPMERGE_TYPE_UNKNOWN, ///< Unknown type 39 PPMERGE_TYPE_BIAS, ///< Bias frame 40 PPMERGE_TYPE_DARK, ///< (Multi-)Dark frame 41 PPMERGE_TYPE_MASK, ///< Mask frame 42 PPMERGE_TYPE_SHUTTER, ///< Shutter frame 38 PPMERGE_TYPE_UNKNOWN, ///< Unknown type 39 PPMERGE_TYPE_BIAS, ///< Bias frame 40 PPMERGE_TYPE_DARK, ///< (Multi-)Dark frame 41 PPMERGE_TYPE_MASK, ///< Mask frame 42 PPMERGE_TYPE_SHUTTER, ///< Shutter frame 43 43 PPMERGE_TYPE_FLAT, ///< Flat-field frame (dome or sky) 44 PPMERGE_TYPE_FRINGE, ///< Fringe frame 44 PPMERGE_TYPE_FRINGE, ///< Fringe frame 45 45 } ppMergeType; 46 46 … … 49 49 */ 50 50 typedef enum { 51 PPMERGE_FILES_ALL, ///< All files 52 PPMERGE_FILES_INPUT, ///< Input files 53 PPMERGE_FILES_OUTPUT ///< Output files 51 PPMERGE_FILES_ALL, ///< All files 52 PPMERGE_FILES_INPUT, ///< Input files 53 PPMERGE_FILES_OUTPUT ///< Output files 54 54 } ppMergeFiles; 55 55 … … 60 60 */ 61 61 typedef struct { 62 psArray *readouts; ///< Input readouts 63 bool read; ///< Has the scan been read? 64 bool busy; ///< Is the scan being processed? 65 int firstScan; ///< First row of the chunk to be read for this group 66 int lastScan; ///< Last row of the chunk to be read for this group 62 psArray *readouts; ///< Input readouts 63 bool read; ///< Has the scan been read? 64 bool busy; ///< Is the scan being processed? 65 int firstScan; ///< First row of the chunk to be read for this group 66 int lastScan; ///< Last row of the chunk to be read for this group 67 67 } ppMergeFileGroup; 68 68 … … 71 71 */ 72 72 bool ppMergeArguments(int argc, char *argv[], ///< Command-line arguments 73 pmConfig *config ///< Configuration 73 pmConfig *config ///< Configuration 74 74 ); 75 75 … … 77 77 * Set up camera files 78 78 */ 79 bool ppMergeCamera(pmConfig *config ///< Configuration 79 bool ppMergeCamera(pmConfig *config ///< Configuration 80 80 ); 81 81 … … 83 83 * Measure scale and zero-points 84 84 */ 85 bool ppMergeScaleZero(pmConfig *config ///< Configuration 85 bool ppMergeScaleZero(pmConfig *config ///< Configuration 86 86 ); 87 87 … … 89 89 * Main loop to do the merging 90 90 */ 91 bool ppMergeLoop(pmConfig *config ///< Configuration 91 bool ppMergeLoop(pmConfig *config ///< Configuration 92 92 ); 93 93 … … 95 95 * Main loop for masks 96 96 */ 97 bool ppMergeMask(pmConfig *config ///< Configuration 97 bool ppMergeMask(pmConfig *config ///< Configuration 98 98 ); 99 99 … … 101 101 * Read nominated input file 102 102 */ 103 bool ppMergeFileReadInput(pmConfig *config, ///< Configuration 104 pmReadout *readout, ///< Readout into which to read 105 int num, ///< Number of file in sequence 106 int rows ///< Number of rows to read at once 103 bool ppMergeFileReadInput(pmConfig *config, ///< Configuration 104 pmReadout *readout, ///< Readout into which to read 105 int num, ///< Number of file in sequence 106 int rows ///< Number of rows to read at once 107 107 ); 108 108 … … 110 110 * Open nominated input file 111 111 */ 112 bool ppMergeFileOpenInput(pmConfig *config, ///< Configuration 113 const pmFPAview *view, ///< View to open 114 int num ///< Number of file in sequence 112 bool ppMergeFileOpenInput(pmConfig *config, ///< Configuration 113 const pmFPAview *view, ///< View to open 114 int num ///< Number of file in sequence 115 115 ); 116 116 … … 166 166 bool ppMergeSetThreads(void); 167 167 168 169 /// Return software version 170 psString ppMergeVersion(void); 171 172 /// Return software source 173 psString ppMergeSource(void); 174 175 /// Return detailed software version information 176 psString ppMergeVersionLong(void); 177 178 /// Populate a FITS header with version information 179 bool ppMergeVersionHeader( 180 psMetadata *header ///< Header to populate 181 ); 182 168 183 ///@} 169 184 #endif -
trunk/ppMerge/src/ppMergeLoop_Threaded.c
r21365 r23166 137 137 assert(output && output->fpa); 138 138 pmFPA *outFPA = output->fpa; ///< Output FPA 139 pmHDU *lastHDU = NULL; // Last HDU that was updated 139 140 int cellNum = 0; ///< Index of cell 140 141 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { … … 156 157 // No data here 157 158 continue; 159 } 160 161 // Update the header 162 { 163 pmHDU *hdu = pmHDUGetHighest(outFPA, outChip, outCell); // HDU for file 164 if (hdu && hdu != lastHDU) { 165 ppMergeVersionHeader(hdu->header); 166 lastHDU = hdu; 167 } 158 168 } 159 169 -
trunk/ppMerge/src/ppMergeMask.c
r21365 r23166 16 16 const pmFPAview *view, ///< View to chip 17 17 bool writeOut, ///< Write output? 18 pmHDU **lastHDU, ///< HDU last updated 18 19 psRandom *rng, ///< Random number generator 19 20 psMetadata *stats ///< Statistics output … … 96 97 i, inView->chip, inView->cell); 97 98 99 // Update the header 100 { 101 pmHDU *hdu = pmHDUGetHighest(outCell->parent->parent, outCell->parent, outCell); // File HDU 102 if (hdu && hdu != *lastHDU) { 103 ppMergeVersionHeader(hdu->header); 104 *lastHDU = hdu; 105 } 106 } 107 98 108 if (!pmFPAfileIOChecks(config, inView, PM_FPA_BEFORE)) { 99 109 psFree(inView); … … 395 405 assert(output && output->fpa); 396 406 pmFPA *outFPA = output->fpa; ///< Output FPA 407 pmHDU *lastHDU = NULL; // Last HDU updated 397 408 398 409 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { … … 409 420 410 421 for (int i = 0; i < iter; i++) { 411 if (!mergeMask(config, view, (i == iter - 1), rng, stats)) {422 if (!mergeMask(config, view, (i == iter - 1), &lastHDU, rng, stats)) { 412 423 psError(PS_ERR_UNKNOWN, false, "Unable to merge chip %d", view->chip); 413 424 goto PPMERGE_MASK_ERROR; -
trunk/ppMerge/src/ppMergeVersion.c
r23126 r23166 59 59 }; 60 60 61 void ppMergeVersionMetadata(psMetadata *metadata)61 bool ppMergeVersionHeader(psMetadata *header) 62 62 { 63 PS_ASSERT_METADATA_NON_NULL( metadata,);63 PS_ASSERT_METADATA_NON_NULL(header, false); 64 64 65 psString pslib = psLibVersionLong();///< psLib version 66 psString psmodules = psModulesVersionLong(); ///< psModules version 67 psString ppStats = ppStatsVersionLong(); ///< ppStats version 68 psString ppMerge = ppMergeVersionLong(); ///< ppMerge version 65 psTime *time = psTimeGetNow(PS_TIME_TAI); // The time now 66 psString timeString = psTimeToISO(time); // The time in an ISO string 67 psFree(time); 68 psString history = NULL; // History string 69 psStringAppend(&history, "ppMerge at %s", timeString); 70 psFree(timeString); 71 psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, history); 72 psFree(history); 69 73 70 psTime *time = psTimeGetNow(PS_TIME_TAI); ///< The time now 71 psString timeString = psTimeToISO(time); ///< The time in an ISO string 72 psFree(time); 73 psString head = NULL; ///< Head string 74 psStringAppend(&head, "ppMerge processing at %s. Component information:", timeString); 75 psFree(timeString); 74 psLibVersionHeader(header); 75 psModulesVersionHeader(header); 76 ppStatsVersionHeader(header); 76 77 77 psMetadataAddStr(metadata, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, head, ""); 78 psMetadataAddStr(metadata, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, pslib, ""); 79 psMetadataAddStr(metadata, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, psmodules, ""); 80 psMetadataAddStr(metadata, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, ppStats, ""); 81 psMetadataAddStr(metadata, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, ppMerge, ""); 78 psString version = ppMergeVersion(); // Software version 79 psString source = ppMergeSource(); // Software source 82 80 83 psFree(head); 84 psFree(pslib); 85 psFree(psmodules); 86 psFree(ppStats); 87 psFree(ppMerge); 81 psMetadataAddStr(header, PS_LIST_TAIL, "IPP.PPMERGE.VERSION", PS_META_REPLACE, 82 "Software version", version); 83 psMetadataAddStr(header, PS_LIST_TAIL, "IPP.PPMERGE.SOURCE", PS_META_REPLACE, 84 "S/W source", source); 88 85 89 return; 86 psFree(version); 87 psFree(source); 88 89 return true; 90 90 } 91
Note:
See TracChangeset
for help on using the changeset viewer.
