Changeset 33415 for branches/meh_branches/ppstack_test/psModules/src/imcombine/pmSubtractionStamps.c
- Timestamp:
- Mar 5, 2012, 5:19:48 PM (14 years ago)
- Location:
- branches/meh_branches/ppstack_test
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/meh_branches/ppstack_test
- Property svn:mergeinfo changed
-
branches/meh_branches/ppstack_test/psModules
- Property svn:mergeinfo set to
-
branches/meh_branches/ppstack_test/psModules/src/imcombine/pmSubtractionStamps.c
r31543 r33415 127 127 continue; 128 128 } 129 //MEH hack to limit bright end test 130 // if ((image1 && image1->data.F32[y][x] > 2000) || 131 // (image2 && image2->data.F32[y][x] > 2000 )) { 132 // fprintf (stderr, "%f,%f : thresh\n",image1->data.F32[y][x],image2->data.F32[y][x]); 133 // continue; 134 // } 129 135 130 136 if (subMask && subMask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & … … 188 194 } 189 195 190 void pmSubtractionStampPrint(FILE *ds9, float x, float y, float size, const char *color) 196 // MEH adding text to ds9 197 void pmSubtractionStampPrint(FILE *ds9, float x, float y, float size, const char *color, const char *ds9text) 191 198 { 192 199 if (!ds9regions || !ds9) { … … 196 203 if (color && strlen(color) > 0) { 197 204 fprintf(ds9, " # color=%s", color); 205 } 206 if (ds9text && strlen(ds9text) > 0) { 207 fprintf(ds9, " text={%s}", ds9text); 198 208 } 199 209 fprintf(ds9, "\n"); … … 486 496 normFrac, sysErr, skyErr); 487 497 } 488 498 //MEH - stamps.dat will repeatedly be overwritten - out to trace may be btter -- see end for summary 489 499 // XXX TEST : dump all stars in the stamps here 490 if ( 0) {500 if (1) { 491 501 FILE *f = fopen ("stamp.dat", "w"); 492 502 for (int i = 0; i < stamps->num; i++) { … … 589 599 stamp->status = PM_SUBTRACTION_STAMP_FOUND; 590 600 numFound++; 591 psTrace("psModules.imcombine", 5, "Found stamp in subregion %d: %d,%d\n", 592 i, (int)stamp->x, (int)stamp->y); 601 // psTrace("psModules.imcombine", 5, "Found stamp in subregion %d: %d,%d\n", 602 // i, (int)stamp->x, (int)stamp->y); 603 //MEH adding int flux to say something about the source 604 psTrace("psModules.imcombine", 5, "Found stamp in subregion %d: %d,%d Flux: %d\n", 605 i, (int)stamp->x, (int)stamp->y, (int)stamp->flux); 593 606 } else { 594 607 stamp->status = PM_SUBTRACTION_STAMP_NONE; … … 666 679 psTrace("psModules.imcombine", 9, "Rejecting input stamp (%d,%d) because outside region", 667 680 xPix, yPix); 668 pmSubtractionStampPrint(ds9, xPix, yPix, footprint, "red" );681 pmSubtractionStampPrint(ds9, xPix, yPix, footprint, "red", ""); 669 682 continue; 670 683 } 671 684 //MEH - are all using -0.5? seen some seem shifted 672 685 // fprintf (stderr, "stamp: %5.1f %5.1f == %d %d\n", xStamp, yStamp, xPix, yPix); 673 686 … … 692 705 psTrace("psModules.imcombine", 9, "Putting input stamp (%d,%d) into subregion %d", 693 706 xPix, yPix, j); 694 pmSubtractionStampPrint(ds9, xPix, yPix, footprint, "green" );707 pmSubtractionStampPrint(ds9, xPix, yPix, footprint, "green", ""); 695 708 } 696 709 } … … 699 712 psTrace("psModules.imcombine", 9, "Unable to find subregion for stamp (%d,%d)", 700 713 xPix, yPix); 701 pmSubtractionStampPrint(ds9, xPix, yPix, footprint, "yellow" );714 pmSubtractionStampPrint(ds9, xPix, yPix, footprint, "yellow", ""); 702 715 } 703 716 } … … 865 878 } 866 879 } 867 868 #if 0880 //MEH 881 #if 1 869 882 { 870 883 psFits *fits = NULL; … … 1156 1169 float sysErr = 0.25 * PS_SQR(stamps->sysErr); // Systematic error 1157 1170 float skyErr = stamps->skyErr; 1171 //MEH - image2 not used if not adding to additional.. also these are never freed here, but upstream/downstream? 1158 1172 psKernel *image1 = stamp->image1, *image2 = stamp->image2; // Input images 1173 //psKernel *image2 = stamp->image2; // Input images 1159 1174 for (int y = -size; y <= size; y++) { 1160 1175 for (int x = -size; x <= size; x++) { 1176 //MEH -- if conv to model then what does sys and weight mean for both? 1177 // w1+w2 vs 1/var1+1/var2.. depends on what the weight is for? 1178 // why additional ^2? 1161 1179 float additional = image1->kernel[y][x] + image2->kernel[y][x]; 1162 weight->kernel[y][x] = 1.0 / (skyErr + var->kernel[y][x] + sysErr * PS_SQR(additional)); 1180 //float additional = image2->kernel[y][x]; 1181 // weight->kernel[y][x] = 1.0 / (skyErr + var->kernel[y][x] + sysErr * PS_SQR(additional)); 1182 weight->kernel[y][x] = 1.0 / (skyErr + 1000.0*var->kernel[y][x] + sysErr * PS_SQR(additional)); 1163 1183 } 1164 1184 } 1185 psLogMsg("psModules.imcombine", PS_LOG_DETAIL, "TESTING:: Stamp %d (%.1f,%.1f) weight: %f var: %.1f sysErr: %.2f im1: %.0f im2: %.0f \n", 1186 i, stamp->x, stamp->y, weight->kernel[0][0],var->kernel[0][0],sysErr,image2->kernel[0][0],image1->kernel[0][0]); 1187 1165 1188 } else { 1166 1189 for (int y = -size; y <= size; y++) { 1167 1190 for (int x = -size; x <= size; x++) { 1168 weight->kernel[y][x] = 1.0 / var->kernel[y][x]; 1191 // weight->kernel[y][x] = 1.0 / var->kernel[y][x]; 1192 weight->kernel[y][x] = 1.0 / (1000.0*var->kernel[y][x]); 1169 1193 } 1170 1194 }
Note:
See TracChangeset
for help on using the changeset viewer.
