IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 23, 2007, 6:01:33 PM (19 years ago)
Author:
Paul Price
Message:

Need to add NAXIS1,NAXIS2 to the header after chip mosaic, so that CMF files know the proper extent of the chip.

File:
1 edited

Legend:

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

    r12710 r13499  
    1010    PS_ASSERT_PTR_NON_NULL(readout, NULL);
    1111
    12     if (readout->image) {
    13         return psRegionAlloc(readout->col0, readout->image->numCols,
    14                              readout->row0, readout->image->numRows);
     12    psImage *image = readout->image;    // Image from which to get dimensions
     13    if (!image) {
     14        image = readout->mask;
    1515    }
    16     pmCell *cell = readout->parent;     // The parent cell
    17     if (!cell) {
    18         psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to determine size of readout.\n");
    19         return NULL;
    20     }
    21     bool mdok;                          // Status of MD lookup
    22     psRegion *trimsec = psMetadataLookupPtr(&mdok, cell->concepts, "CELL.TRIMSEC"); // Trim section
    23     if (!mdok || !trimsec) {
    24         psError(PS_ERR_UNKNOWN, true, "Unable to find CELL.TRIMSEC.\n");
    25         return NULL;
     16    if (!image) {
     17        image = readout->weight;
    2618    }
    2719
    28     // XXX: Binning?
    29     // XXX this is not setting the right value for megacam spliced chip
    30     trimsec->x0 = 0;
    31     trimsec->y0 = 0;
    32     trimsec->x1 = 2112;
    33     trimsec->y1 = 4644;
     20    if (!image) {
     21        // Don't have anything to base the true extent on, so have to give the largest possible extent
     22        int xSize = psMetadataLookupS32(NULL, readout->parent->concepts, "CELL.XSIZE");
     23        int ySize = psMetadataLookupS32(NULL, readout->parent->concepts, "CELL.YSIZE");
     24        return psRegionAlloc(0, xSize, 0, ySize);
     25    }
    3426
    35     return psRegionAlloc(readout->col0, trimsec->x1 - trimsec->x0,
    36                          readout->row0, trimsec->y1 - trimsec->y0);
     27    // Get the offset to the CCD window
     28    int xWindow = psMetadataLookupS32(NULL, readout->parent->concepts, "CELL.XWINDOW");
     29    int yWindow = psMetadataLookupS32(NULL, readout->parent->concepts, "CELL.YWINDOW");
     30    return psRegionAlloc(xWindow, xWindow + image->numCols,
     31                         yWindow, yWindow + image->numRows);
    3732}
    3833
Note: See TracChangeset for help on using the changeset viewer.