Changeset 34378
- Timestamp:
- Sep 2, 2012, 1:10:10 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20120805/psphot/src
- Files:
-
- 17 edited
-
psphot.h (modified) (1 diff)
-
psphotAddNoise.c (modified) (2 diffs)
-
psphotApResid.c (modified) (1 diff)
-
psphotBlendFit.c (modified) (4 diffs)
-
psphotExtendedSourceAnalysis.c (modified) (1 diff)
-
psphotExtendedSourceFits.c (modified) (1 diff)
-
psphotFindDetections.c (modified) (2 diffs)
-
psphotFitSourcesLinear.c (modified) (1 diff)
-
psphotGuessModels.c (modified) (1 diff)
-
psphotKronIterate.c (modified) (1 diff)
-
psphotMagnitudes.c (modified) (1 diff)
-
psphotRadialApertures.c (modified) (1 diff)
-
psphotRadialProfileWings.c (modified) (2 diffs)
-
psphotReadout.c (modified) (4 diffs)
-
psphotSourceSize.c (modified) (1 diff)
-
psphotSourceStats.c (modified) (1 diff)
-
psphotVisual.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120805/psphot/src/psphot.h
r34368 r34378 513 513 ); 514 514 515 bool psphotSatstarProfileModel (pmSource *source, psImageMaskType maskVal); 516 bool psphotSatstarProfileCreate (pmSource *source, psVector **logRmodelOut, psVector **logFmodelOut, psVector *logR, psVector *flux, float Rmax); 517 bool psphotSatstarProfileOp (pmSource *source, psImageMaskType maskVal, float FACTOR, pmModelOpMode mode, bool add); 518 bool psphotVisualRadialProfileSatstar (pmSource *source, psImageMaskType maskVal); 519 bool psphotAddOrSubSatstarsReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int fileIndex, psMetadata *recipe, bool add); 520 bool psphotSatstarPhotometry (pmSource *source); 521 515 522 #endif -
branches/eam_branches/ipp-20120805/psphot/src/psphotAddNoise.c
r33980 r34378 76 76 } 77 77 78 psphotVisualShowImage (readout); 79 78 80 // loop over all source 79 81 for (int i = 0; i < sources->n; i++) { 80 82 pmSource *source = sources->data[i]; 83 84 // add or subtract noise for a saturated star. satstars modeled as a radial profile 85 // need special handling 86 if (source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE) { 87 psphotSatstarProfileOp (source, maskVal, FACTOR, PM_MODEL_OP_NOISE, add); 88 continue; 89 } 81 90 82 91 // skip sources which were not subtracted … … 92 101 } 93 102 103 psphotVisualShowImage (readout); 104 94 105 return true; 95 106 } -
branches/eam_branches/ipp-20120805/psphot/src/psphotApResid.c
r33089 r34378 200 200 if (source->mode & PM_SOURCE_MODE_FAIL) SKIPSTAR ("FAIL STAR"); 201 201 if (source->mode & PM_SOURCE_MODE_POOR) SKIPSTAR ("POOR STAR"); 202 203 // skip saturated stars modeled with a radial profile 204 if (source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE) SKIPSTAR ("SATSTAR"); 202 205 203 206 if (source->mode & PM_SOURCE_MODE_EXT_LIMIT) SKIPSTAR ("EXTENDED"); -
branches/eam_branches/ipp-20120805/psphot/src/psphotBlendFit.c
r34258 r34378 241 241 pmSource *source = sources->data[i]; 242 242 243 # if (0) 244 # define TEST_X 34245 # define TEST_ Y 28246 243 int TEST_ON = false; 244 # if (1) 245 # define TEST_X 653 246 # define TEST_Y 466 247 247 if ((fabs(source->peak->xf - TEST_X) < 5) && (fabs(source->peak->yf - TEST_Y) < 5)) { 248 248 fprintf (stderr, "test object\n"); 249 } 250 249 // psTraceSetLevel("psLib.math.psMinimizeLMChi2", 5); 250 TEST_ON = true; 251 } 251 252 # undef TEST_X 252 253 # undef TEST_Y … … 258 259 if (source->type == PM_SOURCE_TYPE_DEFECT) continue; 259 260 if (source->type == PM_SOURCE_TYPE_SATURATED) continue; 261 262 // skip saturated stars modeled with a radial profile 263 if (source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE) continue; 260 264 261 265 // skip DBL second sources (ie, added by psphotFitBlob … … 306 310 if (source->mode & PM_SOURCE_MODE_EXT_LIMIT) { 307 311 if (psphotFitBlob (readout, source, newSources, psf, fitOptions, maskVal, markVal)) { 312 if (TEST_ON) { 313 psTraceSetLevel("psLib.math.psMinimizeLMChi2", 0); 314 } 308 315 psTrace ("psphot", 5, "source at %7.1f, %7.1f is ext", source->peak->xf, source->peak->yf); 309 316 Next ++; … … 312 319 } else { 313 320 if (psphotFitBlend (readout, source, psf, fitOptions, maskVal, markVal)) { 321 if (TEST_ON) { 322 psTraceSetLevel("psLib.math.psMinimizeLMChi2", 0); 323 } 314 324 source->type = PM_SOURCE_TYPE_STAR; 315 325 psTrace ("psphot", 5, "source at %7.1f, %7.1f is psf", source->peak->xf, source->peak->yf); -
branches/eam_branches/ipp-20120805/psphot/src/psphotExtendedSourceAnalysis.c
r33089 r34378 218 218 if (source->mode & PM_SOURCE_MODE_SATSTAR) continue; 219 219 220 // skip saturated stars modeled with a radial profile 221 if (source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE) continue; 222 220 223 // optionally allow non-extended objects to get petrosians as well 221 224 if (!doPetroStars) { -
branches/eam_branches/ipp-20120805/psphot/src/psphotExtendedSourceFits.c
r34258 r34378 317 317 if (source->type == PM_SOURCE_TYPE_DEFECT) continue; 318 318 if (source->type == PM_SOURCE_TYPE_SATURATED) continue; 319 320 // skip saturated stars modeled with a radial profile 321 if (source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE) continue; 319 322 320 323 // XXX this should use peak? -
branches/eam_branches/ipp-20120805/psphot/src/psphotFindDetections.c
r33914 r34378 120 120 if (useFootprints) { 121 121 if (replaceSourcesForFootprints) { 122 // subtract the noise for all sources including satstars 122 123 psphotAddOrSubNoiseReadout(config, view, filerule, index, recipe, false); 123 124 psphotReplaceAllSourcesReadout (config, view, filerule, index, recipe, false); 125 126 // add in the satstars 127 psphotAddOrSubSatstarsReadout (config, view, filerule, index, recipe, true); 128 124 129 psFree (significance); 125 130 significance = psphotSignificanceImage (readout, recipe, maskVal); 131 132 // display the significance image 133 psphotVisualShowSignificance (significance->variance, 0.98*threshold, 1.02*threshold); 126 134 } 127 135 … … 130 138 if (replaceSourcesForFootprints) { 131 139 psphotRemoveAllSourcesReadout (config, view, filerule, index, recipe, false); 140 141 // subtract the satstars 142 psphotAddOrSubSatstarsReadout (config, view, filerule, index, recipe, false); 132 143 } 133 144 } -
branches/eam_branches/ipp-20120805/psphot/src/psphotFitSourcesLinear.c
r34274 r34378 222 222 if (source->type == PM_SOURCE_TYPE_DEFECT) continue; 223 223 if (source->type == PM_SOURCE_TYPE_SATURATED) continue; 224 225 // skip saturated stars modeled with a radial profile 226 if (source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE) continue; 224 227 225 228 // do not include CRs in the full ensemble fit -
branches/eam_branches/ipp-20120805/psphot/src/psphotGuessModels.c
r33089 r34378 169 169 source->tmpFlags |= PM_SOURCE_TMPF_MODEL_GUESS; 170 170 171 // skip non-astronomical objects (very likely defects) 172 if (source->mode & PM_SOURCE_MODE_MOMENTS_FAILURE) continue; 171 // skip non-astronomical objects (very likely defects) and satstars with profiles subtracted 172 if (source->mode & PM_SOURCE_MODE_MOMENTS_FAILURE) continue; 173 if (source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE) continue; 173 174 if (source->type == PM_SOURCE_TYPE_DEFECT) continue; 174 175 if (source->type == PM_SOURCE_TYPE_SATURATED) continue; -
branches/eam_branches/ipp-20120805/psphot/src/psphotKronIterate.c
r33964 r34378 309 309 if (source->mode & PM_SOURCE_MODE_MOMENTS_FAILURE) continue; 310 310 311 // skip saturated stars modeled with a radial profile 312 if (source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE) continue; 313 311 314 // replace object in image 312 315 bool reSubtract = false; -
branches/eam_branches/ipp-20120805/psphot/src/psphotMagnitudes.c
r33089 r34378 182 182 if (saveTest) { 183 183 psphotSaveImage(NULL, testImage, "test.image.1.fits"); 184 } 185 186 // satstars modeled as a radial profile need special handling 187 if (source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE) { 188 psphotSatstarPhotometry (source); 189 continue; 184 190 } 185 191 -
branches/eam_branches/ipp-20120805/psphot/src/psphotRadialApertures.c
r34136 r34378 240 240 if (source->mode & PM_SOURCE_MODE_DEFECT) continue; 241 241 242 // skip saturated stars modeled with a radial profile 243 if (source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE) continue; 244 242 245 // XXX measure radial apertures even for saturated stars 243 246 // if (source->mode & PM_SOURCE_MODE_SATSTAR) continue; -
branches/eam_branches/ipp-20120805/psphot/src/psphotRadialProfileWings.c
r33839 r34378 190 190 if (!source->moments) continue; 191 191 192 // skip saturated stars modeled with a radial profile 193 if (source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE) continue; 194 195 // skip non-detected sources matched from other images 196 if (source->mode2 & PM_SOURCE_MODE2_MATCHED) return true; // skip matched sources (no signal) 197 198 // XXX unclear if I should run this analysis on both 1st and 2nd pass for 1st pass objects, 199 // or just use the 1st pass value. I think I should just use the 1st pass value, so skip 200 // any that have already been assigned 201 if (isfinite(source->skyRadius)) return true; 202 192 203 // replace object in image 193 204 bool reSubtract = false; … … 226 237 227 238 // psImageMaskType **vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA; 228 229 // XXX unclear if I should run this analysis on both 1st and 2nd pass for 1st pass objects,230 // or just use the 1st pass value. I think I should just use the 1st pass value, so skip231 // any that have already been assigned232 if (isfinite(source->skyRadius)) return true;233 234 if (source->mode2 & PM_SOURCE_MODE2_MATCHED) return true; // skip matched sources (no signal)235 239 236 240 // radii will be MIN_RADIUS to MAX_RADIUS in NN log steps: -
branches/eam_branches/ipp-20120805/psphot/src/psphotReadout.c
r34368 r34378 143 143 } 144 144 145 // find blended neighbors of very saturated stars (detections->newSources)145 // find and subtract radial profile models for saturated stars (XXX change name eventually) 146 146 if (!psphotDeblendSatstars (config, view, filerule)) { 147 147 psError (PSPHOT_ERR_UNKNOWN, false, "failed on satstar deblend analysis"); … … 221 221 // NOTE: this block performs the 2nd pass low-significance PSF detection stage 222 222 { 223 // add noise for subtracted objects 223 // add noise for subtracted objects & subtracted saturated stars 224 224 psphotAddNoise (config, view, filerule); // pass 1 (detections->allSources) 225 225 … … 253 253 // merge the newly selected sources into the existing list 254 254 // NOTE: merge OLD and NEW 255 // XXX check on free of sources...256 255 psphotMergeSources (config, view, filerule); // (detections->newSources + detections->allSources -> detections->allSources) 257 256 … … 294 293 // merge the newly selected sources into the existing list 295 294 // NOTE: merge OLD and NEW 296 // XXX check on free of sources...297 295 psphotMergeSources (config, view, filerule); // (detections->newSources + detections->allSources -> detections->allSources) 298 296 -
branches/eam_branches/ipp-20120805/psphot/src/psphotSourceSize.c
r34258 r34378 498 498 continue; 499 499 } 500 501 // skip saturated stars modeled with a radial profile 502 if (source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE) continue; 500 503 501 504 // we are classifying by moments and PSF_MAG - KRON_MAG -
branches/eam_branches/ipp-20120805/psphot/src/psphotSourceStats.c
r33840 r34378 447 447 } 448 448 449 // skip saturated stars modeled with a radial profile (this probably never happens, since it is set after) 450 if (source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE) continue; 451 449 452 if (!(source->peak->type == PM_PEAK_SUSPECT_SATURATION)) { 450 453 // measure basic source moments (no S/N clipping on input pixels) -
branches/eam_branches/ipp-20120805/psphot/src/psphotVisual.c
r34368 r34378 262 262 } 263 263 264 static psImage *posImage = NULL; 265 static psImage *delImage = NULL; 266 264 267 bool psphotVisualShowImage (pmReadout *readout) { 265 268 … … 277 280 psphotVisualScaleImage (kapa, readout->variance, readout->mask, "variance", 1.0, 1); 278 281 psphotVisualScaleImage (kapa, readout->image, readout->mask, "image", sqrt(factor), 0); 282 283 if (posImage == NULL) { 284 posImage = psImageCopy (NULL, readout->image, PS_TYPE_F32); 285 } 279 286 280 287 pmVisualAskUser(NULL); … … 2580 2587 } 2581 2588 2582 if ( reshow) {2589 if (false && reshow) { 2583 2590 psphotVisualShowMask (myKapa, readout->mask, "mask", 2); 2584 2591 psphotVisualScaleImage (myKapa, readout->variance, readout->mask, "variance", 1.0, 1); 2585 2592 } 2586 psphotVisualScaleImage (myKapa, readout->image, readout->mask, "resid", sqrt(factor), 0); 2593 2594 if (posImage) { 2595 delImage = (psImage *) psBinaryOp(delImage, posImage, "-", readout->image); 2596 psphotVisualScaleImage (myKapa, posImage, readout->mask, "posimage", sqrt(factor), 0); 2597 psphotVisualScaleImage (myKapa, delImage, readout->mask, "delimage", sqrt(factor), 2); 2598 } 2599 2600 psphotVisualScaleImage (myKapa, readout->image, readout->mask, "resid", sqrt(factor), 1); 2587 2601 2588 2602 pmVisualAskUser(NULL);
Note:
See TracChangeset
for help on using the changeset viewer.
