Changeset 12654 for trunk/psModules/src/concepts/pmConceptsAverage.c
- Timestamp:
- Mar 28, 2007, 1:45:31 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/concepts/pmConceptsAverage.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/concepts/pmConceptsAverage.c
r12653 r12654 22 22 // Set a variety of concepts in a cell by averaging over several 23 23 // XXX does not properly set XSIZE, YSIZE 24 bool pmConceptsAverageCells(pmCell *target, psList *sources, psRegion *trimsec, psRegion *biassec )24 bool pmConceptsAverageCells(pmCell *target, psList *sources, psRegion *trimsec, psRegion *biassec, bool same) 25 25 { 26 26 PS_ASSERT_PTR_NON_NULL(target, false); … … 61 61 xBin = psMetadataLookupS32(NULL, cell->concepts, "CELL.XBIN"); 62 62 yBin = psMetadataLookupS32(NULL, cell->concepts, "CELL.YBIN"); 63 x0 = psMetadataLookupS32(NULL, cell->concepts, "CELL.X0"); 64 y0 = psMetadataLookupS32(NULL, cell->concepts, "CELL.Y0"); 63 64 if (same) { 65 // Only makes sense to update these if they are the same cell 66 x0 = psMetadataLookupS32(NULL, cell->concepts, "CELL.X0"); 67 y0 = psMetadataLookupS32(NULL, cell->concepts, "CELL.Y0"); 68 } 65 69 } else { 66 70 if (timeSys != psMetadataLookupS32(NULL, cell->concepts, "CELL.TIMESYS")) { … … 84 88 success = false; 85 89 } 86 if (x0 != psMetadataLookupS32(NULL, cell->concepts, "CELL.X0")) { 87 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Differing CELL.X0 in use: %d vs %d\n", 88 x0, psMetadataLookupS32(NULL, cell->concepts, "CELL.X0")); 89 success = false; 90 } 91 if (y0 != psMetadataLookupS32(NULL, cell->concepts, "CELL.Y0")) { 92 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Differing CELL.Y0 in use: %d vs %d\n", 93 y0, psMetadataLookupS32(NULL, cell->concepts, "CELL.Y0")); 94 success = false; 90 if (same) { 91 if (x0 != psMetadataLookupS32(NULL, cell->concepts, "CELL.X0")) { 92 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Differing CELL.X0 in use: %d vs %d\n", 93 x0, psMetadataLookupS32(NULL, cell->concepts, "CELL.X0")); 94 success = false; 95 } 96 if (y0 != psMetadataLookupS32(NULL, cell->concepts, "CELL.Y0")) { 97 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Differing CELL.Y0 in use: %d vs %d\n", 98 y0, psMetadataLookupS32(NULL, cell->concepts, "CELL.Y0")); 99 success = false; 100 } 95 101 } 96 102 } … … 123 129 MD_UPDATE(target->concepts, "CELL.XBIN", S32, xBin); 124 130 MD_UPDATE(target->concepts, "CELL.YBIN", S32, yBin); 125 MD_UPDATE(target->concepts, "CELL.X0", S32, x0); 126 MD_UPDATE(target->concepts, "CELL.Y0", S32, y0); 131 if (same) { 132 MD_UPDATE(target->concepts, "CELL.X0", S32, x0); 133 MD_UPDATE(target->concepts, "CELL.Y0", S32, y0); 134 } 127 135 128 136 // CELL.TIME needs special care
Note:
See TracChangeset
for help on using the changeset viewer.
