Changeset 42711
- Timestamp:
- Jul 5, 2024, 12:30:50 PM (2 years ago)
- Location:
- branches/eam_branches/ipp-20230313/psphot/src
- Files:
-
- 5 edited
-
psphotChoosePSF.c (modified) (1 diff)
-
psphotMakeResiduals.c (modified) (1 diff)
-
psphotMaskReadout.c (modified) (1 diff)
-
psphotRoughClass.c (modified) (1 diff)
-
psphotSourceStats.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20230313/psphot/src/psphotChoosePSF.c
r42380 r42711 114 114 options->psfTrendNy = psMetadataLookupS32 (&status, recipe, "PSF.TREND.NY"); 115 115 assert (status); 116 117 // use poissonian errors or local-sky errors 118 options->fitPSFstarCoords = psMetadataLookupBool (&status, recipe, "PSF_FIT_STAR_COORDS"); 119 if (!status) { 120 options->fitPSFstarCoords = false; 121 } 116 122 117 123 // get the fixed PSF fit radius -
branches/eam_branches/ipp-20230313/psphot/src/psphotMakeResiduals.c
r42510 r42711 369 369 370 370 if (fabs(resid->Ro->data.F32[oy][ox]) < pixelSN*dRo/sqrt(nKeep)) { 371 // fprintf (stderr, "mask : %d, %d : %f +/- %f (%f for %d) : %d\n", ox, oy, resid->Ro->data.F32[oy][ox], dRo, dRo/sqrt(nKeep), nKeep, resid->mask->data.PM_TYPE_RESID_MASK_DATA[oy][ox]); 371 372 resid->mask->data.PM_TYPE_RESID_MASK_DATA[oy][ox] = 1; 372 373 resid->Ro->data.F32[oy][ox] = 0.0; 373 374 resid->Rx->data.F32[oy][ox] = 0.0; 374 375 resid->Ry->data.F32[oy][ox] = 0.0; 375 } 376 } else { 377 // fprintf (stderr, "keep : %d, %d : %f +/- %f (%f for %d) : %d\n", ox, oy, resid->Ro->data.F32[oy][ox], dRo, dRo/sqrt(nKeep), nKeep, resid->mask->data.PM_TYPE_RESID_MASK_DATA[oy][ox]); 378 } 376 379 } 377 380 } -
branches/eam_branches/ipp-20230313/psphot/src/psphotMaskReadout.c
r34293 r42711 58 58 return false; 59 59 } 60 } 61 62 // XXX test to repair variance 63 if (true) { 64 psImage *im = readout->image; 65 psImage *wt = readout->variance; 66 float maxVar = 0; 67 // find the max value 68 for (int j = 0; j < im->numRows; j++) { 69 for (int i = 0; i < im->numCols; i++) { 70 if (!isfinite(wt->data.F32[j][i])) continue; 71 maxVar = PS_MAX (wt->data.F32[j][i], maxVar); 72 } 73 } 74 // set pixels with nan variance and non-nan image to maxVar 75 for (int j = 0; j < im->numRows; j++) { 76 for (int i = 0; i < im->numCols; i++) { 77 if (!isfinite(im->data.F32[j][i])) continue; 78 if (isfinite(wt->data.F32[j][i])) continue; 79 wt->data.F32[j][i] = maxVar; 80 } 81 } 60 82 } 61 83 -
branches/eam_branches/ipp-20230313/psphot/src/psphotRoughClass.c
r36375 r42711 198 198 } 199 199 200 psfClump = pmSourcePSFClump (NULL, region, sources, PSF_SN_LIM, PSF_CLUMP_GRID_SCALE, MOMENTS_SX_MAX, MOMENTS_SY_MAX, MOMENTS_SX_MIN, MOMENTS_SY_MIN, MOMENTS_AR_MAX); 200 // use clipped stats or robust stats to define the clump 201 bool PSF_CLUMP_USE_CLIPPED_STATS = psMetadataLookupF32(&status, recipe, "PSF_CLUMP_USE_CLIPPED_STATS"); 202 if (!status) { PSF_CLUMP_USE_CLIPPED_STATS = true; } 203 204 psfClump = pmSourcePSFClump (NULL, region, sources, PSF_SN_LIM, PSF_CLUMP_GRID_SCALE, MOMENTS_SX_MAX, MOMENTS_SY_MAX, MOMENTS_SX_MIN, MOMENTS_SY_MIN, MOMENTS_AR_MAX, PSF_CLUMP_USE_CLIPPED_STATS); 201 205 202 206 psMetadataAddF32 (regionMD, PS_LIST_TAIL, "PSF.CLUMP.X", PS_META_REPLACE, "psf clump center", psfClump.X); -
branches/eam_branches/ipp-20230313/psphot/src/psphotSourceStats.c
r42439 r42711 506 506 MOMENTS_SY_MIN = 0.5; 507 507 } 508 509 // use clipped stats or robust stats to define the clump 510 bool PSF_CLUMP_USE_CLIPPED_STATS = psMetadataLookupF32(&status, recipe, "PSF_CLUMP_USE_CLIPPED_STATS"); 511 if (!status) { PSF_CLUMP_USE_CLIPPED_STATS = true; } 508 512 509 513 // when we set the window, we are not attempting to measure spatial variations; we can use a somewhat higher S/N limit … … 597 601 598 602 // determine the PSF parameters from the source moment values 599 pmPSFClump psfClump = pmSourcePSFClump (NULL, NULL, sourceSubset, PSF_SN_LIM, PSF_CLUMP_GRID_SCALE, MOMENTS_SX_MAX, MOMENTS_SY_MAX, MOMENTS_SX_MIN, MOMENTS_SY_MIN, MOMENTS_AR_MAX );603 pmPSFClump psfClump = pmSourcePSFClump (NULL, NULL, sourceSubset, PSF_SN_LIM, PSF_CLUMP_GRID_SCALE, MOMENTS_SX_MAX, MOMENTS_SY_MAX, MOMENTS_SX_MIN, MOMENTS_SY_MIN, MOMENTS_AR_MAX, PSF_CLUMP_USE_CLIPPED_STATS); 600 604 psLogMsg ("psphot", 3, "sigma guess (pix) %.1f, nStars: %d of %d in clump, nSigma: %5.2f, X, Y: %f, %f (%f, %f)\n", sigma[i], psfClump.nStars, psfClump.nTotal, psfClump.nSigma, psfClump.X, psfClump.Y, sqrt(psfClump.X) / sigma[i], sqrt(psfClump.Y) / sigma[i]); 601 605
Note:
See TracChangeset
for help on using the changeset viewer.
