- Timestamp:
- Jan 28, 2009, 2:33:51 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/pap_branch_20090128/psModules/src/camera/pmFPAExtent.c
r20635 r21211 16 16 } 17 17 if (!image) { 18 image = readout-> weight;18 image = readout->variance; 19 19 } 20 20 … … 23 23 24 24 if (!image) { 25 pmHDU *hdu = pmHDUFromReadout (readout);26 if (hdu && hdu->header) {27 bool status;28 xSize = psMetadataLookupS32(&status, hdu->header, "NAXIS1");29 if (!status) {30 xSize = psMetadataLookupS32(&status, hdu->header, "IMNAXIS1");31 if (!status) return NULL;32 } 33 ySize = psMetadataLookupS32(&status, hdu->header, "NAXIS2");34 if (!status) {35 ySize = psMetadataLookupS32(&status, hdu->header, "IMNAXIS2");36 if (!status) return NULL;37 } 38 } else {25 pmHDU *hdu = pmHDUFromReadout (readout); 26 if (hdu && hdu->header) { 27 bool status; 28 xSize = psMetadataLookupS32(&status, hdu->header, "NAXIS1"); 29 if (!status) { 30 xSize = psMetadataLookupS32(&status, hdu->header, "IMNAXIS1"); 31 if (!status) return NULL; 32 } 33 ySize = psMetadataLookupS32(&status, hdu->header, "NAXIS2"); 34 if (!status) { 35 ySize = psMetadataLookupS32(&status, hdu->header, "IMNAXIS2"); 36 if (!status) return NULL; 37 } 38 } else { 39 39 // Don't have anything to base the true extent on, so have to give the hardwired value (largest possible extent) 40 xSize = psMetadataLookupS32(NULL, readout->parent->concepts, "CELL.XSIZE");41 ySize = psMetadataLookupS32(NULL, readout->parent->concepts, "CELL.YSIZE");42 }40 xSize = psMetadataLookupS32(NULL, readout->parent->concepts, "CELL.XSIZE"); 41 ySize = psMetadataLookupS32(NULL, readout->parent->concepts, "CELL.YSIZE"); 42 } 43 43 return psRegionAlloc(0, xSize, 0, ySize); 44 44 } … … 70 70 // Don't have anything to base the true extent on, so have to give the hardwired value (largest possible extent) 71 71 if (readouts->n == 0) { 72 int xSize = psMetadataLookupS32(NULL, cell->concepts, "CELL.XSIZE");73 int ySize = psMetadataLookupS32(NULL, cell->concepts, "CELL.YSIZE");74 cellExtent->x0 = 0;75 cellExtent->x1 = xSize;76 cellExtent->y0 = 0;77 cellExtent->y1 = ySize;72 int xSize = psMetadataLookupS32(NULL, cell->concepts, "CELL.XSIZE"); 73 int ySize = psMetadataLookupS32(NULL, cell->concepts, "CELL.YSIZE"); 74 cellExtent->x0 = 0; 75 cellExtent->x1 = xSize; 76 cellExtent->y0 = 0; 77 cellExtent->y1 = ySize; 78 78 } 79 79 … … 97 97 // CELL.X0,Y0 are the coordinate of the amp on the chip, subtract size if parity flipped 98 98 if (xParityCell > 0) { 99 cellExtent->x0 += x0;100 cellExtent->x1 += x0;99 cellExtent->x0 += x0; 100 cellExtent->x1 += x0; 101 101 } else { 102 float x0Cell = x0 - cellExtent->x1;103 float x1Cell = x0 - cellExtent->x0;104 cellExtent->x0 = x0Cell;105 cellExtent->x1 = x1Cell;102 float x0Cell = x0 - cellExtent->x1; 103 float x1Cell = x0 - cellExtent->x0; 104 cellExtent->x0 = x0Cell; 105 cellExtent->x1 = x1Cell; 106 106 } 107 107 if (yParityCell > 0) { 108 cellExtent->y0 += y0;109 cellExtent->y1 += y0;108 cellExtent->y0 += y0; 109 cellExtent->y1 += y0; 110 110 } else { 111 float y0Cell = y0 - cellExtent->y1;112 float y1Cell = y0 - cellExtent->y0;113 cellExtent->y0 = y0Cell;114 cellExtent->y1 = y1Cell;111 float y0Cell = y0 - cellExtent->y1; 112 float y1Cell = y0 - cellExtent->y0; 113 cellExtent->y0 = y0Cell; 114 cellExtent->y1 = y1Cell; 115 115 } 116 116
Note:
See TracChangeset
for help on using the changeset viewer.
