- Timestamp:
- Oct 9, 2013, 4:14:19 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130904/psphot
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130904/psphot
- Property svn:mergeinfo changed
/trunk/psphot (added) merged: 36096,36100,36107-36108,36115,36117-36119,36124,36128
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20130904/psphot/src
- Property svn:mergeinfo changed
/trunk/psphot/src merged: 36096,36100,36107-36108,36115,36117-36119,36124,36128
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20130904/psphot/src/psphotExtendedSourceAnalysis.c
r34404 r36198 1 1 # include "psphotInternal.h" 2 void psphotRadialProfileShowSkips (); 2 3 3 4 // measure the elliptical radial profile and use this to measure the petrosian parameters for the sources … … 33 34 } 34 35 36 /*** for the moment, this test code : it is not thread safe ***/ 37 int Nall = 0; 38 int Nskip1 = 0; 39 int Nskip2 = 0; 40 int Nskip3 = 0; 41 int Nskip4 = 0; 42 int Nskip5 = 0; 43 int Nskip6 = 0; 44 int Nskip7 = 0; 45 int Nskip8 = 0; 46 int Nskip9 = 0; 47 int Nskip10 = 0; 48 int Nskip11 = 0; 49 int Nskip12 = 0; 50 int Nskip13 = 0; 51 int Nskip14 = 0; 52 53 # define SKIP(VALUE) { VALUE++; continue; } 54 35 55 // aperture-like measurements for extended sources 36 56 bool psphotExtendedSourceAnalysisReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index, psMetadata *recipe) { 37 57 38 58 bool status; 59 int NfaintEXT = 0; 60 int NfaintPSF = 0; 61 39 62 int Next = 0; 40 63 int Npetro = 0; … … 108 131 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Npetro 109 132 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Nannuli 133 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for NfaintEXT 134 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for NfaintPSF 110 135 111 136 // set this to 0 to run without threading 112 # if ( 1)137 # if (0) 113 138 if (!psThreadJobAddPending(job)) { 114 139 psError(PS_ERR_UNKNOWN, false, "Unable to guess model."); … … 129 154 scalar = job->args->data[7]; 130 155 Nannuli += scalar->data.S32; 156 scalar = job->args->data[8]; 157 NfaintEXT += scalar->data.S32; 158 scalar = job->args->data[9]; 159 NfaintPSF += scalar->data.S32; 131 160 psFree(job); 132 161 # endif … … 153 182 scalar = job->args->data[7]; 154 183 Nannuli += scalar->data.S32; 184 scalar = job->args->data[8]; 185 NfaintEXT += scalar->data.S32; 186 scalar = job->args->data[9]; 187 NfaintPSF += scalar->data.S32; 155 188 } 156 189 psFree(job); … … 163 196 psLogMsg ("psphot", PS_LOG_INFO, " %d petrosian\n", Npetro); 164 197 psLogMsg ("psphot", PS_LOG_INFO, " %d annuli\n", Nannuli); 198 psLogMsg ("psphot", PS_LOG_INFO, " skipped: %d EXT, %d PSF\n", NfaintEXT, NfaintPSF); 199 200 fprintf (stderr, "ext analysis skipped @ 1 : %d\n", Nskip1); 201 fprintf (stderr, "ext analysis skipped @ 2 : %d\n", Nskip2); 202 fprintf (stderr, "ext analysis skipped @ 3 : %d\n", Nskip3); 203 fprintf (stderr, "ext analysis skipped @ 4 : %d\n", Nskip4); 204 fprintf (stderr, "ext analysis skipped @ 5 : %d\n", Nskip5); 205 fprintf (stderr, "ext analysis skipped @ 6 : %d\n", Nskip6); 206 fprintf (stderr, "ext analysis skipped @ 7 : %d\n", Nskip7); 207 fprintf (stderr, "ext analysis skipped @ 8 : %d\n", Nskip8); 208 fprintf (stderr, "ext analysis skipped @ 9 : %d\n", Nskip9); 209 fprintf (stderr, "ext analysis skipped @ 10 : %d\n", Nskip10); 210 fprintf (stderr, "ext analysis skipped @ 11 : %d\n", Nskip11); 211 fprintf (stderr, "ext analysis skipped @ 12 : %d\n", Nskip12); 212 fprintf (stderr, "ext analysis skipped @ 13 : %d\n", Nskip13); 213 fprintf (stderr, "ext analysis skipped @ 14 : %d\n", Nskip14); 214 215 psphotRadialProfileShowSkips (); 165 216 166 217 psphotVisualShowResidualImage (readout, false); … … 177 228 178 229 bool status; 230 231 int NfaintEXT = 0; 232 int NfaintPSF = 0; 179 233 180 234 int Next = 0; … … 207 261 pmSource *source = sources->data[i]; 208 262 263 Nall ++; 264 209 265 // if we have checked the source validity on the basis of the object set, then 210 266 // we either skip these tests below or we skip the source completely 211 if (source->tmpFlags & PM_SOURCE_TMPF_PETRO_SKIP) continue;267 if (source->tmpFlags & PM_SOURCE_TMPF_PETRO_SKIP) SKIP (Nskip1); 212 268 if (source->tmpFlags & PM_SOURCE_TMPF_PETRO_KEEP) goto keepSource; 213 269 214 270 // skip PSF-like and non-astronomical objects 215 if (source->type == PM_SOURCE_TYPE_DEFECT) continue;216 if (source->type == PM_SOURCE_TYPE_SATURATED) continue;217 if (source->mode & PM_SOURCE_MODE_DEFECT) continue;218 if (source->mode & PM_SOURCE_MODE_SATSTAR) continue;271 if (source->type == PM_SOURCE_TYPE_DEFECT) SKIP (Nskip2); 272 if (source->type == PM_SOURCE_TYPE_SATURATED) SKIP (Nskip3); 273 if (source->mode & PM_SOURCE_MODE_DEFECT) SKIP (Nskip4); 274 if (source->mode & PM_SOURCE_MODE_SATSTAR) SKIP (Nskip5); 219 275 220 276 // skip saturated stars modeled with a radial profile 221 if (source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE) continue;277 if (source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE) SKIP (Nskip6); 222 278 223 279 // optionally allow non-extended objects to get petrosians as well 224 280 if (!doPetroStars) { 225 if (!(source->mode & PM_SOURCE_MODE_EXT_LIMIT)) continue;226 if (source->type == PM_SOURCE_TYPE_STAR) continue;281 if (!(source->mode & PM_SOURCE_MODE_EXT_LIMIT)) SKIP (Nskip7); 282 // if (source->type == PM_SOURCE_TYPE_STAR) SKIP (Nskip8); -- XXX this might be set for input lists (instead of EXT_LIMIT) 227 283 } 228 284 … … 233 289 if (source->mode & PM_SOURCE_MODE_EXT_LIMIT) { 234 290 skipSource = (source->moments->KronFlux < SN_LIM * source->moments->KronFluxErr); 291 NfaintEXT ++; 235 292 } else { 236 293 skipSource = (sqrt(source->peak->detValue) < SN_LIM); 237 } 238 if (skipSource) continue; 294 NfaintPSF ++; 295 } 296 if (skipSource) SKIP (Nskip9); 239 297 240 298 // limit selection by analysis region (this automatically apply 241 if (source->peak->x < region->x0) continue;242 if (source->peak->y < region->y0) continue;243 if (source->peak->x > region->x1) continue;244 if (source->peak->y > region->y1) continue;299 if (source->peak->x < region->x0) SKIP (Nskip10); 300 if (source->peak->y < region->y0) SKIP (Nskip11); 301 if (source->peak->x > region->x1) SKIP (Nskip12); 302 if (source->peak->y > region->y1) SKIP (Nskip13); 245 303 246 304 keepSource: … … 266 324 psTrace ("psphot", 5, "failed to extract radial profile for source at %7.1f, %7.1f", source->moments->Mx, source->moments->My); 267 325 pmSourceSub (source, PM_MODEL_OP_FULL, maskVal); 268 continue;326 SKIP (Nskip14); 269 327 } 270 328 Nannuli ++; … … 304 362 scalar->data.S32 = Nannuli; 305 363 364 scalar = job->args->data[8]; 365 scalar->data.S32 = NfaintEXT; 366 367 scalar = job->args->data[9]; 368 scalar->data.S32 = NfaintPSF; 369 306 370 return true; 307 371 }
Note:
See TracChangeset
for help on using the changeset viewer.
