Changeset 21365 for trunk/ppMerge/src/ppMergeCamera.c
- Timestamp:
- Feb 5, 2009, 4:47:00 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ppMerge/src/ppMergeCamera.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppMerge/src/ppMergeCamera.c
r21244 r21365 6 6 * 7 7 * @author IfA 8 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2009-02-0 1 21:43:05$8 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-02-06 02:44:31 $ 10 10 * Copyright 2009 Institute for Astronomy, University of Hawaii 11 11 */ … … 96 96 { 97 97 bool haveMasks = false; // Do we have masks? 98 bool have Weights = false; // Do we have weightmaps?98 bool haveVariances = false; // Do we have variance maps? 99 99 100 100 ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); ///< Type of frame … … 121 121 122 122 bool mdok; 123 psString mask = psMetadataLookupStr(&mdok, input, "MASK"); // /<Name of mask124 psString weight = psMetadataLookupStr(&mdok, input, "WEIGHT"); ///< Name of weightmap123 psString mask = psMetadataLookupStr(&mdok, input, "MASK"); // Name of mask 124 psString variance = psMetadataLookupStr(&mdok, input, "VARIANCE"); // Name of variance map 125 125 126 126 // Add the image file … … 164 164 } 165 165 166 // Optionally add the weightfile167 if ( weight && strlen(weight) > 0) {168 have Weights = true;169 psArray * weightFiles = psArrayAlloc(1); ///<Array of filenames for this FPA170 weightFiles->data[0] = psMemIncrRefCounter(weight);171 psMetadataAddArray(config->arguments, PS_LIST_TAIL, " WEIGHT.FILENAMES", PS_META_REPLACE,172 "Filenames of weight files", weightFiles);173 psFree( weightFiles);166 // Optionally add the variance file 167 if (variance && strlen(variance) > 0) { 168 haveVariances = true; 169 psArray *varianceFiles = psArrayAlloc(1); // Array of filenames for this FPA 170 varianceFiles->data[0] = psMemIncrRefCounter(variance); 171 psMetadataAddArray(config->arguments, PS_LIST_TAIL, "VARIANCE.FILENAMES", PS_META_REPLACE, 172 "Filenames of variance files", varianceFiles); 173 psFree(varianceFiles); 174 174 175 175 bool status; 176 pmFPAfile * weightFile = pmFPAfileBindFromArgs(&status, imageFile, config, "PPMERGE.INPUT.WEIGHT",177 "WEIGHT.FILENAMES");176 pmFPAfile *varianceFile = pmFPAfileBindFromArgs(&status, imageFile, config, 177 "PPMERGE.INPUT.VARIANCE", "VARIANCE.FILENAMES"); 178 178 if (!status) { 179 psError(PS_ERR_UNKNOWN, false, "Unable to define file from weight %d (%s)", numFiles, weight); 180 return false; 181 } 182 if (weightFile->type != PM_FPA_FILE_WEIGHT) { 183 psError(PS_ERR_IO, true, "PPMERGE.INPUT.WEIGHT is not of type WEIGHT"); 184 return false; 185 } 186 haveWeights = true; 179 psError(PS_ERR_UNKNOWN, false, "Unable to define file from variance %d (%s)", 180 numFiles, variance); 181 return false; 182 } 183 if (varianceFile->type != PM_FPA_FILE_VARIANCE) { 184 psError(PS_ERR_IO, true, "PPMERGE.INPUT.VARIANCE is not of type VARIANCE"); 185 return false; 186 } 187 haveVariances = true; 187 188 } 188 189 … … 194 195 psMetadataRemoveKey(config->arguments, "MASK.FILENAMES"); 195 196 } 196 if (psMetadataLookup(config->arguments, " WEIGHT.FILENAMES")) {197 psMetadataRemoveKey(config->arguments, " WEIGHT.FILENAMES");197 if (psMetadataLookup(config->arguments, "VARIANCE.FILENAMES")) { 198 psMetadataRemoveKey(config->arguments, "VARIANCE.FILENAMES"); 198 199 } 199 200 if (psMetadataLookup(config->arguments, "PSF.FILENAMES")) { … … 203 204 psMetadataAddS32(config->arguments, PS_LIST_TAIL, "INPUTS.NUM", 0, "Number of input files", numFiles); 204 205 psMetadataAddBool(config->arguments, PS_LIST_TAIL, "INPUTS.MASKS", 0, "Got input masks?", haveMasks); 205 psMetadataAddBool(config->arguments, PS_LIST_TAIL, "INPUTS. WEIGHTS", 0,206 "Got input weights?", haveWeights);206 psMetadataAddBool(config->arguments, PS_LIST_TAIL, "INPUTS.VARIANCES", 0, 207 "Got input variances?", haveVariances); 207 208 208 209
Note:
See TracChangeset
for help on using the changeset viewer.
