Changeset 30080
- Timestamp:
- Dec 16, 2010, 7:55:34 PM (15 years ago)
- File:
-
- 1 edited
-
tags/ipp-20101215/ppSub/src/ppSubLoop.c (modified) (21 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20101215/ppSub/src/ppSubLoop.c
-
Property svn:mergeinfo
set to
/branches/czw_branch/20101203/ppSub/src/ppSubLoop.c merged eligible /branches/eam_branches/ipp-20101103/ppSub/src/ppSubLoop.c merged eligible /trunk/ppSub/src/ppSubLoop.c merged eligible
r30040 r30080 36 36 psAssert(config, "Require configuration."); 37 37 38 bool success = true; 39 38 40 pmConfigCamerasCull(config, NULL); 39 41 pmConfigRecipesCull(config, "PPSUB,PPSTATS,PSPHOT,PSASTRO,MASKS,JPEG"); … … 61 63 if (!ppSubInputDetections(&foundDetections, "PPSUB.POS1.SOURCES", "PPSUB.INPUT", data)) { 62 64 psError(psErrorCodeLast(), false, "Unable to measure positive detections (1)"); 63 return false; 65 success = false; 66 goto ESCAPE; 64 67 } 65 68 // if nothing was found, don't bother doing the forced photometry below … … 90 93 psMetadataAddF32(recipe, PS_LIST_TAIL, "PEAKS_NSIGMA_LIMIT", PS_META_REPLACE, "", nsigma_peak_save); 91 94 psMetadataAddStr(recipe, PS_LIST_TAIL, "BREAK_POINT", PS_META_REPLACE, "", breakPt_save); 92 return false; 95 success = false; 96 goto ESCAPE; 93 97 } 94 98 psMetadataAddF32(recipe, PS_LIST_TAIL, "PEAKS_NSIGMA_LIMIT", PS_META_REPLACE, "", nsigma_peak_save); … … 101 105 } 102 106 103 // XXX if it exists, use the POS1, POS2 results for the FWHMs107 // XXX if it exists, use the POS1, POS2 successs for the FWHMs 104 108 if (!ppSubMatchPSFs(data)) { 105 109 psError(psErrorCodeLast(), false, "Unable to match PSFs."); 106 return false; 110 success = false; 111 goto ESCAPE; 107 112 } 108 113 if (data->quality) { 109 114 // Can't do anything at all 110 return true; 115 success = false; 116 goto ESCAPE; 111 117 } 112 118 // generate the residual stamp grid for visualization 113 119 if (!ppSubResidualSampleJpeg(config)) { 114 120 psError(psErrorCodeLast(), false, "Unable to update."); 115 return false; 121 success = false; 122 goto ESCAPE; 116 123 } 117 124 … … 125 132 if (!ppSubFilesIterateUp(config, PPSUB_FILES_INPUT)) { 126 133 psError(PPSUB_ERR_IO, false, "Unable to close input files."); 127 return false; 134 success = false; 135 goto ESCAPE; 128 136 } 129 137 130 138 if (!ppSubLowThreshold(data)) { 131 139 psError(psErrorCodeLast(), false, "Unable to threshold images."); 132 return false; 140 success = false; 141 goto ESCAPE; 133 142 } 134 143 … … 136 145 if (!ppSubFilesIterateDown(config, PPSUB_FILES_SUB)) { 137 146 psError(PPSUB_ERR_IO, false, "Unable to set up subtraction files."); 138 return false; 147 success = false; 148 goto ESCAPE; 139 149 } 140 150 141 151 if (!ppSubDefineOutput("PPSUB.OUTPUT", config)) { 142 152 psError(psErrorCodeLast(), false, "Unable to define output."); 143 return false; 153 success = false; 154 goto ESCAPE; 144 155 } 145 156 146 157 if (!data->quality && !ppSubMakePSF(data)) { 147 158 psError(psErrorCodeLast(), false, "Unable to generate PSF."); 148 return false; 159 success = false; 160 goto ESCAPE; 149 161 } 150 162 … … 161 173 if (!ppSubReadoutSubtract(config)) { 162 174 psError(psErrorCodeLast(), false, "Unable to subtract images."); 163 return false; 175 success = false; 176 goto ESCAPE; 164 177 } 165 178 // dumpout(config, "diff.1.fits"); … … 168 181 if (!ppSubFilesIterateUp(config, PPSUB_FILES_PSF | PPSUB_FILES_CONV)) { 169 182 psError(PPSUB_ERR_IO, false, "Unable to close input files."); 170 return false; 183 success = false; 184 goto ESCAPE; 171 185 } 172 186 // dumpout(config, "diff.2a.fits"); … … 175 189 if (!ppSubBackground(config)) { 176 190 psError(psErrorCodeLast(), false, "Unable to subtract background."); 177 return false; 191 success = false; 192 goto ESCAPE; 178 193 } 179 194 // dumpout(config, "diff.2b.fits"); … … 182 197 if (!ppSubVarianceRescale(config, data)) { 183 198 psError(psErrorCodeLast(), false, "Unable to rescale variance."); 184 return false; 199 success = false; 200 goto ESCAPE; 185 201 } 186 202 // dumpout(config, "diff.2c.fits"); … … 188 204 if (data->quality) { 189 205 // Done all we can do up to this point 190 return true; 206 success = false; 207 goto ESCAPE; 191 208 } 192 209 193 210 if (!ppSubFilesIterateDown(config, PPSUB_FILES_PHOT_SUB)) { 194 211 psError(PPSUB_ERR_IO, false, "Unable to set up photometry files."); 195 return false; 212 success = false; 213 goto ESCAPE; 196 214 } 197 215 198 216 if (!data->quality && !ppSubReadoutPhotometry("PPSUB.OUTPUT", data)) { 199 217 psError(psErrorCodeLast(), false, "Unable to perform photometry."); 200 return false; 218 success = false; 219 goto ESCAPE; 201 220 } 202 221 // dumpout(config, "diff.3.fits"); … … 206 225 if (!ppSubReadoutForcedPhot("PPSUB.FORCED1.SOURCES", "PPSUB.OUTPUT", "PPSUB.POS1.SOURCES", data)) { 207 226 psError(psErrorCodeLast(), false, "Unable to perform photometry."); 208 return false; 227 success = false; 228 goto ESCAPE; 209 229 } 210 230 } … … 214 234 if (!ppSubReadoutForcedPhot("PPSUB.FORCED2.SOURCES", "PPSUB.OUTPUT", "PPSUB.POS2.SOURCES", data)) { 215 235 psError(psErrorCodeLast(), false, "Unable to perform photometry."); 216 return false; 236 success = false; 237 goto ESCAPE; 217 238 } 218 239 } … … 220 241 if (!ppSubFilesIterateUp(config, PPSUB_FILES_PHOT_SUB)) { 221 242 psError(PPSUB_ERR_IO, false, "Unable to set up photometry files."); 222 return false; 243 success = false; 244 goto ESCAPE; 223 245 } 224 246 … … 226 248 if (!ppSubReadoutStats(data)) { 227 249 psError(psErrorCodeLast(), false, "Unable to collect statistics"); 228 return false; 250 success = false; 251 goto ESCAPE; 229 252 } 230 253 // Do Mask Stats … … 233 256 if (!ppSubMaskStats(config, view,data->stats)) { 234 257 psError(psErrorCodeLast(), false, "Unable to generate mask statistics"); 235 return(false); 258 success = false; 259 goto ESCAPE; 236 260 } 237 261 } … … 241 265 if (!ppSubReadoutJpeg(config)) { 242 266 psError(psErrorCodeLast(), false, "Unable to update."); 243 return false; 267 success = false; 268 goto ESCAPE; 244 269 } 245 270 … … 248 273 if (!ppSubFilesIterateDown(config, PPSUB_FILES_INV)) { 249 274 psError(PPSUB_ERR_IO, false, "Unable to set up inverse files."); 250 return false; 275 success = false; 276 goto ESCAPE; 251 277 } 252 278 253 279 if (data->inverse && !ppSubDefineOutput("PPSUB.INVERSE", config)) { 254 280 psError(psErrorCodeLast(), false, "Unable to define inverse."); 255 return false; 281 success = false; 282 goto ESCAPE; 256 283 } 257 284 258 285 if (!ppSubReadoutInverse(config)) { 259 286 psError(psErrorCodeLast(), false, "Unable to invert images."); 260 return false; 287 success = false; 288 goto ESCAPE; 261 289 } 262 290 … … 264 292 if (!ppSubFilesIterateUp(config, PPSUB_FILES_SUB)) { 265 293 psError(PPSUB_ERR_IO, false, "Unable to close subtraction files."); 266 return false; 294 success = false; 295 goto ESCAPE; 267 296 } 268 297 269 298 if (!ppSubFilesIterateDown(config, PPSUB_FILES_PHOT_INV)) { 270 299 psError(PPSUB_ERR_IO, false, "Unable to set up inverse files."); 271 return false; 300 success = false; 301 goto ESCAPE; 272 302 } 273 303 274 304 if (!data->quality && !ppSubReadoutPhotometry("PPSUB.INVERSE", data)) { 275 305 psError(psErrorCodeLast(), false, "Unable to perform photometry."); 276 return false; 306 success = false; 307 goto ESCAPE; 277 308 } 278 309 … … 280 311 if (!ppSubFilesIterateUp(config, PPSUB_FILES_INV | PPSUB_FILES_PHOT_INV)) { 281 312 psError(PPSUB_ERR_IO, false, "Unable to close subtraction files."); 282 return false; 313 success = false; 314 goto ESCAPE; 283 315 } 284 316 } else { … … 287 319 if (!ppSubFilesIterateUp(config, PPSUB_FILES_SUB)) { 288 320 psError(PPSUB_ERR_IO, false, "Unable to close subtraction files."); 289 return false; 290 } 291 } 292 321 success = false; 322 goto ESCAPE; 323 } 324 } 325 326 ESCAPE: 293 327 pmFPAfileDropInternal(config->files, "PSPHOT.BACKGND"); 294 328 pmFPAfileDropInternal(config->files, "PSPHOT.BACKMDL"); 295 329 pmFPAfileDropInternal(config->files, "PSPHOT.BACKMDL.STDEV"); 296 330 297 return true;331 return success; 298 332 } -
Property svn:mergeinfo
set to
Note:
See TracChangeset
for help on using the changeset viewer.
