Changeset 21365 for trunk/ppMerge/src/ppMergeFiles.c
- Timestamp:
- Feb 5, 2009, 4:47:00 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ppMerge/src/ppMergeFiles.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppMerge/src/ppMergeFiles.c
r21244 r21365 6 6 * 7 7 * @author IfA 8 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2009-02-0 1 21:43:05$8 * @version $Revision: 1.8 $ $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 */ … … 13 13 #include "ppMerge.h" 14 14 15 const char *allFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT. WEIGHT",15 const char *allFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.VARIANCE", 16 16 "PPMERGE.OUTPUT", "PPMERGE.OUTPUT.COUNT", "PPMERGE.OUTPUT.SIGMA", 17 NULL }; // /<All files18 const char *inputFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT. WEIGHT",19 NULL }; // /<Input files17 NULL }; // All files 18 const char *inputFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.VARIANCE", 19 NULL }; // Input files 20 20 const char *outputFiles[] = { "PPMERGE.OUTPUT", "PPMERGE.OUTPUT.COUNT", "PPMERGE.OUTPUT.SIGMA", 21 21 NULL }; ///< Output files … … 51 51 } 52 52 } 53 if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS. WEIGHTS")) {54 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT. WEIGHT", num);55 if (!pmReadoutReadChunk Weight(readout, file->fits, 0, rows, 0, config)) {56 psError(PS_ERR_UNKNOWN, false, "Unable to read readout weight.");53 if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES")) { 54 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.VARIANCE", num); 55 if (!pmReadoutReadChunkVariance(readout, file->fits, 0, rows, 0, config)) { 56 psError(PS_ERR_UNKNOWN, false, "Unable to read readout variance."); 57 57 return false; 58 58 } … … 91 91 psFree(fileView); 92 92 } 93 if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS")) { 94 pmFPAfile *weight = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.WEIGHT", num); // Weight file 95 pmFPAview *fileView = pmFPAviewForLevel(weight->fileLevel, view); 96 if (!pmFPAfileOpen(weight, fileView, config)) { 97 psError(PS_ERR_UNKNOWN, false, "Unable to open weight file %d", num); 93 if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES")) { 94 pmFPAfile *variance = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.VARIANCE", 95 num); // Variance file 96 pmFPAview *fileView = pmFPAviewForLevel(variance->fileLevel, view); 97 if (!pmFPAfileOpen(variance, fileView, config)) { 98 psError(PS_ERR_UNKNOWN, false, "Unable to open variance file %d", num); 98 99 psFree(fileView); 99 100 return false; … … 127 128 bool mdok; // Status of MD lookup 128 129 bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); // Do we have masks? 129 bool have Weights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS"); // Got weights?130 bool haveVariances = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES"); // Got variances? 130 131 131 132 const char **fileList = selectFiles(files); // Files to activate … … 134 135 continue; 135 136 } 136 if (!have Weights && strcmp(fileList[i], "PPMERGE.INPUT.WEIGHT") == 0) {137 if (!haveVariances && strcmp(fileList[i], "PPMERGE.INPUT.VARIANCE") == 0) { 137 138 continue; 138 139 } … … 163 164 bool mdok; // Status of MD lookup 164 165 bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); // Do we have masks? 165 bool have Weights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS"); // Got weights?166 bool haveVariances = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES"); // Got variances? 166 167 167 168 psList *list = psListAlloc(NULL); // List of files … … 171 172 continue; 172 173 } 173 if (!have Weights && strcmp(fileList[i], "PPMERGE.INPUT.WEIGHT") == 0) {174 if (!haveVariances && strcmp(fileList[i], "PPMERGE.INPUT.VARIANCE") == 0) { 174 175 continue; 175 176 }
Note:
See TracChangeset
for help on using the changeset viewer.
