Changeset 10859
- Timestamp:
- Dec 29, 2006, 5:27:19 PM (19 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 5 edited
-
astrom/pmAstrometryDistortion.c (modified) (10 diffs)
-
astrom/pmAstrometryObjects.c (modified) (2 diffs)
-
astrom/pmAstrometryWCS.c (modified) (2 diffs)
-
detrend/pmShutterCorrection.c (modified) (1 diff)
-
objects/pmPSFtry.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/astrom/pmAstrometryDistortion.c
r10851 r10859 7 7 * @author EAM, IfA 8 8 * 9 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-12- 29 18:29:59 $9 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-12-30 03:27:19 $ 11 11 * 12 12 * Copyright 2006 Institute for Astronomy, University of Hawaii … … 128 128 fscanf (stdin, "%c", &key); 129 129 130 // fit the collection of positions and offsets with a local 1st order gradient131 // 3hi/3lo sigma clipping on the rflux vs metric fit130 // stats structure and mask for use in measuring the clipping statistic 131 // this analysis has too few data points to use the robust median method 132 132 psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV); 133 133 psVector *mask = psVectorAlloc (Npts, PS_TYPE_MASK); … … 136 136 pmAstromGradient *grad = pmAstromGradientAlloc (); 137 137 138 psVectorStats (stats, L, NULL, NULL, 0); 139 grad->FP.x = stats->sampleMedian; 140 141 psVectorStats (stats, M, NULL, NULL, 0); 142 grad->FP.y = stats->sampleMedian; 143 144 // test how many survive and include / exclude points on that basis 138 // fit the collection of positions and offsets with a local 1st order gradient 139 // apply 3hi/3lo sigma clipping to the fitted data values 140 // the mask is used to mark the points which pass / fail the fit 145 141 if (!psVectorClipFitPolynomial2D (local, stats, mask, 0xff, dP, NULL, L, M)) { 146 142 psFree (grad); … … 151 147 grad->dTPdM.x = local->coeff[0][1]; 152 148 149 // fit the collection of positions and offsets with a local 1st order gradient 150 // apply 3hi/3lo sigma clipping to the fitted data values 151 // the mask is used to mark the points which pass / fail the fit 153 152 if (!psVectorClipFitPolynomial2D (local, stats, mask, 0xff, dQ, NULL, L, M)) { 154 153 psFree (grad); … … 159 158 grad->dTPdM.y = local->coeff[0][1]; 160 159 160 // also measure the L and M median positions as a representative coordinate 161 psVectorStats (stats, L, NULL, NULL, 0); 162 grad->FP.x = stats->sampleMedian; 163 164 psVectorStats (stats, M, NULL, NULL, 0); 165 grad->FP.y = stats->sampleMedian; 166 161 167 psArrayAdd (gradients, 100, grad); 162 168 psFree (grad); 169 psFree (stats); 170 psFree (mask); 163 171 } 164 172 } … … 210 218 fscanf (stdin, "%c", &key); 211 219 220 // mask and stats structure for measuring the clipping statistic 221 // this analysis has too few data points to use the robust median method 212 222 psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV); 213 223 psVector *mask = psVectorAlloc (gradients->n, PS_TYPE_MASK); … … 217 227 // determine the gradient order(s) from the fpa->toTP structure 218 228 localX = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTPA->x->nX-1, fpa->toTPA->x->nY); 219 220 229 localY = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTPA->x->nX, fpa->toTPA->x->nY-1); 221 230 222 // set masks based on fpa->toTP 231 // set masks based on fpa->toTPA 223 232 for (int i = 0; i <= fpa->toTPA->x->nX; i++) { 224 233 for (int j = 0; j <= fpa->toTPA->x->nY; j++) { … … 246 255 247 256 // XXX test: generate fit 248 psVector *dPdLf = psPolynomial2DEvalVector (localX, L, M);249 psVector *dPdMf = psPolynomial2DEvalVector (localY, L, M);257 psVector *dPdLfit = psPolynomial2DEvalVector (localX, L, M); 258 psVector *dPdMfit = psPolynomial2DEvalVector (localY, L, M); 250 259 251 260 // update fpa->toTP distortion terms … … 291 300 292 301 // XXX test: generate fit 293 psVector *dQdLf = psPolynomial2DEvalVector (localX, L, M);294 psVector *dQdMf = psPolynomial2DEvalVector (localY, L, M);302 psVector *dQdLfit = psPolynomial2DEvalVector (localX, L, M); 303 psVector *dQdMfit = psPolynomial2DEvalVector (localY, L, M); 295 304 296 305 FILE *f = fopen ("gradients.dat", "w"); 297 for (int i = 0; i < dPdLf ->n; i++) {306 for (int i = 0; i < dPdLfit->n; i++) { 298 307 fprintf (f, "%f %f | %f %f %f %f | %f %f %f %f\n", 299 308 L->data.F32[i], M->data.F32[i], 300 309 dPdL->data.F32[i], dPdM->data.F32[i], 301 310 dQdL->data.F32[i], dQdM->data.F32[i], 302 dPdLf ->data.F32[i], dPdMf->data.F32[i],303 dQdLf ->data.F32[i], dQdMf->data.F32[i]);311 dPdLfit->data.F32[i], dPdMfit->data.F32[i], 312 dQdLfit->data.F32[i], dQdMfit->data.F32[i]); 304 313 } 305 314 fclose (f); 315 psFree (dPdLfit); 316 psFree (dPdMfit); 317 psFree (dQdLfit); 318 psFree (dQdMfit); 306 319 307 320 // update fpa->toTP distortion terms … … 337 350 psFree (mask); 338 351 339 // XXX need to reset the fromFPA terms here 340 352 // XXX need to reset the fromTPA terms here 353 // XXX choose an appropriate region based on the range of values 354 // in L and M? 355 psRegion region = psRegionSet (0, 4000, 0, 4000); 356 psPlaneTransformInvert(fpa->fromTPA, fpa->toTPA, region, 50); 341 357 342 358 return true; -
trunk/psModules/src/astrom/pmAstrometryObjects.c
r10852 r10859 8 8 * @author EAM, IfA 9 9 * 10 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $11 * @date $Date: 2006-12- 29 18:30:36$10 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-12-30 03:27:19 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 227 227 psVectorInit (mask, 0); 228 228 229 // the stats options supplied are used to perform the clip fitting 229 230 pmAstromFitResults *results = pmAstromFitResultsAlloc(); 230 231 results->xStats = psStatsAlloc (PS_STAT_NONE); -
trunk/psModules/src/astrom/pmAstrometryWCS.c
r10850 r10859 7 7 * @author EAM, IfA 8 8 * 9 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-12- 29 18:29:34$9 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-12-30 03:27:19 $ 11 11 * 12 12 * Copyright 2006 Institute for Astronomy, University of Hawaii … … 453 453 } 454 454 455 // free an existing toFPA structure 455 456 chip->toFPA = toFPA; 456 457 // XXX this needs to perform the full (non-linear) inversion -
trunk/psModules/src/detrend/pmShutterCorrection.c
r10410 r10859 226 226 line->coeff[1][1] = 0; 227 227 228 psStats *stats = psStatsAlloc(0); 228 // the stats structure determines how the clipping statistic is measured 229 // too few points to use the robust analysis method 230 psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV); 229 231 stats->clipSigma = rej; 230 232 stats->clipIter = nIter; -
trunk/psModules/src/objects/pmPSFtry.c
r10853 r10859 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.3 2$ $Name: not supported by cvs2svn $8 * @date $Date: 2006-12- 29 18:31:11$7 * @version $Revision: 1.33 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-12-30 03:27:19 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 208 208 209 209 // use 3hi/3lo sigma clipping on the chisq fit 210 psStats *stats = psStatsAlloc (PS_STAT_ SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV);210 psStats *stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); 211 211 stats->clipSigma = 3.0; 212 212 stats->clipIter = 3; … … 214 214 // linear clipped fit of chisq trend vs flux 215 215 bool result = psVectorClipFitPolynomial1D(psfTry->psf->ChiTrend, stats, mask, 1, chisq, NULL, flux); 216 psLogMsg ("pmPSFtry", 4, "chisq vs flux fit: %f +/- %f\n", stats-> sampleMedian, stats->sampleStdev);216 psLogMsg ("pmPSFtry", 4, "chisq vs flux fit: %f +/- %f\n", stats->robustMedian, stats->robustStdev); 217 217 218 218 psFree (flux); … … 262 262 263 263 // use 3hi/1lo sigma clipping on the r2rflux vs metric fit 264 psStats *stats = psStatsAlloc (PS_STAT_ SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV);264 psStats *stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); 265 265 stats->min = 1.0; 266 266 stats->max = 3.0; … … 363 363 // mask is currently updated for each pass. this is inconsistent? 364 364 365 psStats *stats = psStatsAlloc (PS_STAT_ SAMPLE_MEAN | PS_STAT_SAMPLE_STDEV);365 psStats *stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); 366 366 367 367 // skip the unfitted parameters (X, Y, Io, Sky)
Note:
See TracChangeset
for help on using the changeset viewer.
