Changeset 25755 for trunk/psphot/src/psphotExtendedSourceAnalysis.c
- Timestamp:
- Oct 2, 2009, 3:12:47 PM (17 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
psphotExtendedSourceAnalysis.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src
- Property svn:ignore
-
old new 18 18 psphotVersionDefinitions.h 19 19 psphotMomentsStudy 20 psphotPetrosianStudy
-
- Property svn:ignore
-
trunk/psphot/src/psphotExtendedSourceAnalysis.c
r21519 r25755 21 21 } 22 22 23 // option to limit analysis to a specific region 24 char *region = psMetadataLookupStr (&status, recipe, "ANALYSIS_REGION"); 25 psRegion AnalysisRegion = psRegionForImage (readout->image, psRegionFromString (region)); 26 if (psRegionIsNaN (AnalysisRegion)) psAbort("analysis region mis-defined"); 23 // XXX require petrosian analysis for non-linear fits? 24 25 // XXX temporary user-supplied systematic sky noise measurement (derive from background model) 26 float skynoise = psMetadataLookupF32 (&status, recipe, "SKY.NOISE"); 27 28 # if (0) 29 // if backModel or backStdev are missing, the values of sky and/or skyErr will be set to NAN 30 // XXX use this to set skynoise 31 pmReadout *backModel = psphotSelectBackground (config, view); 32 pmReadout *backStdev = psphotSelectBackgroundStdev (config, view); 33 # endif 27 34 28 35 // S/N limit to perform full non-linear fits … … 38 45 sources = psArraySort (sources, pmSourceSortBySN); 39 46 40 // XXX some init functions for the extended source recipe options? 47 // option to limit analysis to a specific region 48 char *region = psMetadataLookupStr (&status, recipe, "ANALYSIS_REGION"); 49 psRegion AnalysisRegion = psRegionForImage (readout->image, psRegionFromString (region)); 50 if (psRegionIsNaN (AnalysisRegion)) psAbort("analysis region mis-defined"); 41 51 42 52 // choose the sources of interest … … 49 59 if (source->type == PM_SOURCE_TYPE_DEFECT) continue; 50 60 if (source->type == PM_SOURCE_TYPE_SATURATED) continue; 61 if (source->mode & PM_SOURCE_MODE_DEFECT) continue; 62 if (source->mode & PM_SOURCE_MODE_SATSTAR) continue; 63 if (!(source->mode & PM_SOURCE_MODE_EXT_LIMIT)) continue; 51 64 52 65 // limit selection to some SN limit … … 68 81 // if we request any of these measurements, we require the radial profile 69 82 if (doPetrosian || doIsophotal || doAnnuli || doKron) { 70 if (!psphotRadialProfile (source, recipe, maskVal)) {83 if (!psphotRadialProfile (source, recipe, skynoise, maskVal)) { 71 84 // all measurements below require the radial profile; skip them all 72 85 // re-subtract the object, leave local sky 73 86 psTrace ("psphot", 5, "failed to extract radial profile for source at %7.1f, %7.1f", source->moments->Mx, source->moments->My); 74 87 pmSourceSub (source, PM_MODEL_OP_FULL, maskVal); 75 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED;76 88 continue; 77 89 } … … 79 91 } 80 92 93 // Petrosian Mags 94 if (doPetrosian) { 95 if (!psphotPetrosian (source, recipe, skynoise, maskVal)) { 96 psTrace ("psphot", 5, "measured petrosian flux & radius for source at %7.1f, %7.1f", source->moments->Mx, source->moments->My); 97 } else { 98 psTrace ("psphot", 5, "measured petrosian flux & radius for source at %7.1f, %7.1f", source->moments->Mx, source->moments->My); 99 Npetro ++; 100 source->mode |= PM_SOURCE_MODE_EXTENDED_STATS; 101 } 102 } 103 104 # if (0) 81 105 // Isophotal Mags 82 106 if (doIsophotal) { … … 89 113 } 90 114 } 91 92 // Petrosian Mags93 if (doPetrosian) {94 if (!psphotPetrosian (source, recipe, maskVal)) {95 psTrace ("psphot", 5, "measured petrosian flux & radius for source at %7.1f, %7.1f", source->moments->Mx, source->moments->My);96 } else {97 psTrace ("psphot", 5, "measured petrosian flux & radius for source at %7.1f, %7.1f", source->moments->Mx, source->moments->My);98 Npetro ++;99 source->mode |= PM_SOURCE_MODE_EXTENDED_STATS;100 }101 }102 103 115 // Kron Mags 104 116 if (doKron) { … … 111 123 } 112 124 } 113 114 // Radial Annuli 115 if (doAnnuli) { 116 if (!psphotAnnuli (source, recipe, maskVal)) { 117 psError(PSPHOT_ERR_UNKNOWN, false, "failure in Annuli analysis"); 118 return false; 119 } 120 psTrace ("psphot", 5, "measured annuli for source at %7.1f, %7.1f", source->moments->Mx, source->moments->My); 121 Nannuli ++; 122 source->mode |= PM_SOURCE_MODE_EXTENDED_STATS; 123 } 125 # endif 124 126 125 127 // re-subtract the object, leave local sky 126 128 pmSourceSub (source, PM_MODEL_OP_FULL, maskVal); 127 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 129 130 if (source->extpars) { 131 pmSourceRadialProfileFreeVectors(source->extpars->profile); 132 } 128 133 } 129 134 … … 133 138 psLogMsg ("psphot", PS_LOG_INFO, " %d annuli\n", Nannuli); 134 139 psLogMsg ("psphot", PS_LOG_INFO, " %d kron\n", Nkron); 140 141 psphotVisualShowResidualImage (readout); 142 143 if (doPetrosian) { 144 psphotVisualShowPetrosians (sources); 145 } 146 135 147 return true; 136 148 }
Note:
See TracChangeset
for help on using the changeset viewer.
