Changeset 26237 for branches/eam_branches/20091113/ppStack
- Timestamp:
- Nov 20, 2009, 4:15:17 PM (17 years ago)
- Location:
- branches/eam_branches/20091113
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
ppStack/src/ppStackCleanup.c (modified) (3 diffs)
-
ppStack/src/ppStackCombineFinal.c (modified) (2 diffs)
-
ppStack/src/ppStackConvolve.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20091113
- Property svn:mergeinfo changed
/trunk (added) merged: 26138-26162,26169-26194,26201-26218
- Property svn:mergeinfo changed
-
branches/eam_branches/20091113/ppStack/src/ppStackCleanup.c
r26117 r26237 9 9 #include "ppStack.h" 10 10 #include "ppStackLoop.h" 11 12 #define WCS_TOLERANCE 0.001 // Tolerance for WCS13 11 14 12 … … 34 32 35 33 // Close up 36 bool wcsDone = false; // Have we done the WCS?37 for (int i = 0; i < options->num; i++) {38 if (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {39 continue;40 }41 42 ppStackThread *thread = stack->threads->data[0]; // Representative stack43 pmReadout *inRO = thread->readouts->data[i]; // Template readout44 if (inRO && !wcsDone) {45 // Copy astrometry over46 wcsDone = true;47 pmHDU *inHDU = pmHDUFromCell(inRO->parent); // Template HDU48 pmHDU *outHDU = pmHDUFromCell(options->outRO->parent); // Output HDU49 pmChip *outChip = options->outRO->parent->parent; // Output chip50 pmFPA *outFPA = outChip->parent; // Output FPA51 if (!outHDU || !inHDU) {52 psWarning("Unable to find HDU at FPA level to copy astrometry.");53 } else {54 if (!pmAstromReadWCS(outFPA, outChip, inHDU->header, 1.0)) {55 psErrorClear();56 psWarning("Unable to read WCS astrometry from input FPA.");57 wcsDone = false;58 } else {59 if (!outHDU->header) {60 outHDU->header = psMetadataAlloc();61 }62 if (!pmAstromWriteWCS(outHDU->header, outFPA, outChip, WCS_TOLERANCE)) {63 psErrorClear();64 psWarning("Unable to write WCS astrometry to output FPA.");65 wcsDone = false;66 }67 }68 }69 }70 }71 34 72 35 ppStackMemDump("cleanup"); … … 96 59 } 97 60 98 // Put version information into the header99 pmHDU *hdu = pmHDUFromCell(options->outRO->parent);100 if (!hdu) {101 psError(PS_ERR_UNKNOWN, false, "Unable to find HDU for output.");102 return false;103 }104 if (!hdu->header) {105 hdu->header = psMetadataAlloc();106 }107 ppStackVersionHeader(hdu->header);108 109 61 return true; 110 62 } -
branches/eam_branches/20091113/ppStack/src/ppStackCombineFinal.c
r26076 r26237 9 9 #include "ppStack.h" 10 10 #include "ppStackLoop.h" 11 12 #define WCS_TOLERANCE 0.001 // Tolerance for WCS 11 13 12 14 //#define TESTING // Enable test output … … 84 86 } 85 87 88 // Propagate WCS 89 bool wcsDone = false; // Have we done the WCS? 90 for (int i = 0; i < options->num && !wcsDone; i++) { 91 if (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) { 92 continue; 93 } 94 95 ppStackThread *thread = stack->threads->data[0]; // Representative stack 96 pmReadout *inRO = thread->readouts->data[i]; // Template readout 97 if (inRO && !wcsDone) { 98 // Copy astrometry over 99 wcsDone = true; 100 pmHDU *inHDU = pmHDUFromCell(inRO->parent); // Template HDU 101 pmHDU *outHDU = pmHDUFromCell(target->parent); // Output HDU 102 pmChip *outChip = target->parent->parent; // Output chip 103 pmFPA *outFPA = outChip->parent; // Output FPA 104 if (!outHDU || !inHDU) { 105 psWarning("Unable to find HDU at FPA level to copy astrometry."); 106 } else { 107 if (!pmAstromReadWCS(outFPA, outChip, inHDU->header, 1.0)) { 108 psErrorClear(); 109 psWarning("Unable to read WCS astrometry from input FPA."); 110 wcsDone = false; 111 } else { 112 if (!outHDU->header) { 113 outHDU->header = psMetadataAlloc(); 114 } 115 if (!pmAstromWriteWCS(outHDU->header, outFPA, outChip, WCS_TOLERANCE)) { 116 psErrorClear(); 117 psWarning("Unable to write WCS astrometry to output FPA."); 118 wcsDone = false; 119 } 120 } 121 } 122 } 123 } 124 125 // Put version information into the header 126 pmHDU *hdu = pmHDUFromCell(target->parent); 127 if (!hdu) { 128 psError(PS_ERR_UNKNOWN, false, "Unable to find HDU for output."); 129 return false; 130 } 131 if (!hdu->header) { 132 hdu->header = psMetadataAlloc(); 133 } 134 ppStackVersionHeader(hdu->header); 135 136 86 137 #ifdef TESTING 87 138 static int pass = 0; // Pass through -
branches/eam_branches/20091113/ppStack/src/ppStackConvolve.c
r26104 r26237 213 213 pmFPAview view; // View for output 214 214 view.chip = view.cell = view.readout = 0; 215 215 216 pmCell *outCell = pmFPAfileThisCell(config->files, &view, "PPSTACK.OUTPUT"); // Output cell 216 217 pmFPA *outFPA = outCell->parent->parent; // Output FPA 218 219 pmCell *unconvCell = pmFPAfileThisCell(config->files, &view, "PPSTACK.UNCONV"); // Unconvolved cell 220 pmFPA *unconvFPA = unconvCell->parent->parent; // Unconvolved FPA 221 217 222 pmConceptsAverageFPAs(outFPA, fpaList); 218 223 pmConceptsAverageCells(outCell, cellList, NULL, NULL, true); 224 225 pmConceptsAverageFPAs(unconvFPA, fpaList); 226 pmConceptsAverageCells(unconvCell, cellList, NULL, NULL, true); 227 219 228 psFree(fpaList); 220 229 psFree(cellList); … … 223 232 UPDATE_CONCEPT(outCell, "CELL.EXPOSURE", options->sumExposure); 224 233 UPDATE_CONCEPT(outCell, "CELL.DARKTIME", NAN); 234 235 UPDATE_CONCEPT(unconvFPA, "FPA.EXPOSURE", options->sumExposure); 236 UPDATE_CONCEPT(unconvCell, "CELL.EXPOSURE", options->sumExposure); 237 UPDATE_CONCEPT(unconvCell, "CELL.DARKTIME", NAN); 225 238 } 226 239
Note:
See TracChangeset
for help on using the changeset viewer.
