Changeset 8246 for trunk/psModules/src/detrend
- Timestamp:
- Aug 8, 2006, 4:37:08 PM (20 years ago)
- Location:
- trunk/psModules/src/detrend
- Files:
-
- 4 edited
-
pmFlatNormalize.c (modified) (3 diffs)
-
pmFringeStats.c (modified) (8 diffs)
-
pmSubtractBias.c (modified) (2 diffs)
-
pmSubtractSky.c (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/detrend/pmFlatNormalize.c
r7860 r8246 71 71 for (int i = 0; i < numSources; i++) { 72 72 if (sourceMask->data.U8[i]) { 73 psTrace( __func__, 7, "Flux for exposure %d is masked.\n", i);73 psTrace("psModules.detrend", 7, "Flux for exposure %d is masked.\n", i); 74 74 continue; 75 75 } … … 89 89 sourceFlux->data.F32[i] = NAN; 90 90 } 91 psTrace( __func__, 7, "Flux for exposure %d is %lf\n", i, exp(sourceFlux->data.F32[i]));91 psTrace("psModules.detrend", 7, "Flux for exposure %d is %lf\n", i, exp(sourceFlux->data.F32[i])); 92 92 } 93 93 … … 117 117 chipGains->data.F32[i] = NAN; 118 118 } 119 psTrace( __func__, 7, "Gain for chip %d is %lf\n", i, exp(-chipGains->data.F32[i]));119 psTrace("psModules.detrend", 7, "Gain for chip %d is %lf\n", i, exp(-chipGains->data.F32[i])); 120 120 } 121 121 122 psTrace( __func__, 2, "Iteration %d: difference is %e\n", iter, diff);122 psTrace("psModules.detrend", 2, "Iteration %d: difference is %e\n", iter, diff); 123 123 124 124 // Switch the old and new -
trunk/psModules/src/detrend/pmFringeStats.c
r7887 r8246 3 3 * @author Eugene Magnier, IfA 4 4 * 5 * @version $Revision: 1.1 5$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-0 7-13 02:21:25$5 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-08-09 02:37:07 $ 7 7 * 8 8 * Copyright 2004 IfA … … 327 327 dfPt[i] = 1.0 / medianSd->sampleStdev; 328 328 329 psTrace( __func__, 7, "[%d:%d,%d:%d]: %f %f\n", (int)region.x0, (int)region.x1,329 psTrace("psModules.detrend", 7, "[%d:%d,%d:%d]: %f %f\n", (int)region.x0, (int)region.x1, 330 330 (int)region.y0, (int)region.y1, fPt[i], dfPt[i]); 331 331 } … … 671 671 int numClipped = 0; // Number clipped 672 672 for (int i = 0; i < diffs->n; i++) { 673 psTrace( __func__, 10, "Region %d (%d): %f\n", i, mask->data.U8[i], diffs->data.F32[i]);673 psTrace("psModules.detrend", 10, "Region %d (%d): %f\n", i, mask->data.U8[i], diffs->data.F32[i]); 674 674 if (!mask->data.U8[i] && fabs(diffs->data.F32[i]) > middle + thresh) { 675 psTrace( __func__, 5, "Masking %d: %f\n", i, diffs->data.F32[i]);675 psTrace("psModules.detrend", 5, "Masking %d: %f\n", i, diffs->data.F32[i]); 676 676 mask->data.U8[i] = 1; 677 677 numClipped++; … … 732 732 if (!finite(fringe->f->data.F32[j])) { 733 733 mask->data.U8[j] = 1; 734 psTrace( __func__, 9, "Masking region %d because not finite in fringe %d.\n", j, i);734 psTrace("psModules.detrend", 9, "Masking region %d because not finite in fringe %d.\n", j, i); 735 735 } 736 736 } … … 749 749 fringeScaleDiffs(diff, science, fringes, scale); 750 750 numClipped = clipRegions(diff, mask, 3.0*rej); 751 psTrace( __func__, 4, "%d regions clipped in initial pass.\n", numClipped);751 psTrace("psModules.detrend", 4, "%d regions clipped in initial pass.\n", numClipped); 752 752 753 753 unsigned int iter = 0; // Iteration number … … 756 756 iter++; 757 757 scaleMeasure(scale, science, fringes); // The scales 758 psTrace( __func__, 1, "Fringe scales after iteration %d:\n", iter);759 psTrace( __func__, 1, "Background: %f %f\n", scale->coeff->data.F32[0], scale->coeffErr->data.F32[0]);758 psTrace("psModules.detrend", 1, "Fringe scales after iteration %d:\n", iter); 759 psTrace("psModules.detrend", 1, "Background: %f %f\n", scale->coeff->data.F32[0], scale->coeffErr->data.F32[0]); 760 760 for (int i = 0; i < scale->nFringeFrames; i++) { 761 psTrace( __func__, 1, "%d: %f %f\n", i, scale->coeff->data.F32[i + 1],761 psTrace("psModules.detrend", 1, "%d: %f %f\n", i, scale->coeff->data.F32[i + 1], 762 762 scale->coeffErr->data.F32[i + 1]); 763 763 } … … 766 766 iterClip = clipRegions(diff, mask, rej); // Number clipped 767 767 numClipped += iterClip; 768 psTrace( __func__, 9, "Clipped: %d\tFrac: %f\n", iterClip, (float)numClipped/(float)numRegions);768 psTrace("psModules.detrend", 9, "Clipped: %d\tFrac: %f\n", iterClip, (float)numClipped/(float)numRegions); 769 769 } while (iterClip > 0 && iter < nIter && (float)numClipped/(float)numRegions <= 1.0 - keepFrac); 770 770 psFree(diff); … … 811 811 psFree(scienceStats); 812 812 813 psTrace( __func__, 7, "Fringe solution:\n");813 psTrace("psModules.detrend", 7, "Fringe solution:\n"); 814 814 for (int i = 0; i < fringeImages->n + 1; i++) { 815 psTrace( __func__, 7, "%d: %f %f\n", i, scale->coeff->data.F32[i],815 psTrace("psModules.detrend", 7, "%d: %f %f\n", i, scale->coeff->data.F32[i], 816 816 scale->coeffErr->data.F32[i]); 817 817 } -
trunk/psModules/src/detrend/pmSubtractBias.c
r8108 r8246 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $14 * @date $Date: 2006-08-0 3 19:37:55$13 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-08-09 02:37:07 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 259 259 const pmReadout *bias, const pmReadout *dark) 260 260 { 261 psTrace(" .psModule.pmSubtracBias.pmSubtractBias", 4,261 psTrace("psModules.detrend", 4, 262 262 "---- pmSubtractBias() begin ----\n"); 263 263 PS_ASSERT_PTR_NON_NULL(in, NULL); -
trunk/psModules/src/detrend/pmSubtractSky.c
r8004 r8246 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-0 7-28 03:21:19$8 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-08-09 02:37:07 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 33 33 static psS32 DetermineNumBits(psStatsOptions data) 34 34 { 35 psTrace(" SubtractSky.DetermineNumBits", 4, "Calling DetermineNumBits(0x%x)\n", data);35 psTrace("psModules.detrend", 4, "Calling DetermineNumBits(0x%x)\n", data); 36 36 37 37 psS32 i; … … 46 46 } 47 47 48 psTrace(" SubtractSky.DetermineNumBits", 4,48 psTrace("psModules.detrend", 4, 49 49 "Calling DetermineNumBits(0x%x) -> %d\n", data, numBits); 50 50 return(numBits); … … 58 58 static psU64 getHighestPriorityStatOption(psU64 statOptions) 59 59 { 60 psTrace(" SubtractSky.getHighestPriorityStatOption", 4,60 psTrace("psModules.detrend", 4, 61 61 "Calling getHighestPriorityStatOption(0x%x)\n", statOptions); 62 62 … … 95 95 psStatsOptions statOptions) 96 96 { 97 psTrace(" SubtractSky.binImage", 4, "Calling binImage(%d)\n", binFactor);97 psTrace("psModules.detrend", 4, "Calling binImage(%d)\n", binFactor); 98 98 99 99 if (binFactor <= 0) { … … 148 148 psFree(myStats); 149 149 150 psTrace(" SubtractSky.binImage", 4, "Exiting binImage(%d)\n", binFactor);150 psTrace("psModules.detrend", 4, "Exiting binImage(%d)\n", binFactor); 151 151 return(origImage); 152 152 } … … 163 163 static psS32 CalculatePolyTerms(psS32 xOrder, psS32 yOrder) 164 164 { 165 psTrace(" SubtractSky.CalculatePolyTerms", 4,165 psTrace("psModules.detrend", 4, 166 166 "Calling CalculatePolyTerms(%d, %d)\n", xOrder, yOrder); 167 167 … … 178 178 } 179 179 } 180 psTrace(" SubtractSky.CalculatePolyTerms", 4,180 psTrace("psModules.detrend", 4, 181 181 "Exiting CalculatePolyTerms(%d, %d) -> %d\n", xOrder, yOrder, localPolyTerms); 182 182 return(localPolyTerms); … … 198 198 static psS32 **buildPolyTerms(psS32 xOrder, psS32 yOrder) 199 199 { 200 psTrace(" SubtractSky.buildPolyTerms", 4,200 psTrace("psModules.detrend", 4, 201 201 "Calling buildPolyTerms(%d, %d)\n", xOrder, yOrder); 202 202 … … 233 233 } 234 234 235 psTrace(" SubtractSky.buildPolyTerms", 4,235 psTrace("psModules.detrend", 4, 236 236 "Exiting buildPolyTerms(%d, %d)\n", xOrder, yOrder); 237 237 return(polyTerms); … … 258 258 psS32 yOrder) 259 259 { 260 psTrace(" SubtractSky.buildPolyTerms", 4,260 psTrace("psModules.detrend", 4, 261 261 "Calling buildPolyTerms(%d, %d)\n", xOrder, yOrder); 262 262 … … 276 276 xSum*= x; 277 277 } 278 psTrace(" SubtractSky.buildPolyTerms", 4,278 psTrace("psModules.detrend", 4, 279 279 "Exiting buildPolyTerms(%d, %d)\n", xOrder, yOrder); 280 280 } … … 297 297 psImage *maskImage) 298 298 { 299 psTrace(" SubtractSky.ImageFitPolynomial", 4,299 psTrace("psModules.detrend", 4, 300 300 "Calling ImageFitPolynomial()\n"); 301 301 PS_ASSERT_POLY_NON_NULL(myPoly, NULL); … … 416 416 for (i=0;i<localPolyTerms;i++) { 417 417 myPoly->coeff[ polyTerms[i][0] ][ polyTerms[i][1] ] = C->data.F64[i]; 418 psTrace(" .psModule.pmSubtractSky.ImageFitPolynomial", 6,418 psTrace("psModules.detrend", 6, 419 419 "myPoly->coeff[%d][%d] is %f\n", polyTerms[i][0], polyTerms[i][1], myPoly->coeff[ polyTerms[i][0] ][ polyTerms[i][1] ]); 420 420 } … … 456 456 } 457 457 458 psTrace(" SubtractSky.ImageFitPolynomial", 4,458 psTrace("psModules.detrend", 4, 459 459 "Exiting ImageFitPolynomial()\n"); 460 // psTrace(" .psModule.pmSubtractSky.ImageFitPolynomial", 4,460 // psTrace("psModules.detrend", 4, 461 461 // "---- ImageFitPolynomial() end successfully ----\n"); 462 462 return(myPoly); … … 487 487 PS_WARN_PTR_NON_NULL(in->parent->concepts); 488 488 } 489 psTrace(" .psModule.pmSubtractSky", 4,489 psTrace("psModules.detrend", 4, 490 490 "---- pmSubtractSky() begin ----\n"); 491 491 … … 590 590 psImageInit(binnedMaskImage, 0); 591 591 } 592 psTrace(" .psModule.pmSubtractSky", 4,592 psTrace("psModules.detrend", 4, 593 593 "binnedImage size is (%d, %d)\n", binnedImage->numRows, binnedImage->numCols); 594 594 … … 609 609 psF64 binnedStdev = myStats->sampleStdev; 610 610 psFree(myStats); 611 psTrace(" .psModule.pmSubtractSky", 6,611 psTrace("psModules.detrend", 6, 612 612 "binned StDev is %f\n", binnedStdev); 613 613 614 614 // Clip all pixels which are more than clipSD sigmas from the mean. 615 psTrace(" .psModule.pmSubtractSky", 6,615 psTrace("psModules.detrend", 6, 616 616 "clipSD is %f\n", clipSD); 617 617 … … 705 705 trimmedImg->data.F32[row][col]-= binPixel; 706 706 707 psTrace(" .psModule.pmSubtractSky", 8,707 psTrace("psModules.detrend", 8, 708 708 "image[%d][%d] <--> binnedImage[%.2f][%.2f]: %f\n", 709 709 row, col, binRowF64-0.5, binColF64-0.5, binPixel); … … 718 718 } 719 719 720 psTrace(" .psModule.pmSubtractSky", 4,720 psTrace("psModules.detrend", 4, 721 721 "---- pmSubtractSky() exit successfully ----\n"); 722 722 return(in);
Note:
See TracChangeset
for help on using the changeset viewer.
