Changeset 8823
- Timestamp:
- Sep 18, 2006, 11:20:24 AM (20 years ago)
- Location:
- trunk/psModules/src/camera
- Files:
-
- 2 edited
-
pmFPACopy.c (modified) (3 diffs)
-
pmFPAMosaic.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPACopy.c
r8815 r8823 74 74 psArray *sourceReadouts = source->readouts; // The source readouts 75 75 int numReadouts = sourceReadouts->n; // Number of readouts copied 76 77 // Copy the value for a concept 78 #define COPY_CONCEPT(TARGET, SOURCE, NAME, TYPE) \ 79 psMetadataItem *targetItem = psMetadataLookup(TARGET, NAME); \ 80 psMetadataItem *sourceItem = psMetadataLookup(SOURCE, NAME); \ 81 targetItem->data.TYPE = sourceItem->data.TYPE; 76 82 77 83 // Need to check/change CELL.XPARITY and CELL.YPARITY … … 87 93 xFlip = true; 88 94 } 95 } else 96 { 97 // Use the source parity 98 COPY_CONCEPT(target->concepts, source->concepts, "CELL.XPARITY", S32); 89 99 } 90 100 int yParityTarget = psMetadataLookupS32(&mdok, target->concepts, "CELL.YPARITY"); // Target y parity … … 95 105 yFlip = true; 96 106 } 107 } else 108 { 109 // Use the source parity 110 COPY_CONCEPT(target->concepts, source->concepts, "CELL.YPARITY", S32); 97 111 } 98 112 psTrace("psModules.camera", 3, "xFlip: %d; yFlip: %d\n", xFlip, yFlip); -
trunk/psModules/src/camera/pmFPAMosaic.c
r8815 r8823 34 34 } 35 35 36 // Update a concept to the assumed value 37 #define FIX_CONCEPT(SOURCE, NAME, TYPE, VALUE) \ 38 psMetadataItem *item = psMetadataLookup(SOURCE, NAME); \ 39 item->data.TYPE = VALUE; 36 40 37 41 // Get the bounds for an chip's pixels on the HDU … … 726 730 if (!mdok) { 727 731 psLogMsg(__func__, PS_LOG_WARN, "CELL.X0 is not set for the target cell; assuming 0.\n"); 732 FIX_CONCEPT(targetCell->concepts, "CELL.X0", S32, 0); 728 733 } 729 734 int y0Target = psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.Y0"); 730 735 if (!mdok) { 731 736 psLogMsg(__func__, PS_LOG_WARN, "CELL.Y0 is not set for the target cell; assuming 0.\n"); 737 FIX_CONCEPT(targetCell->concepts, "CELL.Y0", S32, 0); 732 738 } 733 739 int xParityTarget = psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.XPARITY"); 734 740 if (!mdok || (xParityTarget != -1 && xParityTarget != 1)) { 735 741 psLogMsg(__func__, PS_LOG_WARN, "CELL.XPARITY is not set for the target cell; assuming 1.\n"); 742 FIX_CONCEPT(targetCell->concepts, "CELL.XPARITY", S32, 1); 736 743 xParityTarget = 1; 737 744 } … … 739 746 if (!mdok || (yParityTarget != -1 && yParityTarget != 1)) { 740 747 psLogMsg(__func__, PS_LOG_WARN, "CELL.YPARITY is not set for the target cell; assuming 1.\n"); 748 FIX_CONCEPT(targetCell->concepts, "CELL.YPARITY", S32, 1); 741 749 yParityTarget = 1; 742 750 } … … 763 771 if (!mdok || xBinTarget == 0) { 764 772 psLogMsg(__func__, PS_LOG_WARN, "CELL.XBIN is not set for the target cell; assuming %d.\n",*xBinChip); 773 FIX_CONCEPT(targetCell->concepts, "CELL.XBIN", S32, *xBinChip); 765 774 } else { 766 775 *xBinChip = xBinTarget; … … 769 778 if (!mdok || yBinTarget == 0) { 770 779 psLogMsg(__func__, PS_LOG_WARN, "CELL.YBIN is not set for the target cell; assuming %d.\n",*yBinChip); 780 FIX_CONCEPT(targetCell->concepts, "CELL.YBIN", S32, *yBinChip); 771 781 } else { 772 782 *yBinChip = yBinTarget; … … 828 838 if (!mdok) { 829 839 psLogMsg(__func__, PS_LOG_WARN, "CHIP.X0 is not set for the target chip; assuming 0.\n"); 840 FIX_CONCEPT(targetChip->concepts, "CHIP.X0", S32, 0); 830 841 } 831 842 int y0Target = psMetadataLookupS32(&mdok, targetChip->concepts, "CHIP.Y0"); 832 843 if (!mdok) { 833 844 psLogMsg(__func__, PS_LOG_WARN, "CHIP.Y0 is not set for the target chip; assuming 0.\n"); 845 FIX_CONCEPT(targetChip->concepts, "CHIP.Y0", S32, 0); 834 846 } 835 847 x0Target += psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.X0"); 836 848 if (!mdok) { 837 849 psLogMsg(__func__, PS_LOG_WARN, "CELL.X0 is not set for the target cell; assuming 0.\n"); 850 FIX_CONCEPT(targetCell->concepts, "CELL.X0", S32, 0); 838 851 } 839 852 y0Target += psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.Y0"); 840 853 if (!mdok) { 841 854 psLogMsg(__func__, PS_LOG_WARN, "CELL.Y0 is not set for the target cell; assuming 0.\n"); 855 FIX_CONCEPT(targetCell->concepts, "CELL.Y0", S32, 0); 842 856 } 843 857 int xParityChipTarget = psMetadataLookupS32(&mdok, targetChip->concepts, "CHIP.XPARITY"); 844 858 if (!mdok || (xParityChipTarget != -1 && xParityChipTarget != 1)) { 845 859 psLogMsg(__func__, PS_LOG_WARN, "CHIP.XPARITY is not set for the target chip; assuming 1.\n"); 860 FIX_CONCEPT(targetChip->concepts, "CHIP.XPARITY", S32, 1); 846 861 xParityChipTarget = 1; 847 862 } … … 849 864 if (!mdok || (yParityChipTarget != -1 && yParityChipTarget != 1)) { 850 865 psLogMsg(__func__, PS_LOG_WARN, "CHIP.YPARITY is not set for the target chip; assuming 1.\n"); 866 FIX_CONCEPT(targetChip->concepts, "CHIP.YPARITY", S32, 1); 851 867 yParityChipTarget = 1; 852 868 } … … 854 870 if (!mdok || (xParityCellTarget != -1 && xParityCellTarget != 1)) { 855 871 psLogMsg(__func__, PS_LOG_WARN, "CELL.XPARITY is not set for the target cell; assuming 1.\n"); 872 FIX_CONCEPT(targetCell->concepts, "CELL.XPARITY", S32, 1); 856 873 xParityCellTarget = 1; 857 874 } … … 859 876 if (!mdok || (yParityCellTarget != -1 && yParityCellTarget != 1)) { 860 877 psLogMsg(__func__, PS_LOG_WARN, "CELL.YPARITY is not set for the target cell; assuming 1.\n"); 878 FIX_CONCEPT(targetCell->concepts, "CELL.YPARITY", S32, 1); 861 879 yParityCellTarget = 1; 862 880 }
Note:
See TracChangeset
for help on using the changeset viewer.
