Changeset 25209 for trunk/magic/remove/src/streaksio.c
- Timestamp:
- Aug 26, 2009, 2:38:40 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/magic/remove/src/streaksio.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/streaksio.c
r25082 r25209 654 654 streaksExit("", PS_EXIT_DATA_ERROR); 655 655 } 656 657 // Ensure input is of the expected type 658 psDataType expected = isMask ? PS_TYPE_IMAGE_MASK : PS_TYPE_F32; // Expected type for image 659 for (int i = 0; i < in->imagecube->n; i++) { 660 psImage *image = in->imagecube->data[i]; // Image of interest 661 if (image->type.type != expected) { 662 psImage *temp = psImageCopy(NULL, image, expected); 663 psFree(image); 664 in->imagecube->data[i] = temp; 665 } 666 } 656 667 } 657 668 setDataExtent(stage, in, (stage == IPP_STAGE_RAW) && !isMask); … … 670 681 sfile->fits->options = psFitsOptionsAlloc(); 671 682 sfile->fits->options->scaling = PS_FITS_SCALE_MANUAL; 683 sfile->fits->options->fuzz = false; 672 684 sfile->fits->options->bitpix = bitpix; 673 685 sfile->fits->options->bscale = bscale; … … 1114 1126 // these gets are not necessary, we could just set the pixels to nan 1115 1127 // but I want to get the counts 1116 double imageVal = psImageGet(image, x, y);1128 double imageVal = image->data.F32[y][x]; 1117 1129 psU32 maskVal; 1118 1130 if (sfiles->stage == IPP_STAGE_RAW) { 1119 1131 unsigned int xChip, yChip; 1120 1132 cellToChipInt(&xChip, &yChip, sfiles->astrom, x, y); 1121 maskVal = psImageGet(mask, xChip, yChip);1133 maskVal = mask->data.PS_TYPE_IMAGE_MASK_DATA[yChip][xChip]; 1122 1134 } else { 1123 maskVal = psImageGet(mask, x, y);1135 maskVal = mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x]; 1124 1136 } 1125 1137 if (maskVal & maskMask) { … … 1127 1139 if (!isExciseValue(imageVal, sfiles->inImage->exciseValue)) { 1128 1140 ++nandPixels; 1129 psImageSet(image, x, y, exciseValue);1141 image->data.F32[y][x] = exciseValue; 1130 1142 } 1131 1143 if (weight) { 1132 double weightVal = weight ? psImageGet(weight, x, y): 0;1144 double weightVal = weight ? weight->data.F32[y][x] : 0; 1133 1145 if (!isnan(weightVal)) { 1134 1146 ++nandWeights; 1135 psImageSet(weight, x, y, NAN);1147 weight->data.F32[y][x] = NAN; 1136 1148 } 1137 1149 }
Note:
See TracChangeset
for help on using the changeset viewer.
