Changeset 24381 for trunk/magic/remove/src/streaksrelease.c
- Timestamp:
- Jun 11, 2009, 4:26:17 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/magic/remove/src/streaksrelease.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/streaksrelease.c
r24286 r24381 23 23 } 24 24 25 psMetadata *masks = psMetadataLookupMetadata(&status, config->recipes, "MASKS"); 26 if (!status) { 27 psError(PM_ERR_CONFIG, false, "failed to lookup MASKS in recipes\n"); 28 return PS_EXIT_CONFIG_ERROR; 29 } 30 psU8 poorWarp = (double) psMetadataLookupU8(&status, masks, "POOR.WARP"); 31 if (!status) { 32 psError(PM_ERR_CONFIG, false, "failed to lookup mask value for POOR.WARP in recipes\n"); 33 return PS_EXIT_CONFIG_ERROR; 34 } 35 // we're setting pixels with any mask bits execpt POOR.WARP to NAN 36 psU8 maskMask = ~poorWarp; 25 // Values to set for masked pixels 26 psU32 maskStreak = 0; // for the image and weight (usually NAN, MAXINT for integer images) 27 psU32 maskMask = 0; // value looked up for MASK.STREAK 37 28 38 29 // Does true work here? … … 64 55 } 65 56 57 // now that we've read the input files, lookup the mask values that we read 58 if (maskStreak == 0) { 59 strkGetMaskValues(sfiles, &maskStreak, &maskMask); 60 } 61 66 62 setMaskedToNAN(sfiles, maskMask, true); 67 63 … … 77 73 printf("time to close images: %f\n", psTimerClear("CLOSE_IMAGES")); 78 74 79 #ifdef NOTYET80 if (!replicateOutputs(sfiles)) {81 psError(PS_ERR_UNKNOWN, false, "failed to replicate output files");82 psErrorStackPrint(stderr, "");83 exit(PS_EXIT_UNKNOWN_ERROR);84 }85 86 if (psMetadataLookupBool(&status, config->arguments, "REPLACE")) {87 // swap the instances for the input and output88 // Note this is a database operation. No file I/O is performed89 if (!swapOutputsToInputs(sfiles)) {90 psError(PS_ERR_UNKNOWN, false, "failed to swap files");91 92 // XXX: Now what? I guess swapOutputsToInputs will need to undo anything that93 // it has done and give a detailed report of what happened94 95 psErrorStackPrint(stderr, "");96 exit(PS_EXIT_UNKNOWN_ERROR);97 }98 99 if (psMetadataLookupBool(&status, config->arguments, "REMOVE")) {100 // delete the temporary storage objects (which now points to the original image(s)101 if (!deleteTemps(sfiles)) {102 psError(PS_ERR_UNKNOWN, false, "failed to delete temporary files");103 // XXX: Now what? At this point the output files have been swapped, so we can't104 // repeat the operation.105 106 // Returning error status here is problematic. The inputs have been streak removed107 // but they're still lying around108 // Maybe just print an error message and109 // let other system tools clean up110 psErrorStackPrint(stderr, "");111 exit(PS_EXIT_UNKNOWN_ERROR);112 }113 }114 }115 #endif // REPLACE, REMOVE116 75 printf("time to run streaksrelease: %f\n", psTimerClear("STREAKSREMOVE")); 117 76 … … 297 256 if (sf->outChMask) { 298 257 copyFitsOptions(sf->outChMask, sf->recChMask, sf->inMask, sf->tiles); 299 psFitsSetCompression(sf->outChMask->fits, PS_FITS_COMPRESS_PLIO, sf->tiles, 8, 0, 0);300 if (sf->recChMask) {301 psFitsSetCompression(sf->recChMask->fits, PS_FITS_COMPRESS_PLIO, sf->tiles, 8, 0, 0);302 }303 258 } 304 259 }
Note:
See TracChangeset
for help on using the changeset viewer.
