IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11865


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.

Location:
trunk/psModules/src
Files:
3 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) {
  • trunk/psModules/src/concepts/pmConcepts.c

    r11749 r11865  
    639639        }
    640640
     641        // CHIP.XSIZE
     642        {
     643            psMetadataItem *chipXsize = psMetadataItemAllocS32("CHIP.XSIZE", "Size of chip (pixels)", 0);
     644            pmConceptRegister(chipXsize, NULL, NULL, PM_FPA_LEVEL_CHIP);
     645            psFree(chipXsize);
     646        }
     647
     648        // CHIP.YSIZE
     649        {
     650            psMetadataItem *chipYsize = psMetadataItemAllocS32("CHIP.YSIZE", "Size of chip (pixels)", 0);
     651            pmConceptRegister(chipYsize, NULL, NULL, PM_FPA_LEVEL_CHIP);
     652            psFree(chipYsize);
     653        }
     654
    641655        // CHIP.TEMP
    642656        {
     
    808822        }
    809823
     824        // CELL.XSIZE
     825        {
     826            psMetadataItem *cellXsize = psMetadataItemAllocS32("CELL.XSIZE", "Size of cell (pixels)", 0);
     827            pmConceptRegister(cellXsize, NULL, NULL, PM_FPA_LEVEL_CELL);
     828            psFree(cellXsize);
     829        }
     830
     831        // CELL.YSIZE
     832        {
     833            psMetadataItem *cellYsize = psMetadataItemAllocS32("CELL.YSIZE", "Size of cell (pixels)", 0);
     834            pmConceptRegister(cellYsize, NULL, NULL, PM_FPA_LEVEL_CELL);
     835            psFree(cellYsize);
     836        }
    810837    }
    811838
  • trunk/psModules/src/concepts/pmConceptsRead.c

    r11749 r11865  
    4848    }
    4949}
    50 
    5150
    5251// Parse a single concept
Note: See TracChangeset for help on using the changeset viewer.