Changeset 31670
- Timestamp:
- Jun 22, 2011, 12:48:29 AM (15 years ago)
- Location:
- trunk/psModules/src/objects
- Files:
-
- 12 edited
- 2 copied
-
Makefile.am (modified) (1 diff)
-
mksource.pl (copied) (copied from branches/eam_branches/ipp-20110505/psModules/src/objects/mksource.pl )
-
models/pmModel_PS1_V1.c (modified) (1 diff)
-
models/pmModel_QGAUSS.c (modified) (2 diffs)
-
pmSource.c (modified) (2 diffs)
-
pmSource.h (modified) (1 diff)
-
pmSourceIO.c (modified) (1 diff)
-
pmSourceIO_CMF.c.in (copied) (copied from branches/eam_branches/ipp-20110505/psModules/src/objects/pmSourceIO_CMF.c.in )
-
pmSourceIO_CMF_PS1_V2.c (modified) (1 diff)
-
pmSourceIO_CMF_PS1_V3.c (modified) (1 diff)
-
pmSourceMasks.h (modified) (1 diff)
-
pmSourceMoments.c (modified) (1 diff)
-
pmSourcePhotometry.c (modified) (3 diffs)
-
pmSourcePhotometry.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/Makefile.am
r31451 r31670 128 128 129 129 CLEANFILES = *~ 130 131 # pmSourceID_CMF_* functions use a common framework 132 BUILT_SOURCES = pmSourceIO_CMF_PS1_V1.v1.c pmSourceIO_CMF_PS1_V2.v1.c pmSourceIO_CMF_PS1_V3.v1.c 133 134 pmSourceIO_CMF_PS1_V1.v1.c : pmSourceIO_CMF.c.in mksource.pl 135 mksource.pl pmSourceIO_CMF.c.in PS1_V1 pmSourceIO_CMF_PS1_V1.v1.c 136 137 pmSourceIO_CMF_PS1_V2.v1.c : pmSourceIO_CMF.c.in mksource.pl 138 mksource.pl pmSourceIO_CMF.c.in PS1_V2 pmSourceIO_CMF_PS1_V2.v1.c 139 140 pmSourceIO_CMF_PS1_V3.v1.c : pmSourceIO_CMF.c.in mksource.pl 141 mksource.pl pmSourceIO_CMF.c.in PS1_V2 pmSourceIO_CMF_PS1_V3.v1.c 142 143 # EXTRA_DIST = pmErrorCodes.h.in pmErrorCodes.dat pmErrorCodes.c.in -
trunk/psModules/src/objects/models/pmModel_PS1_V1.c
r31538 r31670 296 296 psF64 sigma = axes.major; 297 297 298 // we can solve directly if PAR_7 goes to 0.0 298 299 if (PAR[PM_PAR_7] == 0.0) { 299 300 psF32 z = powf(PAR[PM_PAR_I0] / flux - 1.0, 1.0 / ALPHA); 300 301 return ( sigma * sqrt (2.0 * z) ); 301 302 } 302 303 303 psF64 limit = flux / PAR[PM_PAR_I0]; 304 304 -
trunk/psModules/src/objects/models/pmModel_QGAUSS.c
r31451 r31670 289 289 if (PAR[PM_PAR_I0] <= 0) return 1.0; 290 290 if (flux >= PAR[PM_PAR_I0]) return 1.0; 291 if (PAR[PM_PAR_7] == 0.0) return powf(PAR[PM_PAR_I0] / flux - 1.0, 1.0 / ALPHA); 291 292 // if (PAR[PM_PAR_7] == 0.0) return powf(PAR[PM_PAR_I0] / flux - 1.0, 1.0 / ALPHA); 292 293 293 294 shape.sx = PAR[PM_PAR_SXX] / M_SQRT2; … … 297 298 psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0); 298 299 psF64 sigma = axes.major; 300 301 // we can solve directly if PAR_7 goes to 0.0 302 if (PAR[PM_PAR_7] == 0.0) { 303 psF32 z = powf(PAR[PM_PAR_I0] / flux - 1.0, 1.0 / ALPHA); 304 return ( sigma * sqrt (2.0 * z) ); 305 } 299 306 300 307 psF64 limit = flux / PAR[PM_PAR_I0]; -
trunk/psModules/src/objects/pmSource.c
r31451 r31670 362 362 *****************************************************************************/ 363 363 364 pmPSFClump pmSourcePSFClump(psImage **savedImage, psRegion *region, psArray *sources, float PSF_SN_LIM, float PSF_CLUMP_GRID_SCALE, psF32 SX_MAX, psF32 SY_MAX, psF32 AR_MAX)364 pmPSFClump pmSourcePSFClump(psImage **savedImage, psRegion *region, psArray *sources, float PSF_SN_LIM, float PSF_CLUMP_GRID_SCALE, psF32 SX_MAX, psF32 SY_MAX, psF32 SX_MIN, psF32 SY_MIN, psF32 AR_MAX) 365 365 { 366 366 psTrace("psModules.objects", 10, "---- begin ----\n"); … … 422 422 423 423 // Sx,Sy are limited at 0. a peak at 0,0 is artificial 424 if (fabs(Mxx) < 0.05 || fabs(Myy < 0.05)) {424 if (fabs(Mxx) < SX_MIN || fabs(Myy < SY_MIN)) { 425 425 psTrace("psModules.objects", 10, 426 426 "Rejecting source from clump because of low moments (%f,%f)\n", -
trunk/psModules/src/objects/pmSource.h
r31451 r31670 219 219 psF32 SX_MAX, 220 220 psF32 SY_MAX, 221 psF32 SX_MIN, 222 psF32 SY_MIN, 221 223 psF32 AR_MAX 222 224 ); -
trunk/psModules/src/objects/pmSourceIO.c
r30621 r31670 727 727 728 728 psMetadata *fileData = psMetadataLookupMetadata(NULL, file->format, "FILE"); // File information 729 const char *fpaNameHdr = psMetadataLookupStr( NULL, fileData, "FPA.OBS");729 const char *fpaNameHdr = psMetadataLookupStr(&status, fileData, "FPA.OBS"); 730 730 if (fpaNameHdr && strlen(fpaNameHdr) > 0) { 731 const char *fpaName = psMetadataLookupStr(NULL, fpa->concepts, "FPA.OBS"); 732 psMetadataAddStr(outhead, PS_LIST_TAIL, fpaNameHdr, PS_META_REPLACE, 733 "FPA observation identifier", fpaName); 731 const char *fpaName = psMetadataLookupStr(&status, fpa->concepts, "FPA.OBS"); 732 if (fpaName) { 733 psMetadataAddStr(outhead, PS_LIST_TAIL, fpaNameHdr, PS_META_REPLACE, "FPA observation identifier", fpaName); 734 } 734 735 } 735 736 -
trunk/psModules/src/objects/pmSourceIO_CMF_PS1_V2.c
r31451 r31670 113 113 psMetadataAdd (row, PS_LIST_TAIL, "X_PSF_SIG", PS_DATA_F32, "Sigma in PSF x coordinate", outputs.xErr); // XXX this is only measured for non-linear fits 114 114 psMetadataAdd (row, PS_LIST_TAIL, "Y_PSF_SIG", PS_DATA_F32, "Sigma in PSF y coordinate", outputs.yErr); // XXX this is only measured for non-linear fits 115 115 116 psMetadataAdd (row, PS_LIST_TAIL, "POSANGLE", PS_DATA_F32, "position angle at source (degrees)", outputs.posAngle); 116 117 psMetadataAdd (row, PS_LIST_TAIL, "PLTSCALE", PS_DATA_F32, "plate scale at source (arcsec/pixel)", outputs.pltScale); -
trunk/psModules/src/objects/pmSourceIO_CMF_PS1_V3.c
r31451 r31670 270 270 source->skyErr = dPAR[PM_PAR_SKY]; 271 271 272 // XXX use these to determine PAR[PM_PAR_I0]?273 272 source->psfMag = psMetadataLookupF32 (&status, row, "PSF_INST_MAG"); 274 source->psfMagErr = psMetadataLookupF32 (&status, row, "PSF_INST_MAG_SIG");273 source->psfMagErr = psMetadataLookupF32 (&status, row, "PSF_INST_MAG_SIG"); 275 274 source->apMag = psMetadataLookupF32 (&status, row, "AP_MAG"); 275 source->apMagRaw = psMetadataLookupF32 (&status, row, "AP_MAG_RAW"); 276 277 // XXX use these to determine PAR[PM_PAR_I0] if they exist? 278 source->psfFlux = psMetadataLookupF32 (&status, row, "PSF_INST_FLUX"); 279 source->psfFluxErr = psMetadataLookupF32 (&status, row, "PSF_INST_FLUX_SIG"); 276 280 277 281 // XXX this scaling is incorrect: does not include the 2 \pi AREA factor -
trunk/psModules/src/objects/pmSourceMasks.h
r31451 r31670 53 53 54 54 PM_SOURCE_MODE2_PASS1_SRC = 0x00000080, ///< source detected in first pass analysis 55 56 PM_SOURCE_MODE2_HAS_BRIGHTER_NEIGHBOR = 0x00000100, ///< peak is not the brightest in its footprint 57 PM_SOURCE_MODE2_BRIGHT_NEIGHBOR_1 = 0x00000200, ///< flux_n / (r^2 flux_p) > 1 58 PM_SOURCE_MODE2_BRIGHT_NEIGHBOR_10 = 0x00000400, ///< flux_n / (r^2 flux_p) > 10 55 59 } pmSourceMode2; 56 60 -
trunk/psModules/src/objects/pmSourceMoments.c
r31451 r31670 264 264 265 265 // if Mrf (first radial moment) is very small, we are getting into low-significance 266 // territory. saturate at minKronRadius. conversely, if Mrf is > radius, we are clearly 267 // making an error. saturate at radius. 268 float kronRefRadius = MIN(radius, MAX(minKronRadius, source->moments->Mrf)); 266 // territory. saturate at minKronRadius. conversely, if Mrf is >> radius for faint 267 // sources, we are clearly making an error. saturate at radius. 268 float kronRefRadius = MAX(minKronRadius, source->moments->Mrf); 269 if (source->moments->SN < 10) { 270 kronRefRadius = MIN(radius, kronRefRadius); 271 } 269 272 270 273 float radKinner = 1.0*kronRefRadius; -
trunk/psModules/src/objects/pmSourcePhotometry.c
r31451 r31670 134 134 // measure PSF model photometry 135 135 status = pmSourcePhotometryModel (&source->psfMag, &source->psfFlux, modelPSF); 136 source->psfFluxErr = source->psfFlux * source->psfMagErr;136 source->psfFluxErr = fabs(source->psfFlux * source->psfMagErr); 137 137 138 138 # if (0) … … 191 191 } 192 192 193 pmSourceNeighborFlags (source); 194 193 195 // measure the aperture magnitude, if (SN > AP_MIN_SN) 194 196 if (!isfinite(SN)) { … … 264 266 265 267 */ 268 269 bool pmSourceNeighborFlags (pmSource *source) { 270 271 return false; 272 273 // source must have a peak to have a footprint 274 if (!source) return false; 275 if (!source->peak) return false; 276 if (!source->peak->footprint) return false; 277 if (!source->peak->footprint->peaks) return false; 278 if (!source->peak->footprint->peaks->n) return false; 279 280 // find the brightest peak (first peak) 281 pmPeak *brightPeak = source->peak->footprint->peaks->data[0]; 282 283 // are we the brightest peak? 284 if (source->peak == brightPeak) return true; 285 286 // if not, raise a flag: 287 source->mode2 |= PM_SOURCE_MODE2_HAS_BRIGHTER_NEIGHBOR; 288 289 // but, this is a common situation. more interesting is if the ratio flux_n / (r^2 flux_o) is large 290 291 float radius2 = PS_SQR(source->peak->xf - brightPeak->xf) + PS_SQR(source->peak->yf - brightPeak->yf); 292 293 float ratio = brightPeak->rawFlux / (source->peak->rawFlux * radius2); 294 295 if (ratio > 1) { 296 source->mode2 |= PM_SOURCE_MODE2_BRIGHT_NEIGHBOR_1; 297 } 298 299 if (ratio > 10) { 300 source->mode2 |= PM_SOURCE_MODE2_BRIGHT_NEIGHBOR_10; 301 } 302 303 return true; 304 } 266 305 267 306 // return source model magnitude -
trunk/psModules/src/objects/pmSourcePhotometry.h
r31451 r31670 79 79 double pmSourceModelWeight(const pmSource *Mi, int term, const bool unweighted_sum, const float covarFactor, psImageMaskType maskVal); 80 80 81 bool pmSourceNeighborFlags (pmSource *source); 82 81 83 // retire these: 82 84 // double pmSourceCrossProduct(const pmSource *Mi, const pmSource *Mj, const bool unweighted_sum);
Note:
See TracChangeset
for help on using the changeset viewer.
