Changeset 13499
- Timestamp:
- May 23, 2007, 6:01:33 PM (19 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 3 edited
-
camera/pmFPAExtent.c (modified) (1 diff)
-
camera/pmFPAMosaic.c (modified) (2 diffs)
-
concepts/pmConcepts.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAExtent.c
r12710 r13499 10 10 PS_ASSERT_PTR_NON_NULL(readout, NULL); 11 11 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; 15 15 } 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; 26 18 } 27 19 28 // XXX: Binning?29 // XXX this is not setting the right value for megacam spliced chip30 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 } 34 26 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); 37 32 } 38 33 -
trunk/psModules/src/camera/pmFPAMosaic.c
r13339 r13499 16 16 #include "pmConfig.h" 17 17 #include "pmAstrometryWCS.h" 18 #include "pmFPAExtent.h" 18 19 19 20 #include "pmFPAMosaic.h" … … 1086 1087 pmHDU *sourcePHU = pmHDUGetHighest(source->parent, source, NULL); 1087 1088 1089 // Need to update NAXIS1, NAXIS2 in the target header, so that when we write a CMF, it has the correct 1090 // extent. I'm not convinced that this is the best way to do this, but it should be, at worst, harmless, 1091 // since NAXIS[12] will get overwritten for an image with the proper dimensions. 1092 psRegion *naxis = pmChipExtent(target); 1093 psMetadataAddS32(targetHDU->header, PS_LIST_TAIL, "NAXIS1", PS_META_REPLACE, "Size in x", 1094 naxis->x1 - naxis->x0); 1095 psMetadataAddS32(targetHDU->header, PS_LIST_TAIL, "NAXIS2", PS_META_REPLACE, "Size in y", 1096 naxis->y1 - naxis->y0); 1097 psFree(naxis); 1098 1099 1088 1100 if (!targetPHU) { 1089 1101 psError(PS_ERR_UNKNOWN, true, "Unable to find HDU after mosaicking.\n"); -
trunk/psModules/src/concepts/pmConcepts.c
r13034 r13499 868 868 psFree(cellYsize); 869 869 } 870 871 // CELL.XWINDOW 872 { 873 psMetadataItem *cellXwindow = psMetadataItemAllocS32("CELL.XWINDOW", 874 "Start of cell window (pixels)", 0); 875 pmConceptRegister(cellXwindow, NULL, NULL, true, PM_FPA_LEVEL_CELL); 876 psFree(cellXwindow); 877 } 878 879 // CELL.YSIZE 880 { 881 psMetadataItem *cellYwindow = psMetadataItemAllocS32("CELL.YWINDOW", 882 "Start of cell window (pixels)", 0); 883 pmConceptRegister(cellYwindow, NULL, NULL, true, PM_FPA_LEVEL_CELL); 884 psFree(cellYwindow); 885 } 870 886 } 871 887 … … 888 904 889 905 890 // XXX EAM : Paul, please handle the biassec independently so the 906 // XXX EAM : Paul, please handle the biassec independently so the 891 907 // psList is copied without a verbose warning. when this is fixed, you can 892 908 // convert the trace back to a log (psMetadata.c:429)
Note:
See TracChangeset
for help on using the changeset viewer.
