IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 28, 2007, 1:45:31 PM (19 years ago)
Author:
Paul Price
Message:

Distinguishing between mosaicking (different cells within the same chip) and stacking (same cells within different chips) for concept averaging.

File:
1 edited

Legend:

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

    r12653 r12654  
    2222// Set a variety of concepts in a cell by averaging over several
    2323// XXX does not properly set XSIZE, YSIZE
    24 bool pmConceptsAverageCells(pmCell *target, psList *sources, psRegion *trimsec, psRegion *biassec)
     24bool pmConceptsAverageCells(pmCell *target, psList *sources, psRegion *trimsec, psRegion *biassec, bool same)
    2525{
    2626    PS_ASSERT_PTR_NON_NULL(target, false);
     
    6161            xBin    = psMetadataLookupS32(NULL, cell->concepts, "CELL.XBIN");
    6262            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            }
    6569        } else {
    6670            if (timeSys != psMetadataLookupS32(NULL, cell->concepts, "CELL.TIMESYS")) {
     
    8488                success = false;
    8589            }
    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                }
    95101            }
    96102        }
     
    123129    MD_UPDATE(target->concepts, "CELL.XBIN", S32, xBin);
    124130    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    }
    127135
    128136    // CELL.TIME needs special care
Note: See TracChangeset for help on using the changeset viewer.