Changeset 7605 for trunk/psModules/src/camera/pmFPAMosaic.c
- Timestamp:
- Jun 20, 2006, 10:37:50 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmFPAMosaic.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAMosaic.c
r7595 r7605 810 810 for (int i = 0; i < cells->n; i++) { 811 811 pmCell *cell = cells->data[i]; // The cell of interest 812 if (!cell ) {812 if (!cell || !cell->data_exists) { 813 813 continue; 814 814 } … … 870 870 for (int i = 0; i < chips->n; i++) { 871 871 pmChip *chip = chips->data[i]; // The chip of interest 872 if (!chip ) {872 if (!chip || !chip->data_exists) { 873 873 continue; 874 874 } … … 876 876 for (int j = 0; j < cells->n; j++) { 877 877 pmCell *cell = cells->data[j]; // The cell of interest 878 if (!cell ) {878 if (!cell || !cell->data_exists) { 879 879 continue; 880 880 } … … 997 997 psFree(newReadout); // Drop reference 998 998 999 // Data now exists in the targets 1000 pmChipSetDataStatus(target, true); 1001 pmCellSetDataStatus(targetCell, true); 1002 newReadout->data_exists = true; 1003 999 1004 // Update the headers 1000 1005 pmHDU *sourceHDU = pmHDUFromChip(source); // The HDU for the source … … 1062 1067 psList *sourceCells = psListAlloc(NULL); // List of source cells 1063 1068 psArray *chips = source->chips; // Array of chips 1069 pmChip *firstSourceChip = NULL; // The first chip in the source FPA; for headers 1070 pmCell *firstSourceCell = NULL; // The first cell in the source FPA; for headers 1064 1071 for (long i = 0; i < chips->n; i++) { 1065 1072 pmChip *chip = chips->data[i]; // Chip of interest 1066 if (!chip ) {1073 if (!chip || !chip->data_exists) { 1067 1074 continue; 1068 1075 } … … 1070 1077 for (long j = 0; j < cells->n; j++) { 1071 1078 pmCell *cell = cells->data[j]; // Cell of interest 1072 if (!cell ) {1079 if (!cell || !cell->data_exists) { 1073 1080 continue; 1074 1081 } 1075 1082 psListAdd(sourceCells, PS_LIST_TAIL, cell); 1083 1084 // These are valid chip and cell to use for the header; grab the first such 1085 if (!firstSourceCell && !firstSourceChip) { 1086 firstSourceCell = cell; 1087 firstSourceChip = chip; 1088 } 1076 1089 } 1077 1090 } … … 1092 1105 psFree(newReadout); // Drop reference 1093 1106 1107 // Data now exists in the targets 1108 pmChipSetDataStatus(targetChip, true); 1109 pmCellSetDataStatus(targetCell, true); 1110 newReadout->data_exists = true; 1111 1094 1112 // Update the headers 1095 pmHDU *sourceHDU = pmHDUFromFPA(source); // The HDU for the source 1096 pmHDU *targetHDU = pmHDUFromFPA(target); // The HDU for the target 1113 pmHDU *sourceHDU = pmHDUGetHighest(source, firstSourceChip, firstSourceCell); // The HDU for the source 1114 if (!sourceHDU) { 1115 psLogMsg(__func__, PS_LOG_WARN, "Unable to find HDU in source FPA; unable to copy headers.\n"); 1116 return false; 1117 } 1118 pmHDU *targetHDU = pmHDUGetHighest(target, targetChip, targetCell); // The HDU for the target 1119 if (!targetHDU) { 1120 psLogMsg(__func__, PS_LOG_WARN, "Unable to find HDU in target FPA; unable to copy headers.\n"); 1121 return false; 1122 } 1097 1123 targetHDU->header = psMetadataCopy(targetHDU->header, sourceHDU->header); 1098 1124
Note:
See TracChangeset
for help on using the changeset viewer.
