Changeset 35972
- Timestamp:
- Aug 19, 2013, 6:45:18 AM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130711/psphot/src
- Files:
-
- 3 edited
-
psphotExtendedSourceFits.c (modified) (5 diffs)
-
psphotRadiusChecks.c (modified) (1 diff)
-
psphotSourceFits.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130711/psphot/src/psphotExtendedSourceFits.c
r35844 r35972 65 65 psphotVisualShowImage(readout); 66 66 67 // psphotSaveImage (NULL, readout->image, "test.01.fits"); 68 67 69 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 68 70 psAssert (detections, "missing detections?"); … … 123 125 } 124 126 127 // perform full extended source non-linear fits? 128 bool isInteractive = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_FITS_INTERACTIVE"); 129 if (!status) isInteractive = false; 130 125 131 // Define source fitting parameters for extended source fits 126 132 pmSourceFitOptions *fitOptions = pmSourceFitOptionsAlloc(); 127 fitOptions->mode = PM_SOURCE_FIT_EXT ;133 fitOptions->mode = PM_SOURCE_FIT_EXT_AND_SKY; 128 134 fitOptions->saveCovariance = true; // XXX make this a user option? 129 135 fitOptions->covarFactor = psImageCovarianceFactorForAperture(readout->covariance, 10.0); // Covariance matrix … … 134 140 fitOptions->gainFactorMode = gainFactorMode; 135 141 fitOptions->chisqConvergence = chisqConvergence; 142 fitOptions->isInteractive = isInteractive; 136 143 137 144 // maskVal is used to test for rejected pixels, and must include markVal … … 296 303 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Nfail 297 304 298 // set this to 0 to run without threading 299 # if (1) 300 if (!psThreadJobAddPending(job)) { 301 psError(PS_ERR_UNKNOWN, false, "Unable to guess model."); 302 psFree(AnalysisRegion); 303 psFree (fitOptions); 304 psFree (models); 305 psphotSersicModelClassCleanup(); 306 return false; 307 } 308 # else 309 if (!psphotExtendedSourceFits_Threaded(job)) { 310 psError(PS_ERR_UNKNOWN, false, "Unable to guess model."); 311 psFree(AnalysisRegion); 312 psFree (fitOptions); 313 psFree (models); 314 psphotSersicModelClassCleanup(); 315 return false; 305 if (!isInteractive) { 306 if (!psThreadJobAddPending(job)) { 307 psError(PS_ERR_UNKNOWN, false, "Unable to guess model."); 308 psFree(AnalysisRegion); 309 psFree (fitOptions); 310 psFree (models); 311 psphotSersicModelClassCleanup(); 312 return false; 313 } 314 } else { 315 // run without threading 316 if (!psphotExtendedSourceFits_Threaded(job)) { 317 psError(PS_ERR_UNKNOWN, false, "Unable to guess model."); 318 psFree(AnalysisRegion); 319 psFree (fitOptions); 320 psFree (models); 321 psphotSersicModelClassCleanup(); 322 return false; 323 } 324 psScalar *scalar = NULL; 325 scalar = job->args->data[9]; 326 Next += scalar->data.S32; 327 scalar = job->args->data[10]; 328 Nconvolve += scalar->data.S32; 329 scalar = job->args->data[11]; 330 NconvolvePass += scalar->data.S32; 331 scalar = job->args->data[12]; 332 Nplain += scalar->data.S32; 333 scalar = job->args->data[13]; 334 NplainPass += scalar->data.S32; 335 scalar = job->args->data[14]; 336 Nfaint += scalar->data.S32; 337 scalar = job->args->data[15]; 338 Nfail += scalar->data.S32; 339 psFree(job->args->data[3]); // iterator allocated above 340 psFree(job); 316 341 } 317 psScalar *scalar = NULL;318 scalar = job->args->data[9];319 Next += scalar->data.S32;320 scalar = job->args->data[10];321 Nconvolve += scalar->data.S32;322 scalar = job->args->data[11];323 NconvolvePass += scalar->data.S32;324 scalar = job->args->data[12];325 Nplain += scalar->data.S32;326 scalar = job->args->data[13];327 NplainPass += scalar->data.S32;328 scalar = job->args->data[14];329 Nfaint += scalar->data.S32;330 scalar = job->args->data[15];331 Nfail += scalar->data.S32;332 psFree(job->args->data[3]); // iterator allocated above333 psFree(job);334 # endif335 342 } 336 343 … … 377 384 378 385 psphotSersicModelClassCleanup(); 386 387 // psphotSaveImage (NULL, readout->image, "test.02.fits"); 379 388 380 389 psphotVisualShowResidualImage (readout, false); -
branches/eam_branches/ipp-20130711/psphot/src/psphotRadiusChecks.c
r32348 r35972 171 171 # undef MIN_WINDOW 172 172 173 # define MIN_WINDOW 5.0 174 # define SCALE1 5.0 173 // XXX EAM : 20130724 : for a test, double the window size parameters 174 # define MIN_WINDOW 10.0 175 # define SCALE1 7.0 175 176 # define PAD_WINDOW 3.0 176 177 -
branches/eam_branches/ipp-20130711/psphot/src/psphotSourceFits.c
r35769 r35972 606 606 return model; 607 607 } 608 // XXX TEST: 609 // pcm->modelConv->params->data.F32[4] = 30.0; 610 // pcm->modelConv->params->data.F32[5] = 30.0; 608 611 } 609 612 … … 613 616 options.mode = PM_SOURCE_FIT_NO_INDEX; 614 617 } else { 615 options.mode = PM_SOURCE_FIT_EXT; 618 options.mode = PM_SOURCE_FIT_EXT_AND_SKY; // XXX note that there may be a conflict with psphotExtendedSourceFits.c:133 616 619 } 617 620 // update the pcm elements if we have changed the circumstance (options.mode or source->pixels)
Note:
See TracChangeset
for help on using the changeset viewer.
