Changeset 38515 for trunk/psphot/src/psphotStackUpdateReadout.c
- Timestamp:
- Jun 22, 2015, 3:23:53 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotStackUpdateReadout.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotStackUpdateReadout.c
r38396 r38515 116 116 // XXX NOTE : if we use the pre-20130914 psphotStackReadout code, we need to use 'false' for the 117 117 // sourcesSubtracted argument 118 psArray *objectsOut = psphotSourceChildrenByObject (config, view, STACK_OUT, objects, true); 118 // XXX: do this here so that the variance is availble to rebuild the models 119 psphotStackMatchPSFsetup (config, view, STACK_OUT, STACK_RAW); 120 psArray *objectsOut = psphotSourceChildrenByObject (config, view, STACK_OUT, STACK_RAW, objects, true); 119 121 if (!objectsOut) { 120 122 psFree(objects); … … 135 137 // this forces photometry on the undetected sources from other images 136 138 137 // set up the FWHM vector 138 psphotStackMatchPSFsetup (config, view, STACK_OUT, STACK_RAW);139 // Moved this up above 140 // psphotStackMatchPSFsetup (config, view, STACK_OUT, STACK_RAW); 139 141 psphotDumpImages (config, view, STACK_RAW, "raw.t0"); 140 142 psphotDumpImages (config, view, STACK_OUT, "out.t0"); … … 177 179 // and to subtract the sources 178 180 psphotFitSourcesLinear (config, view, STACK_OUT, false, false); 181 182 #ifdef notyet 183 psphotRemoveAllSources (config, view, STACK_OUT, false); 184 #endif 185 179 186 snprintf (line, 256, "%s.%d", "out.t4", entry); 180 187 psphotDumpImages (config, view, STACK_OUT, line); … … 221 228 COPY_PARAM( "MSKY_NX" ); 222 229 COPY_PARAM( "MSKY_NY" ); 223 COPY_PARAM( "CHIP_SEEING" );230 // COPY_PARAM( "CHIP_SEEING" ); 224 231 } 225 232 … … 312 319 fitOptions->poissonErrors = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_FITS_POISSON"); 313 320 if (!status) fitOptions->poissonErrors = true; 321 314 322 int psfSize = psMetadataLookupS32 (&status, recipe, "PCM_BOX_SIZE"); 315 323 assert (status); 324 325 // Remember these data for later 326 psMetadataAddPtr (readout->analysis, PS_LIST_TAIL, "PCM_FIT_OPTIONS", PS_DATA_UNKNOWN | PS_META_REPLACE, "pcm fit options", fitOptions); 316 327 317 328 for (int i = 0; i < sources->n; i++) { … … 331 342 // fprintf(stderr, "source %d %5d should not have a psf model 0x%08X%08X\n", index, source->seq, source->mode2, source->mode); 332 343 psFree(source->modelPSF) ; 344 modelPSF = NULL; 333 345 } 334 346 335 347 // make sure that the window radius is large enough. Should we do this regardless of whether 336 348 // or not the source is extended? 337 if (source->modelEXT) {338 float fitRadius = NAN;339 float windowRadius = NAN;349 float fitRadius = NAN; 350 float windowRadius = NAN; 351 if (1 || source->modelEXT) { 340 352 if (!psphotSetRadiusMoments (&fitRadius, &windowRadius, readout, source, markVal)) { 341 353 psError (PSPHOT_ERR_UNKNOWN, false, "failed to set radius for ext source"); … … 387 399 float modelFlux = pow(10., -0.4 * model->mag); 388 400 389 // XXX: We are assuming here that we only use PCM models. Should get that information from the recipe. 401 model->fitRadius = fitRadius; 402 403 // XXX: We are assuming here that we only use PCM models. 404 // I Should be getting that information from the recipe. 390 405 pmPCMdata *pcm = pmPCMinit (source, fitOptions, model, maskVal, psfSize); 391 406 if (!pcm) { … … 394 409 } 395 410 model->params->data.F32[PM_PAR_I0] = 1.0; 396 pmPCMMakeModel (source, model, pcm->nsigma, maskVal, psfSize); 411 // XXX: this duplicates work that pmPCMCacheModel does 412 // pmPCMMakeModel (source, model, pcm->nsigma, maskVal, psfSize); 397 413 float normFlux = model->class->modelFlux(model->params); 398 414 float I0 = modelFlux / normFlux;
Note:
See TracChangeset
for help on using the changeset viewer.
