Changeset 34625
- Timestamp:
- Oct 29, 2012, 6:24:33 PM (14 years ago)
- Location:
- branches/czw_branch/20120906
- Files:
-
- 2 edited
-
ppSkycell/src/ppSkycellLoop.c (modified) (1 diff)
-
psModules/src/camera/pmFPABin.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20120906/ppSkycell/src/ppSkycellLoop.c
r34624 r34625 249 249 psFree(view); 250 250 251 // data->maskVal = 1;251 // data->maskVal = 0xffff; 252 252 pmReadout *bin1RO = pmReadoutAlloc(NULL), *bin2RO = pmReadoutAlloc(NULL); // Binned readouts 253 253 if (!pmReadoutRebin(bin1RO, inRO, data->maskVal, data->bin1, data->bin1)) { -
branches/czw_branch/20120906/psModules/src/camera/pmFPABin.c
r24906 r34625 43 43 } 44 44 45 int Nbits = (int) (ceil(log(maskVal)/log(2)) + 1); 46 int *bitcounter = malloc(sizeof(int) * Nbits); 47 int pxlcount; 48 fprintf(stderr,">> %d %d %x\n",Nbits,maskVal,maskVal); 49 45 50 int xLast = numColsIn - 1, yLast = numRowsIn - 1; // Last index 46 51 int yStart = psImageBinningGetFineY(binning, 0); // Starting input y for binning … … 55 60 float sum = 0.0; // Sum of pixels 56 61 int numPix = 0; // Number of pixels 62 63 for (int j = 0; j < Nbits; j++) { // Reset bit counter 64 bitcounter[j] = 0; 65 } 66 pxlcount = 0; 67 57 68 for (int y = yStart; y < yStop; y++) { 58 69 for (int x = xStart; x < xStop; x++) { 70 if (inMask && (inMask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] != 0)) { 71 for (int j = 0; j < Nbits; j++) { 72 psImageMaskType M = (psImageMaskType) pow(2,j); 73 /* fprintf(stderr,"%x %d %x %x\n",inMask->data.PS_TYPE_IMAGE_MASK_DATA[y][x], */ 74 /* j,M,(inMask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & M)); */ 75 76 if (inMask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & M) { 77 bitcounter[j]++; 78 } 79 } 80 } 81 59 82 if (inMask && (inMask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal)) { 60 83 continue; … … 65 88 sum += inImage->data.F32[y][x]; 66 89 numPix++; 90 91 92 /* if ((yStart < 4561)&&(yStop > 4561)&& */ 93 /* (xStart < 3491)&&(xStop > 3491)) { */ 94 /* // fprintf(stderr,"%d %d %g %x %x \n",x,y,inImage->data.F32[y][x],inMask->data.PS_TYPE_IMAGE_MASK_DATA[y][x],maskVal); */ 95 /* for (int j = 0; j < Nbits; j++) { */ 96 /* fprintf(stderr,"%d %x %d\t",j,(int) pow(2,j), bitcounter[j]); */ 97 /* } */ 98 /* fprintf(stderr,"\n"); */ 99 /* } */ 67 100 } 68 101 } 69 102 /* fprintf(stderr,"%d %d\t",xOut,yOut); */ 103 /* for (int j = 0; j < Nbits; j++) { */ 104 /* fprintf(stderr,"%d %x %d\t",j,(int) pow(2,j), bitcounter[j]); */ 105 /* } */ 106 /* fprintf(stderr,"\n"); */ 107 108 70 109 // Values to set 71 110 float imageValue; … … 79 118 } 80 119 outImage->data.F32[yOut][xOut] = imageValue; 81 outMask->data.PS_TYPE_IMAGE_MASK_DATA[yOut][xOut] = maskValue; 120 // outMask->data.PS_TYPE_IMAGE_MASK_DATA[yOut][xOut] = maskValue; 121 outMask->data.PS_TYPE_IMAGE_MASK_DATA[yOut][xOut] = 0; 122 for (int j = 0; j < Nbits; j++) { 123 if (bitcounter[j] > 0.5 * pxlcount) { 124 outMask->data.PS_TYPE_IMAGE_MASK_DATA[yOut][xOut] |= (int) pow(2,j); 125 } 126 } 82 127 xStart = xStop; 83 128 }
Note:
See TracChangeset
for help on using the changeset viewer.
