Changeset 26117
- Timestamp:
- Nov 12, 2009, 4:38:34 PM (16 years ago)
- Location:
- trunk/ppStack/src
- Files:
-
- 3 edited
-
ppStackCleanup.c (modified) (3 diffs)
-
ppStackFinish.c (modified) (4 diffs)
-
ppStackLoop.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackCleanup.c
r26076 r26117 4 4 5 5 #include <stdio.h> 6 #include <unistd.h>7 6 #include <pslib.h> 8 7 #include <psmodules.h> … … 22 21 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // ppStack recipe 23 22 psAssert(recipe, "We've thrown an error on this before."); 24 25 bool mdok; // Status of MD lookup26 bool tempDelete = psMetadataLookupBool(&mdok, recipe, "TEMP.DELETE"); // Delete temporary files?27 23 28 24 #if 0 … … 72 68 } 73 69 } 74 75 if (tempDelete) {76 psString imageResolved = pmConfigConvertFilename(options->convImages->data[i],77 config, false, false);78 psString maskResolved = pmConfigConvertFilename(options->convMasks->data[i],79 config, false, false);80 psString varianceResolved = pmConfigConvertFilename(options->convVariances->data[i],81 config, false, false);82 if (unlink(imageResolved) == -1 || unlink(maskResolved) == -1 ||83 unlink(varianceResolved) == -1) {84 psWarning("Unable to delete temporary files for image %d", i);85 }86 psFree(imageResolved);87 psFree(maskResolved);88 psFree(varianceResolved);89 }90 70 } 91 71 -
trunk/ppStack/src/ppStackFinish.c
r25847 r26117 4 4 5 5 #include <stdio.h> 6 #include <unistd.h> 6 7 #include <pslib.h> 7 8 #include <psmodules.h> … … 20 21 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // ppStack recipe 21 22 psAssert(recipe, "We've thrown an error on this before."); 23 24 bool mdok; // Status of MD lookup 25 bool tempDelete = psMetadataLookupBool(&mdok, recipe, "TEMP.DELETE"); // Delete temporary files? 26 27 // Delete temporary images 28 if (tempDelete && options->convolve) { 29 for (int i = 0; i < options->num; i++) { 30 if (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) { 31 continue; 32 } 33 34 psString imageResolved = pmConfigConvertFilename(options->convImages->data[i], 35 config, false, false); 36 psString maskResolved = pmConfigConvertFilename(options->convMasks->data[i], 37 config, false, false); 38 psString varianceResolved = pmConfigConvertFilename(options->convVariances->data[i], 39 config, false, false); 40 if (unlink(imageResolved) == -1 || unlink(maskResolved) == -1 || 41 unlink(varianceResolved) == -1) { 42 psWarning("Unable to delete temporary files for image %d", i); 43 } 44 psFree(imageResolved); 45 psFree(maskResolved); 46 psFree(varianceResolved); 47 } 48 } 49 22 50 23 51 // Statistics on output … … 44 72 } 45 73 46 47 74 // Write out summary statistics 48 75 if (options->stats) { … … 61 88 } 62 89 63 64 90 // Dump configuration 65 bool mdok; // Status of MD lookup66 91 psString dump = psMetadataLookupStr(&mdok, config->arguments, "DUMP_CONFIG"); // File for config 67 92 if (dump) { -
trunk/ppStack/src/ppStackLoop.c
r26106 r26117 106 106 ppStackMemDump("final"); 107 107 108 // Clean up 109 psTrace("ppStack", 2, "Cleaning up after combination....\n"); 110 if (!ppStackCleanup(stack, options, config)) { 111 psError(PS_ERR_UNKNOWN, false, "Unable to clean up."); 112 psFree(stack); 113 psFree(options); 114 return false; 115 } 116 psLogMsg("ppStack", PS_LOG_INFO, "Stage 6: Cleanup, WCS & JPEGS: %f sec", psTimerClear("PPSTACK_STEPS")); 117 ppStackMemDump("cleanup"); 118 108 119 psFree(stack); 109 120 … … 125 136 return false; 126 137 } 127 psLogMsg("ppStack", PS_LOG_INFO, "Stage 6: Unconvolved Stack: %f sec", psTimerClear("PPSTACK_STEPS"));138 psLogMsg("ppStack", PS_LOG_INFO, "Stage 7: Unconvolved Stack: %f sec", psTimerClear("PPSTACK_STEPS")); 128 139 ppStackMemDump("unconv"); 129 140 … … 132 143 psFree(options->cells); options->cells = NULL; 133 144 #endif 134 135 // Clean up136 psTrace("ppStack", 2, "Cleaning up after combination....\n");137 if (!ppStackCleanup(stack, options, config)) {138 psError(PS_ERR_UNKNOWN, false, "Unable to clean up.");139 psFree(stack);140 psFree(options);141 return false;142 }143 psLogMsg("ppStack", PS_LOG_INFO, "Stage 7: Cleanup, WCS & JPEGS: %f sec", psTimerClear("PPSTACK_STEPS"));144 ppStackMemDump("cleanup");145 145 146 146 // Photometry
Note:
See TracChangeset
for help on using the changeset viewer.
