Changeset 21219 for branches/pap_branch_20090128/ppMerge/src/ppMergeFiles.c
- Timestamp:
- Jan 28, 2009, 5:24:09 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/pap_branch_20090128/ppMerge/src/ppMergeFiles.c
r20887 r21219 1 1 #include "ppMerge.h" 2 2 3 const char *allFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT. WEIGHT",3 const char *allFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.VARIANCE", 4 4 "PPMERGE.OUTPUT", "PPMERGE.OUTPUT.COUNT", "PPMERGE.OUTPUT.SIGMA", 5 5 NULL }; // All files 6 const char *inputFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT. WEIGHT",6 const char *inputFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.VARIANCE", 7 7 NULL }; // Input files 8 8 const char *outputFiles[] = { "PPMERGE.OUTPUT", "PPMERGE.OUTPUT.COUNT", "PPMERGE.OUTPUT.SIGMA", … … 37 37 } 38 38 } 39 if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS. WEIGHTS")) {40 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT. WEIGHT", num);41 if (!pmReadoutReadChunk Weight(readout, file->fits, 0, rows, 0, config)) {42 psError(PS_ERR_UNKNOWN, false, "Unable to read readout weight.");39 if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES")) { 40 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.VARIANCE", num); 41 if (!pmReadoutReadChunkVariance(readout, file->fits, 0, rows, 0, config)) { 42 psError(PS_ERR_UNKNOWN, false, "Unable to read readout variance."); 43 43 return false; 44 44 } … … 77 77 psFree(fileView); 78 78 } 79 if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS")) { 80 pmFPAfile *weight = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.WEIGHT", num); // Weight file 81 pmFPAview *fileView = pmFPAviewForLevel(weight->fileLevel, view); 82 if (!pmFPAfileOpen(weight, fileView, config)) { 83 psError(PS_ERR_UNKNOWN, false, "Unable to open weight file %d", num); 79 if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES")) { 80 pmFPAfile *variance = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.VARIANCE", 81 num); // Variance file 82 pmFPAview *fileView = pmFPAviewForLevel(variance->fileLevel, view); 83 if (!pmFPAfileOpen(variance, fileView, config)) { 84 psError(PS_ERR_UNKNOWN, false, "Unable to open variance file %d", num); 84 85 psFree(fileView); 85 86 return false; … … 113 114 bool mdok; // Status of MD lookup 114 115 bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); // Do we have masks? 115 bool have Weights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS"); // Got weights?116 bool haveVariances = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES"); // Got variances? 116 117 117 118 const char **fileList = selectFiles(files); // Files to activate … … 120 121 continue; 121 122 } 122 if (!have Weights && strcmp(fileList[i], "PPMERGE.INPUT.WEIGHT") == 0) {123 if (!haveVariances && strcmp(fileList[i], "PPMERGE.INPUT.VARIANCE") == 0) { 123 124 continue; 124 125 } … … 149 150 bool mdok; // Status of MD lookup 150 151 bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); // Do we have masks? 151 bool have Weights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS"); // Got weights?152 bool haveVariances = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES"); // Got variances? 152 153 153 154 psList *list = psListAlloc(NULL); // List of files … … 157 158 continue; 158 159 } 159 if (!have Weights && strcmp(fileList[i], "PPMERGE.INPUT.WEIGHT") == 0) {160 if (!haveVariances && strcmp(fileList[i], "PPMERGE.INPUT.VARIANCE") == 0) { 160 161 continue; 161 162 }
Note:
See TracChangeset
for help on using the changeset viewer.
