IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 16, 2007, 5:54:43 PM (19 years ago)
Author:
Paul Price
Message:

Fixing binning when flipping.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPACopy.c

    r11869 r11871  
    249249        int xZero = psMetadataLookupS32(NULL, source->concepts, "CELL.X0"); // CELL.X0 from source
    250250        int xParity = psMetadataLookupS32(NULL, source->concepts, "CELL.XPARITY"); // Parity in x
    251         int xBin = psMetadataLookupS32(NULL, source->concepts, "CELL.XBIN"); // CELL.XBIN from source
     251        int sourceBin = psMetadataLookupS32(NULL, source->concepts, "CELL.XBIN"); // CELL.XBIN from source
    252252        int xSize = psMetadataLookupS32(NULL, source->concepts, "CELL.XSIZE"); // CELL.XSIZE of source
    253253
     254        if (sourceBin == 0) {
     255            // Don't know the binning; assume it is unity
     256            sourceBin = xBin;
     257        }
     258
    254259        psTrace("psModules.camera", 3, "CELL.X0: Before: %d After: %d\n", xZero,
    255                 xZero + (xSize - 1) * xParity * xBin);
    256         psTrace("psModules.camera", 9, "(xParity: %d xBin: %d numCols: %d)\n", xParity, xBin, xSize);
    257 
    258         if (xParity == 0 || xBin == 0 || xSize == 0) {
    259             psWarning("New CELL.X0 may be incorrect due to missing concepts "
    260                       "(CELL.X0, CELL.XPARITY, CELL.XBIN, CELL.XSIZE)");
    261         }
    262 
    263         xZero += (xSize - 1) * xParity * xBin; // Change the parity on the X0 position
     260                xZero + (xSize - 1) * xParity * sourceBin);
     261        psTrace("psModules.camera", 9, "(xParity: %d xBin: %d numCols: %d)\n", xParity, sourceBin, xSize);
     262
     263        if (xParity == 0 || xSize == 0) {
     264            psWarning("New CELL.X0 may be incorrect due to missing concepts (CELL.XPARITY, CELL.XSIZE)");
     265        }
     266
     267        xZero += (xSize - 1) * xParity * sourceBin; // Change the parity on the X0 position
    264268        psMetadataItem *newItem = psMetadataLookup(target->concepts, "CELL.X0"); // CELL.X0 from target
    265269        newItem->data.S32 = xZero;
     
    268272        int yZero = psMetadataLookupS32(NULL, source->concepts, "CELL.Y0"); // CELL.Y0 from source
    269273        int yParity = psMetadataLookupS32(NULL, source->concepts, "CELL.YPARITY"); // Parity in y
    270         int yBin = psMetadataLookupS32(NULL, source->concepts, "CELL.YBIN"); // Binning in y
     274        int sourceBin = psMetadataLookupS32(NULL, source->concepts, "CELL.YBIN"); // Binning in y
    271275        int ySize = psMetadataLookupS32(NULL, source->concepts, "CELL.YSIZE"); // CELL.YSIZE of source
    272276
     277        if (sourceBin == 0) {
     278            // Don't know the binning; assume it is unity
     279            sourceBin = yBin;
     280        }
     281
    273282        psTrace("psModules.camera", 3, "CELL.Y0: Before: %d After: %d\n", yZero,
    274                 yZero + (ySize - 1) * yParity * yBin);
    275         psTrace("psModules.camera", 9, "(yParity: %d yBin: %d numRows: %d)\n", yParity, yBin, ySize);
    276 
    277         if (yParity == 0 || yBin == 0 || ySize == 0) {
     283                yZero + (ySize - 1) * yParity * sourceBin);
     284        psTrace("psModules.camera", 9, "(yParity: %d yBin: %d numRows: %d)\n", yParity, sourceBin, ySize);
     285
     286        if (yParity == 0 || ySize == 0) {
    278287            psWarning("New CELL.Y0 may be incorrect due to missing concepts "
    279288                      "(CELL.Y0, CELL.YPARITY, CELL.YBIN, CELL.YSIZE)");
    280289        }
    281290
    282         yZero += (ySize - 1) * yParity * yBin; // Change the parity on the Y0 position
     291        yZero += (ySize - 1) * yParity * sourceBin; // Change the parity on the Y0 position
    283292        psMetadataItem *newItem = psMetadataLookup(target->concepts, "CELL.Y0"); // CELL.Y0 from target
    284293        newItem->data.S32 = yZero;
Note: See TracChangeset for help on using the changeset viewer.