IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 5, 2007, 2:44:10 PM (19 years ago)
Author:
magnier
Message:

if we are missing an image, try to use the header NAXIS1,2 values

File:
1 edited

Legend:

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

    r13499 r13655  
    44#include "pmHDU.h"
    55#include "pmFPA.h"
     6#include "pmHDUUtils.h"
    67
    78// return cell pixels bounding the readout
     
    1819    }
    1920
     21    int xSize = 0;
     22    int ySize = 0;
     23
    2024    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");
     25        pmHDU *hdu = pmHDUFromReadout (readout);
     26        if (hdu && hdu->header) {
     27            xSize = psMetadataLookupS32(NULL, hdu->header, "NAXIS1");
     28            ySize = psMetadataLookupS32(NULL, hdu->header, "NAXIS2");
     29        } else {
     30        // Don't have anything to base the true extent on, so have to give the hardwired value (largest possible extent)
     31            xSize = psMetadataLookupS32(NULL, readout->parent->concepts, "CELL.XSIZE");
     32            ySize = psMetadataLookupS32(NULL, readout->parent->concepts, "CELL.YSIZE");
     33        }
    2434        return psRegionAlloc(0, xSize, 0, ySize);
    2535    }
Note: See TracChangeset for help on using the changeset viewer.