Changeset 26896 for trunk/pswarp/src/pswarpLoop.c
- Timestamp:
- Feb 10, 2010, 7:38:54 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/pswarp/src/pswarpLoop.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarpLoop.c
r25847 r26896 162 162 pmChip *chip; 163 163 pmFPAview *view = pmFPAviewAlloc(0); 164 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 164 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) { 165 return false; 166 } 165 167 while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) { 166 168 psTrace ("pswarp", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 167 169 if (!chip->process || !chip->file_exists) { continue; } 168 pmFPAfileIOChecks(config, view, PM_FPA_BEFORE); 170 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 171 return false; 172 } 169 173 pmCell *cell; 170 174 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) { 171 175 psTrace ("pswarp", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 172 176 if (!cell->process || !cell->file_exists) { continue; } 173 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 174 pmFPAfileIOChecks (config, view, PM_FPA_AFTER); 175 } 176 pmFPAfileIOChecks (config, view, PM_FPA_AFTER); 177 } 178 pmFPAfileIOChecks (config, view, PM_FPA_AFTER); 177 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE) || 178 !pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) { 179 return false; 180 } 181 } 182 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) { 183 return false; 184 } 185 } 186 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) { 187 return false; 188 } 179 189 psFree(view); 180 190 … … 211 221 212 222 // files associated with the science image 213 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 223 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) { 224 return false; 225 } 214 226 215 227 pmChip *chip; … … 217 229 psTrace ("pswarp", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 218 230 if (!chip->process || !chip->file_exists) { continue; } 219 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 231 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) { 232 return false; 233 } 220 234 221 235 // read WCS data from the corresponding header … … 242 256 psTrace ("pswarp", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 243 257 if (!cell->process || !cell->file_exists) { continue; } 244 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 258 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) { 259 return false; 260 } 245 261 246 262 psListAdd(cells, PS_LIST_TAIL, cell); … … 249 265 pmReadout *readout; 250 266 while ((readout = pmFPAviewNextReadout(view, input->fpa, 1)) != NULL) { 251 pmFPAfileIOChecks(config, view, PM_FPA_BEFORE); 267 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 268 return false; 269 } 252 270 if (!readout->data_exists) { 253 271 continue; 254 272 } 255 273 256 // Copy the sources from the astrometry carrier to the input, so they can be accessed by274 // Copy the detections from the astrometry carrier to the input, so they can be accessed by 257 275 // pswarpTransformReadout 258 276 pmReadout *astromRO = pmFPAviewThisReadout(view, astrom->fpa); // Readout for astrometry 259 psArray *sources = psMetadataLookupPtr(&mdok, astromRO->analysis, 260 "PSPHOT.SOURCES"); // Sources from astrometry 261 if (sources) { 262 psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY, 263 "Sources from input astrometry", sources); 277 pmDetections *detections = psMetadataLookupPtr(&mdok, astromRO->analysis, "PSPHOT.DETECTIONS"); // Sources from astrometry 278 if (detections) { 279 psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_DATA_ARRAY, "Sources from input astrometry", detections); 264 280 } 265 281 266 282 pswarpTransformReadout(output, readout, config); 267 283 268 pmFPAfileIOChecks(config, view, PM_FPA_AFTER); 269 } 270 pmFPAfileIOChecks(config, view, PM_FPA_AFTER); 271 } 272 pmFPAfileIOChecks(config, view, PM_FPA_AFTER); 284 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 285 return false; 286 } 287 } 288 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 289 return false; 290 } 291 } 292 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 293 return false; 294 } 273 295 } 274 296 … … 370 392 } 371 393 372 pmFPAfileIOChecks(config, view, PM_FPA_AFTER); 394 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 395 return false; 396 } 373 397 374 398 // Done with the detector side of things … … 478 502 } 479 503 fprintf(statsFile, "%s", statsMDC); 480 psFree( (void*)statsMDC);504 psFree(statsMDC); 481 505 fclose(statsFile); 482 506 pmConfigRunFilenameAddWrite(config, "STATS", statsName);
Note:
See TracChangeset
for help on using the changeset viewer.
