- Timestamp:
- Jan 28, 2009, 5:24:09 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/pap_branch_20090128/ppMerge/src/ppMergeCamera.c
r18967 r21219 82 82 { 83 83 bool haveMasks = false; // Do we have masks? 84 bool have Weights = false; // Do we have weightmaps?84 bool haveVariances = false; // Do we have variance maps? 85 85 86 86 ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); // Type of frame … … 108 108 bool mdok; 109 109 psString mask = psMetadataLookupStr(&mdok, input, "MASK"); // Name of mask 110 psString weight = psMetadataLookupStr(&mdok, input, "WEIGHT"); // Name of weightmap110 psString variance = psMetadataLookupStr(&mdok, input, "VARIANCE"); // Name of variance map 111 111 112 112 // Add the image file … … 150 150 } 151 151 152 // Optionally add the weightfile153 if ( weight && strlen(weight) > 0) {154 have Weights = true;155 psArray * weightFiles = psArrayAlloc(1); // Array of filenames for this FPA156 weightFiles->data[0] = psMemIncrRefCounter(weight);157 psMetadataAddArray(config->arguments, PS_LIST_TAIL, " WEIGHT.FILENAMES", PS_META_REPLACE,158 "Filenames of weight files", weightFiles);159 psFree( weightFiles);152 // Optionally add the variance file 153 if (variance && strlen(variance) > 0) { 154 haveVariances = true; 155 psArray *varianceFiles = psArrayAlloc(1); // Array of filenames for this FPA 156 varianceFiles->data[0] = psMemIncrRefCounter(variance); 157 psMetadataAddArray(config->arguments, PS_LIST_TAIL, "VARIANCE.FILENAMES", PS_META_REPLACE, 158 "Filenames of variance files", varianceFiles); 159 psFree(varianceFiles); 160 160 161 161 bool status; 162 pmFPAfile * weightFile = pmFPAfileBindFromArgs(&status, imageFile, config, "PPMERGE.INPUT.WEIGHT",163 "WEIGHT.FILENAMES");162 pmFPAfile *varianceFile = pmFPAfileBindFromArgs(&status, imageFile, config, 163 "PPMERGE.INPUT.VARIANCE", "VARIANCE.FILENAMES"); 164 164 if (!status) { 165 psError(PS_ERR_UNKNOWN, false, "Unable to define file from weight %d (%s)", numFiles, weight); 166 return false; 167 } 168 if (weightFile->type != PM_FPA_FILE_WEIGHT) { 169 psError(PS_ERR_IO, true, "PPMERGE.INPUT.WEIGHT is not of type WEIGHT"); 170 return false; 171 } 172 haveWeights = true; 165 psError(PS_ERR_UNKNOWN, false, "Unable to define file from variance %d (%s)", 166 numFiles, variance); 167 return false; 168 } 169 if (varianceFile->type != PM_FPA_FILE_VARIANCE) { 170 psError(PS_ERR_IO, true, "PPMERGE.INPUT.VARIANCE is not of type VARIANCE"); 171 return false; 172 } 173 haveVariances = true; 173 174 } 174 175 … … 180 181 psMetadataRemoveKey(config->arguments, "MASK.FILENAMES"); 181 182 } 182 if (psMetadataLookup(config->arguments, " WEIGHT.FILENAMES")) {183 psMetadataRemoveKey(config->arguments, " WEIGHT.FILENAMES");183 if (psMetadataLookup(config->arguments, "VARIANCE.FILENAMES")) { 184 psMetadataRemoveKey(config->arguments, "VARIANCE.FILENAMES"); 184 185 } 185 186 if (psMetadataLookup(config->arguments, "PSF.FILENAMES")) { … … 189 190 psMetadataAddS32(config->arguments, PS_LIST_TAIL, "INPUTS.NUM", 0, "Number of input files", numFiles); 190 191 psMetadataAddBool(config->arguments, PS_LIST_TAIL, "INPUTS.MASKS", 0, "Got input masks?", haveMasks); 191 psMetadataAddBool(config->arguments, PS_LIST_TAIL, "INPUTS. WEIGHTS", 0,192 "Got input weights?", haveWeights);192 psMetadataAddBool(config->arguments, PS_LIST_TAIL, "INPUTS.VARIANCES", 0, 193 "Got input variances?", haveVariances); 193 194 194 195
Note:
See TracChangeset
for help on using the changeset viewer.
