Changeset 23704 for branches/pap/ppSub/src/ppSubDefineOutput.c
- Timestamp:
- Apr 3, 2009, 11:58:24 AM (17 years ago)
- File:
-
- 1 edited
-
branches/pap/ppSub/src/ppSubDefineOutput.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap/ppSub/src/ppSubDefineOutput.c
r23403 r23704 21 21 #include "ppSub.h" 22 22 23 bool ppSubDefineOutput( pmConfig *config, const pmFPAview *view)23 bool ppSubDefineOutput(const char *name, pmConfig *config, const ppSubData *data, const pmFPAview *view) 24 24 { 25 psAssert(name, "Require name"); 25 26 psAssert(config, "Require configuration"); 26 27 psAssert(view, "Require view"); 27 28 28 pmCell *outCell = pmFPAfileThisCell(config->files, view, "PPSUB.OUTPUT"); // Output cell29 pmCell *outCell = pmFPAfileThisCell(config->files, view, name); // Output cell 29 30 pmFPA *outFPA = outCell->parent->parent; // Output FPA 30 31 pmHDU *outHDU = outFPA->hdu; // Output HDU … … 33 34 } 34 35 35 // generate an output readout (first check if it's already there by virtue of kernels) 36 pmReadout *outRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT.KERNELS"); // RO with kernel 37 if (!outRO) { 38 outRO = pmReadoutAlloc(outCell); // Output readout: subtraction 36 pmReadout *outRO = NULL; // Output readout 37 if (outCell->readouts && outCell->readouts->n > 0 && outCell->readouts->data[0]) { 38 outRO = psMemIncrRefCounter(outCell->readouts->data[0]); 39 } else { 40 outRO = pmReadoutAlloc(outCell); 39 41 } 40 42 … … 55 57 if (!kernels) { 56 58 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find SUBTRACTION.KERNEL"); 57 psFree(inConv);58 psFree(refConv);59 59 psFree(outRO); 60 60 return false; … … 65 65 outRO->analysis = psMetadataCopy(outRO->analysis, analysis); 66 66 67 #ifdef TESTING 68 { 69 psImage *kernelImage = psMetadataLookupPtr(&mdok, analysis, 70 "SUBTRACTION.KERNEL.IMAGE"); // Image of kernel 71 psFits *fits = psFitsOpen("kernel.fits", "w"); 72 psFitsWriteImage(fits, NULL, kernelImage, 0, NULL); 73 psFitsClose(fits); 74 } 75 #endif 67 psFree(outRO); 76 68 77 69 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
