Changeset 30285
- Timestamp:
- Jan 17, 2011, 5:00:30 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20101205/ppSub/src
- Files:
-
- 14 edited
-
ppSub.c (modified) (1 diff)
-
ppSubFiles.c (modified) (9 diffs)
-
ppSubInputDetections.c (modified) (2 diffs)
-
ppSubLoop.c (modified) (3 diffs)
-
ppSubMakePSF.c (modified) (1 diff)
-
ppSubMatchPSFs.c (modified) (5 diffs)
-
ppSubReadoutForcedPhot.c (modified) (3 diffs)
-
ppSubReadoutInverse.c (modified) (2 diffs)
-
ppSubReadoutJpeg.c (modified) (1 diff)
-
ppSubReadoutPhotometry.c (modified) (2 diffs)
-
ppSubReadoutSubtract.c (modified) (1 diff)
-
ppSubSetMasks.c (modified) (4 diffs)
-
ppSubThreshold.c (modified) (3 diffs)
-
ppSubVarianceRescale.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101205/ppSub/src/ppSub.c
r29551 r30285 112 112 psLibFinalize(); 113 113 114 fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, stdout, false), "ppSub"); 114 115 exitValue = ppSubExitCode(exitValue); 115 116 exit(exitValue); -
branches/eam_branches/ipp-20101205/ppSub/src/ppSubFiles.c
r27094 r30285 125 125 // FPA 126 126 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 127 psFree (view); 127 128 return false; 128 129 } … … 131 132 view->chip = 0; 132 133 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 134 psFree (view); 133 135 return false; 134 136 } … … 137 139 view->cell = 0; 138 140 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 141 psFree (view); 139 142 return false; 140 143 } … … 143 146 view->readout = 0; 144 147 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 145 return false; 146 } 147 148 ppSubFilesActivate(config, PPSUB_FILES_ALL, false); 149 148 psFree (view); 149 return false; 150 } 151 152 ppSubFilesActivate(config, PPSUB_FILES_ALL, false); 153 154 psFree (view); 150 155 return true; 151 156 } … … 162 167 // Readout 163 168 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 169 psFree (view); 164 170 return false; 165 171 } … … 168 174 view->readout = -1; 169 175 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 176 psFree (view); 170 177 return false; 171 178 } … … 174 181 view->cell = -1; 175 182 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 183 psFree (view); 176 184 return false; 177 185 } … … 180 188 view->chip = -1; 181 189 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 190 psFree (view); 182 191 return false; 183 192 } … … 222 231 ppSubFilesActivate(config, PPSUB_FILES_ALL, false); 223 232 233 psFree (view); 224 234 return true; 225 235 } -
branches/eam_branches/ipp-20101205/ppSub/src/ppSubInputDetections.c
r29937 r30285 118 118 if (!psMetadataCopy(sourcesHDU->header, imageHDU->header)) { 119 119 psError(PPSUB_ERR_PROG, false, "Unable to copy header"); 120 psFree(view); 120 121 return false; 121 122 } … … 130 131 if (!psphotCopyResults (foundDetections, sourcesFile, photFile, view)) { 131 132 psError(PPSUB_ERR_PROG, false, "Unable to copy psphot outputs"); 133 psFree(view); 132 134 return false; 133 135 } 134 136 // if no sources were found here, we report that back and let them handle it 135 137 138 psFree(view); 136 139 return true; 137 140 } -
branches/eam_branches/ipp-20101205/ppSub/src/ppSubLoop.c
r30106 r30285 26 26 pmReadout *out = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT"); 27 27 psphotSaveImage (NULL, out->image, name); 28 psFree(view); 28 29 return true; 29 30 } … … 111 112 goto ESCAPE; 112 113 } 114 113 115 if (data->quality) { 114 116 // Can't do anything at all … … 257 259 psError(psErrorCodeLast(), false, "Unable to generate mask statistics"); 258 260 success = false; 261 psFree(view); 259 262 goto ESCAPE; 260 263 } 264 psFree(view); 261 265 } 262 266 // dumpout(config, "diff.4.fits"); -
branches/eam_branches/ipp-20101205/ppSub/src/ppSubMakePSF.c
r29937 r30285 79 79 if (!detections || !detections->allSources) { 80 80 psError(PPSUB_ERR_CONFIG, true, "No sources from which to determine PSF."); 81 psFree(view); 81 82 return false; 82 83 } -
branches/eam_branches/ipp-20101205/ppSub/src/ppSubMatchPSFs.c
r29937 r30285 78 78 return true; 79 79 } 80 81 80 psFree(view); 82 81 … … 127 126 if (!inSourceRO || !refSourceRO) { 128 127 psError(PPSUB_ERR_DATA, false, "Unable to scale kernel, since no sources were provided."); 128 psFree(view); 129 129 return false; 130 130 } … … 166 166 if (!psMetadataLookupBool(NULL, recipe, "SCALE")) { 167 167 // No scaling requested 168 psFree(view);169 168 return true; 170 169 } … … 221 220 pmCell *cell = pmFPAfileThisCell(config->files, view, "PPSUB.INPUT.CONV"); // Cell for convolved input 222 221 inConv = pmReadoutAlloc(cell); 222 psFree(inConv); 223 223 } 224 224 pmReadout *refConv = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV"); // Reference convolved … … 226 226 pmCell *cell = pmFPAfileThisCell(config->files, view, "PPSUB.REF.CONV"); // Cell for convolved ref. 227 227 refConv = pmReadoutAlloc(cell); 228 psFree(refConv); 228 229 } 229 230 -
branches/eam_branches/ipp-20101205/ppSub/src/ppSubReadoutForcedPhot.c
r29937 r30285 61 61 // XXX remove the pixels from photFile? 62 62 // XXX other cleanup operations? 63 psFree(view); 63 64 return true; 64 65 } … … 89 90 if (!psphotCopyResults (&foundDetections, outputFile, photFile, view)) { 90 91 psError(PPSUB_ERR_PROG, false, "Unable to copy psphot outputs"); 92 psFree(view); 91 93 return false; 92 94 } … … 97 99 psMetadataAddF32(data->stats, PS_LIST_TAIL, "TIME_PHOT", PS_META_REPLACE, "Time to do photometry", elapsed); 98 100 101 psFree(view); 99 102 return true; 100 103 } -
branches/eam_branches/ipp-20101205/ppSub/src/ppSubReadoutInverse.c
r27789 r30285 36 36 if (!pmAstromWriteWCS(invHDU->header, outFPA, outChip, WCS_TOLERANCE)) { 37 37 psError(psErrorCodeLast(), false, "Unable to write WCS astrometry to PPSUB.INVERSE."); 38 psFree(view); 38 39 return false; 39 40 } … … 41 42 if (!pmAstromReadWCS(invFPA, invChip, invHDU->header, 1.0)) { 42 43 psError(psErrorCodeLast(), false, "Unable to read WCS astrometry."); 44 psFree(view); 43 45 return false; 44 46 } 45 47 48 psFree(view); 46 49 return true; 47 50 } -
branches/eam_branches/ipp-20101205/ppSub/src/ppSubReadoutJpeg.c
r26982 r30285 139 139 } 140 140 141 psFree(view); 141 142 return true; 142 143 } -
branches/eam_branches/ipp-20101205/ppSub/src/ppSubReadoutPhotometry.c
r29937 r30285 109 109 if (!psMetadataCopySingle(inRO->analysis, photRO->analysis, "PSPHOT.DETECTIONS")) { 110 110 psError(PPSUB_ERR_PROG, false, "Unable to copy PSPHOT.DETECTIONS"); 111 psFree(view); 111 112 return false; 112 113 } 113 114 if (!psMetadataCopySingle(inRO->analysis, photRO->analysis, "PSPHOT.HEADER")) { 114 115 psError(PPSUB_ERR_PROG, false, "Unable to copy PSPHOT.HEADER"); 116 psFree(view); 115 117 return false; 116 118 } 117 119 if (!psMetadataCopySingle(inRO->analysis, photRO->analysis, PM_DETEFF_ANALYSIS)) { 118 120 psError(PPSUB_ERR_PROG, false, "Unable to copy Detection Efficiency"); 121 psFree(view); 119 122 return false; 120 123 } … … 128 131 } 129 132 133 psFree(view); 130 134 return true; 131 135 } 132 136 133 137 #ifdef TESTING 134 // Record data about sources: not everything gets into the output CMF files138 // Record data about sources: not everything gets into the output CMF files 135 139 { 136 140 pmReadout *photRO = pmFPAviewThisReadout(view, photFile->fpa); // Readout with the sources -
branches/eam_branches/ipp-20101205/ppSub/src/ppSubReadoutSubtract.c
r29003 r30285 109 109 pmChip *outChip = pmFPAfileThisChip(config->files, view, "PPSUB.OUTPUT"); // Output chip 110 110 psFree(view); 111 111 112 if (!outHDU || !inHDU) { 112 113 psError(PPSUB_ERR_PROG, true, "Unable to find HDU at FPA level to copy astrometry."); -
branches/eam_branches/ipp-20101205/ppSub/src/ppSubSetMasks.c
r29551 r30285 80 80 if (!pmReadoutMaskInvalid(inRO, maskValue, satValue)) { 81 81 psError(PPSUB_ERR_DATA, false, "Unable to mask non-finite pixels in input."); 82 psFree(view); 82 83 return false; 83 84 } 84 85 if (!pmReadoutMaskInvalid(refRO, maskValue, satValue)) { 85 86 psError(PPSUB_ERR_DATA, false, "Unable to mask non-finite pixels in reference."); 87 psFree(view); 86 88 return false; 87 89 } … … 94 96 if (interpMode == PS_INTERPOLATE_NONE) { 95 97 psError(PPSUB_ERR_CONFIG, false, "Unknown interpolation mode: %s", interpModeStr); 98 psFree(view); 96 99 return false; 97 100 } … … 104 107 if (!pmReadoutInterpolateBadPixels(inRO, maskVal, interpMode, poorFrac, maskPoor, maskBad)) { 105 108 psError(PPSUB_ERR_DATA, false, "Unable to interpolate bad pixels for input image."); 109 psFree(view); 106 110 return false; 107 111 } 108 112 if (!pmReadoutInterpolateBadPixels(refRO, maskVal, interpMode, poorFrac, maskPoor, maskBad)) { 109 113 psError(PPSUB_ERR_DATA, false, "Unable to interpolate bad pixels for reference image."); 114 psFree(view); 110 115 return false; 111 116 } … … 113 118 #endif 114 119 120 psFree(view); 115 121 return true; 116 122 } -
branches/eam_branches/ipp-20101205/ppSub/src/ppSubThreshold.c
r26982 r30285 98 98 if (!in) { 99 99 psError(PPSUB_ERR_UNKNOWN, false, "Unable to find readout."); 100 psFree(view); 100 101 return false; 101 102 } … … 104 105 if (!ref) { 105 106 psError(PPSUB_ERR_UNKNOWN, false, "Unable to find readout."); 107 psFree(view); 106 108 return false; 107 109 } … … 115 117 if (!lowThreshold(in, thresh, maskVal, maskThresh, region, "input convolved image")) { 116 118 psError(psErrorCodeLast(), false, "Unable to threshold input image."); 119 psFree(view); 117 120 return false; 118 121 } 119 122 if (!lowThreshold(ref, thresh, maskVal, maskThresh, region, "reference convolved image")) { 120 123 psError(psErrorCodeLast(), false, "Unable to threshold input image."); 124 psFree(view); 121 125 return false; 122 126 } -
branches/eam_branches/ipp-20101205/ppSub/src/ppSubVarianceRescale.c
r28121 r30285 57 57 // Nothing to renormalise 58 58 psWarning("Renormalisation of the variance requested, but no variance provided."); 59 psFree(view); 59 60 return true; 60 61 } … … 69 70 } 70 71 72 psFree(view); 71 73 return true; 72 74 }
Note:
See TracChangeset
for help on using the changeset viewer.
