IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 16, 2007, 4:36:38 PM (19 years ago)
Author:
Paul Price
Message:

pmFPACopy was using a readout to give the size of a cell (when flipping the parity), so that if the readout wasn't present it would SEGV. Added new concepts CELL.XSIZE, CELL.YSIZE, CHIP.XSIZE, CHIP.YSIZE for the size of the various components.

File:
1 edited

Legend:

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

    r11435 r11865  
    250250        int xParity = psMetadataLookupS32(NULL, target->concepts, "CELL.XPARITY"); // Parity in x
    251251        int xBin = psMetadataLookupS32(NULL, source->concepts, "CELL.XBIN"); // CELL.XBIN from source
    252         pmReadout *readout = source->readouts->data[0]; // A representative readout
     252        int xSize = psMetadataLookupS32(NULL, source->concepts, "CELL.XSIZE"); // CELL.XSIZE of source
     253
    253254        psTrace("psModules.camera", 3, "CELL.X0: Before: %d After: %d\n", xZero,
    254                 xZero - (readout->image->numCols - 1) * xParity * xBin);
    255         psTrace("psModules.camera", 9, "(xParity: %d xBin: %d numCols: %d)\n",
    256                 xParity, xBin, readout->image->numCols);
    257         xZero -= (readout->image->numCols - 1) * xParity * xBin; // Change the parity on the X0 position
     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
    258264        psMetadataItem *newItem = psMetadataLookup(target->concepts, "CELL.X0"); // CELL.X0 from target
    259265        newItem->data.S32 = xZero;
     
    262268        int yZero = psMetadataLookupS32(NULL, source->concepts, "CELL.Y0"); // CELL.Y0 from source
    263269        int yParity = psMetadataLookupS32(NULL, target->concepts, "CELL.YPARITY"); // Parity in y
    264         int yBin = psMetadataLookupS32(NULL, source->concepts, "CELL.YBIN"); // Parity in y
    265         pmReadout *readout = source->readouts->data[0]; // A representative readout
     270        int yBin = psMetadataLookupS32(NULL, source->concepts, "CELL.YBIN"); // Binning in y
     271        int ySize = psMetadataLookupS32(NULL, source->concepts, "CELL.YSIZE"); // CELL.YSIZE of source
     272
    266273        psTrace("psModules.camera", 3, "CELL.Y0: Before: %d After: %d\n", yZero,
    267                 yZero - (readout->image->numRows - 1) * yParity * yBin);
    268         psTrace("psModules.camera", 9, "(yParity: %d yBin: %d numRows: %d)\n",
    269                 yParity, yBin, readout->image->numRows);
    270         yZero -= (readout->image->numRows - 1) * yParity * yBin; // Change the parity on the Y0 position
     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) {
     278            psWarning("New CELL.Y0 may be incorrect due to missing concepts "
     279                      "(CELL.Y0, CELL.YPARITY, CELL.YBIN, CELL.YSIZE)");
     280        }
     281
     282        yZero -= (ySize - 1) * yParity * yBin; // Change the parity on the Y0 position
    271283        psMetadataItem *newItem = psMetadataLookup(target->concepts, "CELL.Y0"); // CELL.Y0 from target
    272284        newItem->data.S32 = yZero;
     
    297309            targetPHU->header = psMetadataAlloc();
    298310        }
    299         //        pmHDU *sourcePHU = pmHDUGetHighest(source->parent->parent, source->parent, source); // A source HDU
     311//        pmHDU *sourcePHU = pmHDUGetHighest(source->parent->parent, source->parent, source); // A source HDU
    300312        pmHDU *sourcePHU = findBlankPHU(source); // The target PHU
    301313        if (sourcePHU && sourcePHU->header) {
Note: See TracChangeset for help on using the changeset viewer.