Changeset 14298 for trunk/ppStack/src/ppStackReadout.c
- Timestamp:
- Jul 18, 2007, 12:11:39 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackReadout.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackReadout.c
r14278 r14298 10 10 11 11 #define ARRAY_BUFFER 16 // Number to add to array at a time 12 #define WCS_TOLERANCE 0.001 // Tolerance for WCS 12 13 13 14 bool ppStackReadout(pmConfig *config, const pmFPAview *view) … … 26 27 pmCell *outCell = pmFPAfileThisCell(config->files, view, "PPSTACK.OUTPUT"); // Output cell 27 28 pmReadout *outRO = pmReadoutAlloc(outCell); // Output readout 29 pmFPA *outFPA = outCell->parent->parent; // Output FPA 28 30 29 31 int num = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); // Number of inputs … … 39 41 int fileNum = 0; // Number of file 40 42 float totExposure = 0.0; // Total exposure time 43 pmReadout *templateRO = NULL; // Template readout, for copy WCS 41 44 while ((fileItem = psMetadataGetAndIncrement(fileIter))) { 42 45 assert(fileItem->type == PS_DATA_UNKNOWN); … … 89 92 ro->mask = psImageAlloc(ro->image->numCols, ro->image->numRows, PS_TYPE_MASK); 90 93 psImageInit(ro->mask, 0); 94 } 95 96 if (fileNum == 0) { 97 templateRO = ro; 91 98 } 92 99 … … 170 177 171 178 outRO->data_exists = true; 172 outRO->parent->data_exists = true; 173 outRO->parent->parent->data_exists = true; 179 outCell->data_exists = true; 180 outCell->parent->data_exists = true; 181 182 // Copy astrometry over 183 pmFPA *templateFPA = templateRO->parent->parent->parent; // Template FPA 184 pmHDU *templateHDU = templateFPA->hdu; // Template HDU 185 pmHDU *outHDU = outFPA->hdu; // Output HDU 186 if (!outHDU || !templateHDU) { 187 psWarning("Unable to find HDU at FPA level to copy astrometry."); 188 } else { 189 if (!pmAstromReadWCS(outFPA, outCell->parent, templateHDU->header, 1.0)) { 190 psError(PS_ERR_UNKNOWN, false, "Unable to read WCS astrometry from input FPA."); 191 psFree(stack); 192 psFree(outRO); 193 return false; 194 } 195 if (!pmAstromWriteWCS(outHDU->header, outFPA, outCell->parent, WCS_TOLERANCE)) { 196 psError(PS_ERR_UNKNOWN, false, "Unable to write WCS astrometry to output FPA."); 197 psFree(stack); 198 psFree(outRO); 199 return false; 200 } 201 } 174 202 175 203 psFree(stack);
Note:
See TracChangeset
for help on using the changeset viewer.
