- Timestamp:
- May 3, 2010, 8:50:52 AM (16 years ago)
- Location:
- branches/simtest_nebulous_branches
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
ppStack/src (modified) (1 prop)
-
ppStack/src/ppStackSetup.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches
- Property svn:mergeinfo changed
-
branches/simtest_nebulous_branches/ppStack/src
- Property svn:ignore
-
old new 10 10 stamp-h1 11 11 ppStackVersionDefinitions.h 12 ppStackErrorCodes.c 13 ppStackErrorCodes.h
-
- Property svn:ignore
-
branches/simtest_nebulous_branches/ppStack/src/ppStackSetup.c
r23688 r27840 22 22 psAssert(recipe, "We've thrown an error on this before."); 23 23 24 // XXX : switch to this name? options->matchZPs = psMetadataLookupBool(NULL, recipe, "MATCH.ZERO.POINTS"); // Adjust zero points based on tranparency analysis? 25 options->matchZPs = psMetadataLookupBool(NULL, recipe, "ZP"); // Adjust zero points? 26 27 options->photometry = psMetadataLookupBool(NULL, recipe, "PHOTOMETRY"); // Perform photometry? 28 24 29 options->convolve = psMetadataLookupBool(NULL, recipe, "CONVOLVE"); // Convolve images? 25 30 if (!psMetadataLookupBool(NULL, config->arguments, "HAVE.PSF")) { … … 37 42 options->statsFile = fopen(resolved, "w"); 38 43 if (!options->statsFile) { 39 psError(P S_ERR_IO, true, "Unable to open statistics file %s for writing.\n", resolved);44 psError(PPSTACK_ERR_IO, true, "Unable to open statistics file %s for writing.\n", resolved); 40 45 psFree(resolved); 41 46 return false; … … 43 48 psFree(resolved); 44 49 options->stats = psMetadataAlloc(); 45 psMetadataAddS32(options->stats, PS_LIST_TAIL, "QUALITY", 0, "No problems", 0);46 50 } 47 51 48 52 // Generate temporary names for convolved images 49 const char *tempDir = psMetadataLookupStr(NULL, recipe, "TEMP.DIR"); // Directory for temporary images53 const char *tempDir = psMetadataLookupStr(NULL, config->arguments, "-temp-dir"); // Directory for temps 50 54 if (!tempDir) { 51 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Unable to find TEMP.DIR in recipe"); 55 tempDir = psMetadataLookupStr(NULL, config->site, "TEMP.DIR"); 56 } 57 if (!tempDir) { 58 psError(PPSTACK_ERR_CONFIG, false, "Unable to find TEMP.DIR in site configuration"); 52 59 return false; 53 60 } … … 57 64 const char *tempName = basename(outputName); 58 65 if (!tempName) { 59 psError(P S_ERR_BAD_PARAMETER_VALUE, false, "Unable to construct basename for temporary files.");66 psError(PPSTACK_ERR_ARGUMENTS, false, "Unable to construct basename for temporary files."); 60 67 psFree(outputName); 61 68 return false; … … 66 73 const char *tempVariance = psMetadataLookupStr(NULL, recipe, "TEMP.VARIANCE"); // Suffix for var maps 67 74 if (!tempImage || !tempMask || !tempVariance) { 68 psError(P S_ERR_BAD_PARAMETER_VALUE, false,75 psError(PPSTACK_ERR_CONFIG, false, 69 76 "Unable to find TEMP.IMAGE, TEMP.MASK and TEMP.VARIANCE in recipe"); 70 77 psFree(outputName); … … 72 79 } 73 80 74 options-> imageNames = psArrayAlloc(num);75 options-> maskNames = psArrayAlloc(num);76 options-> varianceNames = psArrayAlloc(num);81 options->convImages = psArrayAlloc(num); 82 options->convMasks = psArrayAlloc(num); 83 options->convVariances = psArrayAlloc(num); 77 84 for (int i = 0; i < num; i++) { 78 85 psString imageName = NULL, maskName = NULL, varianceName = NULL; // Names for convolved images … … 81 88 psStringAppend(&varianceName, "%s/%s.%d.%s", tempDir, tempName, i, tempVariance); 82 89 psTrace("ppStack", 5, "Temporary files: %s %s %s\n", imageName, maskName, varianceName); 83 options-> imageNames->data[i] = imageName;84 options-> maskNames->data[i] = maskName;85 options-> varianceNames->data[i] = varianceName;90 options->convImages->data[i] = imageName; 91 options->convMasks->data[i] = maskName; 92 options->convVariances->data[i] = varianceName; 86 93 } 87 94 psFree(outputName); 88 95 96 // Original images 97 options->origImages = psArrayAlloc(num); 98 options->origMasks = psArrayAlloc(num); 99 options->origVariances = psArrayAlloc(num); 100 pmFPAview *view = pmFPAviewAlloc(0); 101 for (int i = 0; i < num; i++) { 102 { 103 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPSTACK.INPUT", i); 104 options->origImages->data[i] = pmFPAfileName(file, view, config); 105 } 106 { 107 // We want the convolved mask, since that defines the area that has been tested for outliers 108 options->origMasks->data[i] = psMemIncrRefCounter(options->convMasks->data[i]); 109 } 110 { 111 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPSTACK.INPUT.VARIANCE", i); 112 options->origVariances->data[i] = pmFPAfileName(file, view, config); 113 } 114 } 115 psFree(view); 116 89 117 if (!pmConfigMaskSetBits(NULL, NULL, config)) { 90 psError(P S_ERR_UNKNOWN, false, "Unable to determine mask value.");118 psError(PPSTACK_ERR_CONFIG, false, "Unable to determine mask value."); 91 119 return false; 92 120 }
Note:
See TracChangeset
for help on using the changeset viewer.
