Changeset 27467
- Timestamp:
- Mar 26, 2010, 11:27:28 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/magic/remove/src/streaksio.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/streaksio.c
r27233 r27467 811 811 } 812 812 streaksVersionHeaderFull(sfile->header); 813 813 814 if (!psFitsWriteImage(sfile->fits, sfile->header, sfile->image, 0, extname)) { 814 815 psError(PS_ERR_IO, false, "failed to write image to %s extnum: %d", … … 871 872 closeImages(streakFiles *sf) 872 873 { 874 if (sf->stage == IPP_STAGE_RAW) { 875 if (sf->view) { 876 sf->view->readout = -1; 877 pmFPAfileIOChecks(sf->config, sf->view, PM_FPA_AFTER); 878 sf->view->cell = -1; 879 pmFPAfileIOChecks(sf->config, sf->view, PM_FPA_AFTER); 880 sf->view->chip = -1; 881 pmFPAfileIOChecks(sf->config, sf->view, PM_FPA_AFTER); 882 } 883 } 873 884 closeImage(sf->inImage); 874 885 closeImage(sf->outImage); … … 1123 1134 1124 1135 psImage *image = sfiles->outImage->image; 1136 int imageType = image->type.type; 1125 1137 double exciseValue = sfiles->inImage->exciseValue; 1126 1138 … … 1143 1155 // these gets are not necessary, we could just set the pixels to nan 1144 1156 // but I want to get the counts 1145 double imageVal = image->data.F32[y][x]; 1157 double imageVal; 1158 if (imageType == PS_TYPE_F32) { 1159 imageVal = image->data.F32[y][x]; 1160 } else if (imageType == PS_TYPE_S16) { 1161 imageVal = image->data.S16[y][x]; 1162 } else if (imageType == PS_TYPE_U16) { 1163 imageVal = image->data.U16[y][x]; 1164 } else { 1165 psError(PS_ERR_PROGRAMMING, true, "unexpected image type found: %d\n", 1166 imageType); 1167 streaksExit("", PS_EXIT_PROG_ERROR); 1168 } 1146 1169 psU32 maskVal; 1147 1170 if (sfiles->stage == IPP_STAGE_RAW) { … … 1156 1179 if (!isExciseValue(imageVal, exciseValue)) { 1157 1180 ++nandPixels; 1158 image->data.F32[y][x] = exciseValue; 1181 if (imageType == PS_TYPE_F32) { 1182 image->data.F32[y][x] = exciseValue; 1183 } else if (imageType == PS_TYPE_S16) { 1184 image->data.S16[y][x] = exciseValue; 1185 } else if (imageType == PS_TYPE_U16) { 1186 image->data.U16[y][x] = exciseValue; 1187 } else { 1188 psError(PS_ERR_PROGRAMMING, true, "unexpected image type found: %d\n", 1189 imageType); 1190 streaksExit("", PS_EXIT_PROG_ERROR); 1191 } 1159 1192 } 1160 1193 if (weight) {
Note:
See TracChangeset
for help on using the changeset viewer.
