Changeset 16704 for trunk/ppStack/src/ppStackLoop.c
- Timestamp:
- Feb 27, 2008, 5:38:21 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackLoop.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackLoop.c
r16693 r16704 4 4 5 5 #include <stdio.h> 6 #include <unistd.h> 6 7 #include <string.h> 7 8 #include <pslib.h> … … 11 12 #include "ppStack.h" 12 13 13 #define TESTING14 //#define TESTING 14 15 15 16 // Here follows lists of files for activation/deactivation at various stages. Each must be NULL-terminated. … … 185 186 assert(config); 186 187 188 bool mdok; // Status of MD lookup 187 189 psMaskType maskBlank = psMetadataLookupU8(NULL, config->arguments, "MASK.BLANK"); // Mask for blank reg. 188 189 bool mdok; // Status of MD lookup 190 bool tempDelete = psMetadataLookupBool(&mdok, config->arguments, "TEMP.DELETE"); // Delete temporary files? 191 const char *tempImage = psMetadataLookupStr(NULL, config->arguments, "TEMP.IMAGE"); // Suffix for temporary images 192 const char *tempMask = psMetadataLookupStr(NULL, config->arguments, "TEMP.MASK"); // Suffix for temporary masks 193 const char *tempWeight = psMetadataLookupStr(NULL, config->arguments, "TEMP.WEIGHT"); // Suffix for temporary weight (variance) maps 194 if (!tempImage || !tempMask || !tempWeight) { 195 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unable to find TEMP.IMAGE, TEMP.MASK and TEMP.WEIGHT"); 196 return false; 197 } 198 190 199 const char *statsName = psMetadataLookupStr(&mdok, config->arguments, "STATS"); // Filename for statistics 191 200 psMetadata *stats = NULL; // Container for statistics … … 286 295 } 287 296 288 const char *suffix = "conv.fits"; // Suffix for convolved images; ultimately this will be from recipe289 297 const char *outName = psMetadataLookupStr(NULL, config->arguments, "OUTPUT"); // Output root 290 298 assert(outName); … … 294 302 for (int i = 0; i < num; i++) { 295 303 psString imageName = NULL, maskName = NULL, weightName = NULL; // Names for convolved images 296 psStringAppend(&imageName, "%s. im-%d.%s", outName, i, suffix);297 psStringAppend(&maskName, "%s. mk-%d.%s", outName, i, suffix);298 psStringAppend(&weightName, "%s. wt-%d.%s", outName, i, suffix);304 psStringAppend(&imageName, "%s.%d.%s", outName, i, tempImage); 305 psStringAppend(&maskName, "%s.%d.%s", outName, i, tempMask); 306 psStringAppend(&weightName, "%s.%d.%s", outName, i, tempWeight); 299 307 imageNames->data[i] = imageName; 300 308 maskNames->data[i] = maskName; … … 508 516 psFitsClose(maskFits->data[i]); 509 517 psFitsClose(weightFits->data[i]); 518 if (tempDelete && (unlink(imageNames->data[i]) || unlink(maskNames->data[i]) || 519 unlink(weightNames->data[i]))) { 520 psWarning("Unable to delete temporary files for image %d", i); 521 } 510 522 } 511 523
Note:
See TracChangeset
for help on using the changeset viewer.
