IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 5, 2006, 2:28:28 PM (20 years ago)
Author:
Paul Price
Message:

Reworking pmFPAAddSource for better code maintainance, and to implement PHU=FPA,EXT=NONE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/rel10_ifa/psModules/src/astrom/pmFPACopy.c

    r6745 r6804  
    470470    bool yFlip = (psMetadataLookupS32(NULL, target->concepts, "CELL.YPARITY") !=
    471471                  psMetadataLookupS32(NULL, source->concepts, "CELL.YPARITY")); // Switch parity in y?
     472    psTrace(__func__, 3, "xFlip: %d; yFlip: %d\n", xFlip, yFlip);
    472473
    473474    bool mdok = true;                   // Status of MD lookup
     
    535536        psString name = conceptItem->name; // Name of concept
    536537        if (strcmp(name, "CELL.TRIMSEC") != 0 && strcmp(name, "CELL.BIASSEC") != 0 &&
    537                 strcmp(name, "CELL.XPARITY") != 0 && strcmp(name, "CELL.YPARITY") != 0) {
     538                strcmp(name, "CELL.XPARITY") != 0 && strcmp(name, "CELL.YPARITY") != 0 &&
     539                strcmp(name, "CELL.X0") != 0 && strcmp(name, "CELL.Y0") != 0) {
    538540            psMetadataAddItem(target->concepts, conceptItem, PS_LIST_TAIL, PS_META_REPLACE);
    539541        }
     
    543545    // Need to update CELL.X0 and CELL.Y0 if we flipped
    544546    if (xFlip) {
    545         psMetadataItem *xZero = psMetadataLookup(target->concepts, "CELL.X0"); // CELL.X0
     547        int xZero = psMetadataLookupS32(NULL, source->concepts, "CELL.X0"); // CELL.X0 from source
     548        int xParity = psMetadataLookupS32(NULL, target->concepts, "CELL.XPARITY"); // Parity in x
    546549        pmReadout *readout = target->readouts->data[0]; // A representative readout
    547         xZero->data.S32 -= readout->image->numCols - 1;
     550        psTrace(__func__, 3, "CELL.X0: Before: %d After: %d\n", xZero,
     551                xZero - (readout->image->numCols - 1) * xParity);
     552        xZero -= (readout->image->numCols - 1) * xParity; // Change the parity on the X0 position
     553        psMetadataItem *newItem = psMetadataLookup(target->concepts, "CELL.X0"); // CELL.X0 from target
     554        newItem->data.S32 = xZero;
    548555    }
    549556    if (yFlip) {
    550         psMetadataItem *yZero = psMetadataLookup(target->concepts, "CELL.Y0"); // CELL.Y0
     557        int yZero = psMetadataLookupS32(NULL, source->concepts, "CELL.Y0"); // CELL.Y0 from source
     558        int yParity = psMetadataLookupS32(NULL, target->concepts, "CELL.YPARITY"); // Parity in y
    551559        pmReadout *readout = target->readouts->data[0]; // A representative readout
    552         yZero->data.S32 -= readout->image->numRows - 1;
     560        psTrace(__func__, 3, "CELL.Y0: Before: %d After: %d\n", yZero,
     561                yZero - (readout->image->numCols - 1) * yParity);
     562        yZero -= (readout->image->numCols - 1) * yParity; // Change the parity on the Y0 position
     563        psMetadataItem *newItem = psMetadataLookup(target->concepts, "CELL.Y0"); // CELL.Y0 from target
     564        newItem->data.S32 = yZero;
    553565    }
    554566
Note: See TracChangeset for help on using the changeset viewer.