Changeset 39926 for trunk/psModules/src/astrom/pmAstrometryObjects.c
- Timestamp:
- Jan 6, 2017, 11:30:10 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
psModules/src/astrom/pmAstrometryObjects.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to
/branches/czw_branch/20160809 merged eligible
-
Property svn:mergeinfo
set to
-
trunk/psModules/src/astrom/pmAstrometryObjects.c
r36834 r39926 225 225 psArray *ref, 226 226 psArray *match, 227 psStats *stats) 227 psStats *stats, 228 const psMetadata *config) 228 229 { 229 230 PS_ASSERT_PTR_NON_NULL(map, NULL); … … 232 233 PS_ASSERT_PTR_NON_NULL(match, NULL); 233 234 PS_ASSERT_PTR_NON_NULL(stats, NULL); 235 PS_ASSERT_PTR_NON_NULL(config, NULL); 236 237 // sigma of gaussian window to down-weight photometric outliers (ignored if NAN or 0.0) 238 bool status; 239 double photomWindowSigma = psMetadataLookupF32 (&status, config, "PSASTRO.PHOTOM.WINDOW.SIGMA"); 240 bool photomWindowApply = !(isnan(photomWindowSigma) || (fabs(photomWindowSigma) < 0.01)); 241 double photomWindowFactor = photomWindowApply ? -0.5/PS_SQR(photomWindowSigma) : 0.0; 234 242 235 243 // reassign values for clip fit … … 252 260 y->data.F32[i] = refStar->FP->y; 253 261 254 wt->data.F32[i] = 1.0; 262 // wt is used as an error (sqrt(variance)) in the fit. the 1.01 prevents the weight from going to 0.0 for perfect matches 263 wt->data.F32[i] = 1.01 - exp(photomWindowFactor*PS_SQR(refStar->magCal - rawStar->magCal)); 255 264 } 256 265 … … 657 666 obj->Color= 0; 658 667 obj->dMag = 0; 668 obj->magCal = 0; 659 669 660 670 return (obj); … … 685 695 obj->Color = old->Color; 686 696 obj->dMag = old->dMag; 697 obj->magCal = old->magCal; 687 698 688 699 return(obj); … … 774 785 double gridOffset = psMetadataLookupF32 (&status, config, "PSASTRO.GRID.OFFSET"); 775 786 776 // sampling scale of the grid 777 double gridScale = psMetadataLookupF32 (&status, config, "PSASTRO.GRID.SCALE"); 787 // sampling scale of the grid 788 double gridScale = psMetadataLookupF32 (&status, config, "PSASTRO.GRID.SCALE"); 789 790 // sigma of gaussian window to down-weight photometric outliers (ignored if NAN or 0.0) 791 double photomWindowSigma = psMetadataLookupF32 (&status, config, "PSASTRO.PHOTOM.WINDOW.SIGMA"); 792 bool photomWindowApply = !(isnan(photomWindowSigma) || (fabs(photomWindowSigma) < 0.01)); 793 double photomWindowFactor = photomWindowApply ? -0.5/PS_SQR(photomWindowSigma) : 0.0; 778 794 779 795 // set the static scaling factors … … 816 832 } 817 833 834 // XXX should I make the scale factor in front a recipe value? 835 int Npts = 10 * exp(photomWindowFactor*PS_SQR(ob1->magCal - ob2->magCal)); 836 818 837 // accumulate bin stats 819 NP[iY][iX] + +;820 DX[iY][iX] += dX ;821 DY[iY][iX] += dY ;822 D2[iY][iX] += PS_SQR(dX ) + PS_SQR(dY);838 NP[iY][iX] += Npts; 839 DX[iY][iX] += dX*Npts; 840 DY[iY][iX] += dY*Npts; 841 D2[iY][iX] += PS_SQR(dX*Npts) + PS_SQR(dY*Npts); 823 842 } 824 843 } … … 1053 1072 double tweakNsigma = psMetadataLookupF32 (&status, recipe, "PSASTRO.TWEAK.NSIGMA"); 1054 1073 1074 // sigma of gaussian window to down-weight photometric outliers (ignored if NAN or 0.0) 1075 double photomWindowSigma = psMetadataLookupF32 (&status, recipe, "PSASTRO.PHOTOM.WINDOW.SIGMA"); 1076 bool photomWindowApply = !(isnan(photomWindowSigma) || (fabs(photomWindowSigma) < 0.01)); 1077 double photomWindowFactor = photomWindowApply ? -0.5/PS_SQR(photomWindowSigma) : 0.0; 1078 1055 1079 nBin = 2*tweakRange / tweakScale; 1056 1080 psVector *xHist = psVectorAlloc (nBin, PS_TYPE_F32); … … 1079 1103 continue; 1080 1104 1081 xHist->data.F32[xBin] += 1.0; 1082 yHist->data.F32[yBin] += 1.0; 1105 // XXX should I make the scale factor in front a recipe value? 1106 int Npts = 10 * exp(photomWindowFactor*PS_SQR(ob1->magCal - ob2->magCal)); // sigma = 0.22 mag 1107 1108 xHist->data.F32[xBin] += Npts; 1109 yHist->data.F32[yBin] += Npts; 1083 1110 } 1084 1111 }
Note:
See TracChangeset
for help on using the changeset viewer.
