Changeset 39747
- Timestamp:
- Oct 11, 2016, 8:40:34 AM (10 years ago)
- Location:
- branches/czw_branch/20160809/Ohana/src/relastro
- Files:
-
- 5 edited
-
include/relastro.h (modified) (1 diff)
-
src/BootstrapOps.c (modified) (1 diff)
-
src/UpdateObjects.c (modified) (6 diffs)
-
src/args.c (modified) (1 diff)
-
src/relastro_images.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20160809/Ohana/src/relastro/include/relastro.h
r39746 r39747 453 453 454 454 FitMode FIT_MODE; 455 int USE_IRLS; 456 int ALLOW_IRLS; 455 457 456 458 RelastroOp RELASTRO_OP; -
branches/czw_branch/20160809/Ohana/src/relastro/src/BootstrapOps.c
r39457 r39747 77 77 case FIT_RESULT_RA: 78 78 // result->Ro = median; 79 result->dRo = sigma;79 result->dRo = MAX(sigma, result->dRo); 80 80 break; 81 81 case FIT_RESULT_DEC: 82 82 // result->Do = median; 83 result->dDo = sigma;83 result->dDo = MAX(sigma, result->dDo); 84 84 break; 85 85 case FIT_RESULT_uR: 86 86 // result->uR = median; 87 result->duR = sigma;87 result->duR = MAX(sigma, result->duR); 88 88 break; 89 89 case FIT_RESULT_uD: 90 90 // result->uD = median; 91 result->duD = sigma;91 result->duD = MAX(sigma, result->duD); 92 92 break; 93 93 case FIT_RESULT_PLX: 94 94 // result->p = median; 95 result->dp = sigma;95 result->dp = MAX(sigma, result->dp); 96 96 break; 97 97 default: -
branches/czw_branch/20160809/Ohana/src/relastro/src/UpdateObjects.c
r39735 r39747 200 200 // then run N_BOOTSTRAP_SAMPLES to measure the errors 201 201 fitStats->fitdataPar->getError = !N_BOOTSTRAP_SAMPLES; 202 if (!FitPMandPar_IRLS (&fitPar, fitStats->fitdataPar, fitStats->points, fitStats->Npoints)) { 203 mode = FIT_PM_ONLY; 204 goto skipParallax; 205 } 206 207 if (N_BOOTSTRAP_SAMPLES) { 202 if (USE_IRLS) { 203 if (!FitPMandPar_IRLS (&fitPar, fitStats->fitdataPar, fitStats->points, fitStats->Npoints)) { 204 mode = FIT_PM_ONLY; 205 goto skipParallax; 206 } 207 } else { 208 if (!FitPMandPar_Basic (&fitPar, fitStats->fitdataPar, fitStats->points, fitStats->Npoints)) { 209 mode = FIT_PM_ONLY; 210 goto skipParallax; 211 } 212 } 213 214 // in the fits above, we have saved the formal error for the unmasked points. 215 // if we do not have enough points for bootstrap, we will keep those errors 216 if (N_BOOTSTRAP_SAMPLES && (fitPar.Nfit >= PAR_MIN_NPTS_BOOT)) { 208 217 fitStats->Nfit = 0; 209 218 int Nnomask = BootstrapSaveUnmasked (fitStats->nomask, fitStats->points, fitStats->Npoints); … … 218 227 fitStats->Nfit ++; 219 228 } 220 // these calls set the ERRORS on the fit parameters, not the fit values (set in IRLS above) 229 // These calls set the ERRORS on the fit parameters, not the fit values (set in IRLS above) 230 // this call expects the fitted parameters to have the formal error set: it will apply the 231 // max of the formal and bootstrap errors 221 232 BootstrapRobustStats (&fitPar, fitStats->fit, fitStats->Nfit, FIT_RESULT_RA); 222 233 BootstrapRobustStats (&fitPar, fitStats->fit, fitStats->Nfit, FIT_RESULT_DEC); … … 273 284 } else { 274 285 fitStats->fitdataPM->getError = !N_BOOTSTRAP_SAMPLES; 275 if (!FitPM_IRLS (&fitPM, fitStats->fitdataPM, fitStats->points, fitStats->Npoints)) { 276 mode = FIT_AVERAGE; 277 goto justPosition; 278 } 279 if (N_BOOTSTRAP_SAMPLES) { 286 if (USE_IRLS) { 287 if (!FitPM_IRLS (&fitPM, fitStats->fitdataPM, fitStats->points, fitStats->Npoints)) { 288 mode = FIT_AVERAGE; 289 goto justPosition; 290 } 291 } else { 292 if (!FitPM_Basic (&fitPM, fitStats->fitdataPM, fitStats->points, fitStats->Npoints)) { 293 mode = FIT_AVERAGE; 294 goto justPosition; 295 } 296 } 297 298 // in the fits above, we have saved the formal error for the unmasked points. 299 // if we do not have enough points for bootstrap, we will keep those errors 300 if (N_BOOTSTRAP_SAMPLES && (fitPM.Nfit >= PM_MIN_NPTS_BOOT)) { 280 301 fitStats->Nfit = 0; 281 302 int Nnomask = BootstrapSaveUnmasked (fitStats->nomask, fitStats->points, fitStats->Npoints); … … 289 310 fitStats->Nfit ++; 290 311 } 312 // These calls set the ERRORS on the fit parameters, not the fit values (set in IRLS above) 313 // this call expects the fitted parameters to have the formal error set: it will apply the 314 // max of the formal and bootstrap errors 291 315 BootstrapRobustStats (&fitPM, fitStats->fit, fitStats->Nfit, FIT_RESULT_RA); 292 316 BootstrapRobustStats (&fitPM, fitStats->fit, fitStats->Nfit, FIT_RESULT_DEC); … … 343 367 goto useBasic; 344 368 } 345 if (!FitPosPMfixed_IRLS (&fitPos, fitStats->fitdataPos, fitStats->points, fitStats->Npoints)) { 346 // if the above fails, we need to clear the masks and try again below 347 FitPointsClearMasks (fitStats->points, fitStats->Npoints); 348 // just calculate the weighted average 369 if (USE_IRLS) { 370 if (!FitPosPMfixed_IRLS (&fitPos, fitStats->fitdataPos, fitStats->points, fitStats->Npoints)) { 371 // if the above fails, we need to clear the masks and try again below 372 FitPointsClearMasks (fitStats->points, fitStats->Npoints); 373 // just calculate the weighted average 374 if (!FitPosPMfixed_Basic (&fitPos, fitStats->fitdataPos, fitStats->points, fitStats->Npoints)) { 375 // if this fails, find a single unmasked point below 376 goto doneWithFit; 377 } 378 average[0].flags |= ID_OBJ_USE_AVE; 379 average[0].flags |= ID_OBJ_RAW_AVE; 380 goto useBasic; 381 } 382 } else { 349 383 if (!FitPosPMfixed_Basic (&fitPos, fitStats->fitdataPos, fitStats->points, fitStats->Npoints)) { 350 384 // if this fails, find a single unmasked point below … … 360 394 int Nnomask = BootstrapSaveUnmasked (fitStats->nomask, fitStats->points, fitStats->Npoints); 361 395 if (Nnomask < POS_MIN_NPTS_BOOT) { 362 // if the above fails, we need to clear the masks and try again below396 // XXX if the above fails, accept the formal error from unmasked points? 363 397 FitPointsClearMasks (fitStats->points, fitStats->Npoints); 364 398 if (!FitPosPMfixed_Basic (&fitPos, fitStats->fitdataPos, fitStats->points, fitStats->Npoints)) { -
branches/czw_branch/20160809/Ohana/src/relastro/src/args.c
r39746 r39747 176 176 exit (2); 177 177 } 178 } 179 180 // for fitting objects, this is always the same as 'ALLOW_IRLS' below, but for fitting 181 // images, this is set to FALSE while doing the fit for the image parameters 182 USE_IRLS = TRUE; 183 ALLOW_IRLS = TRUE; 184 if ((N = get_argument (argc, argv, "-no-irls"))) { 185 remove_argument (N, &argc, argv); 186 USE_IRLS = FALSE; 187 ALLOW_IRLS = FALSE; 178 188 } 179 189 -
branches/czw_branch/20160809/Ohana/src/relastro/src/relastro_images.c
r39738 r39747 64 64 65 65 // XXX NOTE : for 2mass reset, photcodesKeep should now limit to 2MASS measurements 66 67 USE_IRLS = FALSE; // do not use IRLS yet -- leads to excessive outlier rejections in the loops 66 68 67 69 /* major modes */ … … 161 163 // iterate over catalogs to make detection coordinates consistant 162 164 if (APPLY_OFFSETS) { 165 USE_IRLS = ALLOW_IRLS; // now that we have fitted the images, choose the user's option 163 166 UpdateObjectOffsets (skylist, 0, NULL); 164 167 }
Note:
See TracChangeset
for help on using the changeset viewer.
