IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18608


Ignore:
Timestamp:
Jul 17, 2008, 3:45:43 PM (18 years ago)
Author:
Paul Price
Message:

nChips is zero-indexed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/concepts/pmConceptsAverage.c

    r17424 r18608  
    232232    PS_ASSERT_INT_POSITIVE(sources->n, false);
    233233
    234     float temp       = 0.0;             // Temperature
     234    float temp = 0.0;                   // Temperature
    235235    int x0 = 0, y0 = 0;                 // Offset
    236236    int xParity = 0, yParity = 0;       // Parity
    237     int xSize = 0, ySize = 0;
    238     psString    id = NULL;
    239 
    240     int nChips = 0;                     // Number of cells;
     237    int xSize = 0, ySize = 0;           // Size
     238    psString id = NULL;                 // Identifier
     239
     240    int nChips = 0;                     // Number of chips;
    241241    psListIterator *sourcesIter = psListIteratorAlloc(sources, PS_LIST_HEAD, false); // Iterator for sources
    242     pmChip *chip = NULL;                // Source cell from iteration
     242    pmChip *chip = NULL;                // Source chip from iteration
    243243    while ((chip = psListGetAndIncrement(sourcesIter))) {
    244244        if (!chip) {
     
    246246        }
    247247        temp += psMetadataLookupF32(NULL, chip->concepts, "CHIP.TEMP");
    248         if (nChips == 1) {
     248        if (nChips == 0) {
    249249            xSize = psMetadataLookupS32(NULL, chip->concepts, "CHIP.XSIZE");
    250250            ySize = psMetadataLookupS32(NULL, chip->concepts, "CHIP.YSIZE");
     
    256256        } else {
    257257            if (xSize != psMetadataLookupS32(NULL, chip->concepts, "CHIP.XSIZE")) {
    258                 psWarning("Differing CHIP.XSIZE in use: %d vs %d\n", 
     258                psWarning("Differing CHIP.XSIZE in use: %d vs %d\n",
    259259                    xSize, psMetadataLookupS32(NULL, chip->concepts, "CHIP.XSIZE"));
    260260            }
    261261            if (ySize != psMetadataLookupS32(NULL, chip->concepts, "CHIP.YSIZE")) {
    262                 psWarning("Differing CHIP.YSIZE in use: %d vs %d\n", 
     262                psWarning("Differing CHIP.YSIZE in use: %d vs %d\n",
    263263                    ySize, psMetadataLookupS32(NULL, chip->concepts, "CHIP.YSIZE"));
    264264            }
    265265            if (xParity != psMetadataLookupS32(NULL, chip->concepts, "CHIP.XPARITY")) {
    266                 psWarning("Differing CHIP.XPARITY in use: %d vs %d\n", 
     266                psWarning("Differing CHIP.XPARITY in use: %d vs %d\n",
    267267                    xParity, psMetadataLookupS32(NULL, chip->concepts, "CHIP.XPARITY"));
    268268            }
    269269            if (yParity != psMetadataLookupS32(NULL, chip->concepts, "CHIP.YPARITY")) {
    270                 psWarning("Differing CHIP.YPARITY in use: %d vs %d\n", 
     270                psWarning("Differing CHIP.YPARITY in use: %d vs %d\n",
    271271                    yParity, psMetadataLookupS32(NULL, chip->concepts, "CHIP.YPARITY"));
    272272            }
    273273            if (x0 != psMetadataLookupS32(NULL, chip->concepts, "CHIP.X0")) {
    274                 psWarning("Differing CHIP.X0 in use: %d vs %d\n", 
     274                psWarning("Differing CHIP.X0 in use: %d vs %d\n",
    275275                    x0, psMetadataLookupS32(NULL, chip->concepts, "CHIP.X0"));
    276276            }
    277277            if (y0 != psMetadataLookupS32(NULL, chip->concepts, "CHIP.Y0")) {
    278                 psWarning("Differing CHIP.Y0 in use: %d vs %d\n", 
     278                psWarning("Differing CHIP.Y0 in use: %d vs %d\n",
    279279                    y0, psMetadataLookupS32(NULL, chip->concepts, "CHIP.Y0"));
    280280            }
     
    284284            }
    285285        }
    286    
     286
    287287        nChips++;
    288288    }
    289289    psFree(sourcesIter);
    290290
    291     temp      /= (float)nChips;
     291    temp /= (float)nChips;
    292292
    293293    MD_UPDATE(target->concepts, "CHIP.TEMP", F32, temp);
Note: See TracChangeset for help on using the changeset viewer.