Changeset 27819 for trunk/psphot/src/psphotExtendedSourceAnalysis.c
- Timestamp:
- May 2, 2010, 11:32:52 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotExtendedSourceAnalysis.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotExtendedSourceAnalysis.c
r26894 r27819 39 39 int Nkron = 0; 40 40 41 psTimerStart ("psphot.extended"); 42 41 43 // find the currently selected readout 42 44 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest … … 66 68 float skynoise = psMetadataLookupF32 (&status, recipe, "SKY.NOISE"); 67 69 68 # if (0)69 // if backModel or backStdev are missing, the values of sky and/or skyErr will be set to NAN70 // XXX use this to set skynoise71 pmReadout *backModel = psphotSelectBackground (config, view);72 pmReadout *backStdev = psphotSelectBackgroundStdev (config, view);73 # endif74 75 70 // S/N limit to perform full non-linear fits 76 71 float SN_LIM = psMetadataLookupF32 (&status, recipe, "EXTENDED_SOURCE_SN_LIM"); … … 81 76 bool doAnnuli = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_ANNULI"); 82 77 bool doKron = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_KRON"); 78 79 # if (0) 80 // if backModel or backStdev are missing, the values of sky and/or skyErr will be set to NAN 81 // XXX use this to set skynoise 82 pmReadout *backModel = psphotSelectBackground (config, view); 83 pmReadout *backStdev = psphotSelectBackgroundStdev (config, view); 84 # endif 83 85 84 86 // source analysis is done in S/N order (brightest first) … … 119 121 Next ++; 120 122 123 // force source image to be a bit larger... 124 float radius = source->peak->xf - source->pixels->col0; 125 radius = PS_MAX (radius, source->peak->yf - source->pixels->row0); 126 radius = PS_MAX (radius, source->pixels->numRows - source->peak->yf + source->pixels->row0); 127 radius = PS_MAX (radius, source->pixels->numCols - source->peak->xf + source->pixels->col0); 128 pmSourceRedefinePixels (source, readout, source->peak->xf, source->peak->yf, 1.5*radius); 129 121 130 // if we request any of these measurements, we require the radial profile 122 131 if (doPetrosian || doIsophotal || doAnnuli || doKron) { … … 134 143 if (doPetrosian) { 135 144 if (!psphotPetrosian (source, recipe, skynoise, maskVal)) { 136 psTrace ("psphot", 5, " measuredpetrosian flux & radius for source at %7.1f, %7.1f", source->moments->Mx, source->moments->My);145 psTrace ("psphot", 5, "FAILED petrosian flux & radius for source at %7.1f, %7.1f", source->moments->Mx, source->moments->My); 137 146 } else { 138 147 psTrace ("psphot", 5, "measured petrosian flux & radius for source at %7.1f, %7.1f", source->moments->Mx, source->moments->My); … … 169 178 170 179 if (source->extpars) { 171 pmSourceRadialProfileFreeVectors(source->extpars->profile); 180 psFree(source->extpars->radFlux); 181 psFree(source->extpars->ellipticalFlux); 172 182 } 173 183 } 174 184 175 psLogMsg ("psphot", PS_LOG_INFO, "extended source analysis: %f sec for %d objects\n", psTimerMark ("psphot "), Next);185 psLogMsg ("psphot", PS_LOG_INFO, "extended source analysis: %f sec for %d objects\n", psTimerMark ("psphot.extended"), Next); 176 186 psLogMsg ("psphot", PS_LOG_INFO, " %d petrosian\n", Npetro); 177 187 psLogMsg ("psphot", PS_LOG_INFO, " %d isophotal\n", Nisophot);
Note:
See TracChangeset
for help on using the changeset viewer.
