Changeset 27101 for trunk/pswarp/src/pswarpLoop.c
- Timestamp:
- Feb 25, 2010, 6:16:46 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/pswarp/src/pswarpLoop.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarpLoop.c
r27096 r27101 39 39 { 40 40 pmFPAview *view = pmFPAviewAlloc(0); ///< View for checking 41 bool status = true; ///< Status of checks 42 status &= pmFPAfileIOChecks(config, view, PM_FPA_BEFORE); 41 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 42 psFree(view); 43 return false; 44 } 43 45 view->chip = 0; 44 status &= pmFPAfileIOChecks(config, view, PM_FPA_BEFORE); 46 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 47 psFree(view); 48 return false; 49 } 45 50 view->cell = 0; 46 status &= pmFPAfileIOChecks(config, view, PM_FPA_BEFORE); 51 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 52 psFree(view); 53 return false; 54 } 47 55 psFree(view); 48 return status;56 return true; 49 57 } 50 58 … … 57 65 pmFPAview *view = pmFPAviewAlloc(0); ///< View for checking 58 66 view->chip = view->cell = 0; 59 bool status = true; ///< Status of checks 60 status &= pmFPAfileIOChecks(config, view, PM_FPA_AFTER); 67 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 68 psFree(view); 69 return false; 70 } 61 71 view->cell = -1; 62 status &= pmFPAfileIOChecks(config, view, PM_FPA_AFTER); 72 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 73 psFree(view); 74 return false; 75 } 63 76 view->chip = -1; 64 status &= pmFPAfileIOChecks(config, view, PM_FPA_AFTER); 77 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 78 psFree(view); 79 return false; 80 } 65 81 psFree(view); 66 return status;82 return true; 67 83 } 68 84 … … 151 167 fileActivation(config, independentFiles, false); 152 168 fileActivation(config, skycellFiles, true); 153 ioChecksBefore(config); 169 if (!ioChecksBefore(config)) { 170 psError(psErrorCodeLast(), false, "Unable to read files."); 171 return false; 172 } 154 173 fileActivation(config, skycellFiles, false); 155 174 } … … 162 181 pmChip *chip; 163 182 pmFPAview *view = pmFPAviewAlloc(0); 164 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) { 183 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 184 psError(psErrorCodeLast(), false, "Unable to read files."); 165 185 return false; 166 186 } … … 169 189 if (!chip->process || !chip->file_exists) { continue; } 170 190 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 191 psError(psErrorCodeLast(), false, "Unable to read files."); 171 192 return false; 172 193 } … … 177 198 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE) || 178 199 !pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) { 200 psError(psErrorCodeLast(), false, "Unable to read files."); 179 201 return false; 180 202 } 181 203 } 182 204 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) { 205 psError(psErrorCodeLast(), false, "Unable to write files."); 183 206 return false; 184 207 } 185 208 } 186 209 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) { 210 psError(psErrorCodeLast(), false, "Unable to write files."); 187 211 return false; 188 212 } … … 222 246 // files associated with the science image 223 247 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) { 248 psError(psErrorCodeLast(), false, "Unable to read files."); 224 249 return false; 225 250 } … … 230 255 if (!chip->process || !chip->file_exists) { continue; } 231 256 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) { 257 psError(psErrorCodeLast(), false, "Unable to read files."); 232 258 return false; 233 259 } … … 257 283 if (!cell->process || !cell->file_exists) { continue; } 258 284 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) { 285 psError(psErrorCodeLast(), false, "Unable to read files."); 259 286 return false; 260 287 } … … 266 293 while ((readout = pmFPAviewNextReadout(view, input->fpa, 1)) != NULL) { 267 294 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 295 psError(psErrorCodeLast(), false, "Unable to read files."); 268 296 return false; 269 297 } … … 283 311 284 312 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 313 psError(psErrorCodeLast(), false, "Unable to write files."); 285 314 return false; 286 315 } 287 316 } 288 317 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 318 psError(psErrorCodeLast(), false, "Unable to write files."); 289 319 return false; 290 320 } 291 321 } 292 322 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 323 psError(psErrorCodeLast(), false, "Unable to write files."); 293 324 return false; 294 325 } … … 404 435 405 436 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 437 psError(psErrorCodeLast(), false, "Unable to write files."); 406 438 return false; 407 439 } … … 416 448 if (psMetadataLookupBool(&mdok, recipe, "PSF")) { 417 449 fileActivation(config, photFiles, true); 418 ioChecksBefore(config); 450 if (!ioChecksBefore(config)) { 451 psError(psErrorCodeLast(), false, "Unable to read files."); 452 return false; 453 } 419 454 420 455 // supply the readout and fpa of interest to psphot … … 501 536 fileActivation(config, independentFiles, true); 502 537 fileActivation(config, skycellFiles, true); 503 ioChecksAfter(config); 538 if (!ioChecksAfter(config)) { 539 psError(psErrorCodeLast(), false, "Unable to write files."); 540 return false; 541 } 504 542 505 543 // Write out summary statistics
Note:
See TracChangeset
for help on using the changeset viewer.
