Changeset 31312
- Timestamp:
- Apr 18, 2011, 8:53:12 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110404/psModules/src/objects
- Files:
-
- 5 edited
-
pmSource.c (modified) (2 diffs)
-
pmSourceMasks.h (modified) (1 diff)
-
pmSourceMoments.c (modified) (5 diffs)
-
pmSourceOutputs.c (modified) (1 diff)
-
pmSourcePhotometry.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110404/psModules/src/objects/pmSource.c
r31153 r31312 199 199 source->type = in->type; 200 200 source->mode = in->mode; 201 source->mode2 = in->mode2; 202 source->tmpFlags = in->tmpFlags; 201 203 source->imageID = in->imageID; 204 205 source->psfMag = in->psfMag; 206 source->psfFlux = in->psfFlux; 207 source->psfFluxErr = in->psfFluxErr; 208 source->extMag = in->extMag; 209 source->errMag = in->errMag; 210 source->apMag = in->apMag; 211 source->apMagRaw = in->apMagRaw; 212 source->apRadius = in->apRadius; 213 source->apFlux = in->apFlux; 214 source->apFluxErr = in->apFluxErr; 215 source->pixWeightNotBad = in->pixWeightNotBad; 216 source->pixWeightNotPoor = in->pixWeightNotPoor; 217 source->psfChisq = in->psfChisq; 218 source->crNsigma = in->crNsigma; 219 source->extNsigma = in->extNsigma; 220 source->sky = in->sky; 221 source->skyErr = in->skyErr; 202 222 203 223 return(source); … … 486 506 // create vectors with Sx, Sy values in window 487 507 // clip sources based on S/N 488 for (psS32 i = 0 ; i < sources->n; i++)508 for (psS32 i = 0; i < sources->n; i++) 489 509 { 490 510 pmSource *tmpSrc = (pmSource *) sources->data[i]; -
branches/eam_branches/ipp-20110404/psModules/src/objects/pmSourceMasks.h
r31306 r31312 51 51 PM_SOURCE_MODE2_ON_BURNTOOL = 0x00000020, ///< > 25% of (PSF-weighted) pixels land on burntool 52 52 PM_SOURCE_MODE2_ON_CONVPOOR = 0x00000040, ///< > 25% of (PSF-weighted) pixels land on convpoor 53 54 PM_SOURCE_MODE2_PASS1_SRC = 0x00000080, ///< source detected in first pass analysis 53 55 } pmSourceMode2; 54 56 -
branches/eam_branches/ipp-20110404/psModules/src/objects/pmSourceMoments.c
r31153 r31312 109 109 // Xn = SUM (x - xc)^n * (z - sky) 110 110 111 psF32 RFW = 0.0; 112 psF32 RHW = 0.0; 113 111 114 psF32 RF = 0.0; 112 115 psF32 RH = 0.0; … … 187 190 psF32 rs = fDiff; 188 191 192 psF32 rfw = r * pDiff; 193 psF32 rhw = sqrt(r) * pDiff; 194 189 195 psF32 x = xDiff * pDiff; 190 196 psF32 y = yDiff * pDiff; … … 208 214 RH += rh; 209 215 RS += rs; 216 217 RFW += rfw; 218 RHW += rhw; 210 219 211 220 XX += xx; … … 226 235 } 227 236 228 source->moments->Mrf = RF/RS; 229 source->moments->Mrh = RH/RS; 237 // if Mrf (first radial moment) is << sigma, we are getting into low-significance 238 // territory. saturate at 0.75*sigma. conversely, if Mrf is > radius, we are clearly 239 // making an error. saturate at radius. 240 source->moments->Mrf = MIN(radius, MAX(0.75*sigma, RF/RS)); 241 source->moments->Mrh = MIN(radius, MAX(0.75*sigma, RH/RS)); 230 242 231 243 source->moments->Mxx = XX/Sum; … … 243 255 source->moments->Mxyyy = XYYY/Sum; 244 256 source->moments->Myyyy = YYYY/Sum; 257 258 // XXX TEST: 259 // source->moments->KronFinner = RFW/Sum; 260 // source->moments->KronFouter = sigma; 245 261 246 262 // Calculate the Kron magnitude (make this block optional?) -
branches/eam_branches/ipp-20110404/psModules/src/objects/pmSourceOutputs.c
r31307 r31312 98 98 outputs->xPos = PAR[PM_PAR_XPOS]; 99 99 outputs->yPos = PAR[PM_PAR_YPOS]; 100 if (source->mode & PM_SOURCE_MODE_NONLINEAR_FIT) { 100 if ((source->mode & PM_SOURCE_MODE_NONLINEAR_FIT) && !(source->mode & PM_SOURCE_MODE_EXTMODEL)) { 101 // we only do non-linear PSF fits for non-extended objects 101 102 outputs->xErr = dPAR[PM_PAR_XPOS]; 102 103 outputs->yErr = dPAR[PM_PAR_YPOS]; -
branches/eam_branches/ipp-20110404/psModules/src/objects/pmSourcePhotometry.c
r31153 r31312 310 310 bool status; 311 311 status = pmSourcePhotometryAper(&source->apMagRaw, &source->apFlux, &source->apFluxErr, model, image, variance, mask, maskVal); 312 if (status) { 313 source->mode |= PM_SOURCE_MODE_AP_MAGS; 314 } 312 315 313 316 return status; … … 413 416 maskBad &= ~maskSuspect; 414 417 418 psImageMaskType maskPoor = maskVal | maskSuspect; 419 415 420 // measure modelSum and validSum. this function is applied to a sources' subimage. the 416 421 // value of DX is chosen (see above) to cover the full possible size of the subimage if it … … 446 451 447 452 // count pixels which are masked with an mask bit (bad or poor) 448 if (!(mask->data.PS_TYPE_IMAGE_MASK_DATA[my][mx] & mask Val)) {453 if (!(mask->data.PS_TYPE_IMAGE_MASK_DATA[my][mx] & maskPoor)) { 449 454 notPoorSum += value; 450 455 } … … 487 492 488 493 if (isfinite(source->pixWeightNotBad) && isfinite(source->pixWeightNotPoor)) { 489 psAssert (source->pixWeightNot Bad <= source->pixWeightNotPoor, "error: all bad pixels should also be poor");494 psAssert (source->pixWeightNotPoor <= source->pixWeightNotBad, "error: all bad pixels should also be poor"); 490 495 } 491 496
Note:
See TracChangeset
for help on using the changeset viewer.
