- Timestamp:
- Feb 14, 2011, 1:05:28 PM (15 years ago)
- Location:
- branches/czw_branch/20101203
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20101203
- Property svn:mergeinfo changed
-
branches/czw_branch/20101203/psphot
- Property svn:mergeinfo changed
-
branches/czw_branch/20101203/psphot/src/psphotExtendedSourceFits.c
r30118 r30631 18 18 int num = psphotFileruleCount(config, filerule); 19 19 20 // skip the chisq image (optionally?) 21 int chisqNum = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.CHISQ.NUM"); 22 if (!status) chisqNum = -1; 23 20 24 // loop over the available readouts 21 25 for (int i = 0; i < num; i++) { 26 if (i == chisqNum) continue; // skip chisq image 22 27 if (!psphotExtendedSourceFitsReadout (config, view, filerule, i, recipe)) { 23 28 psError (PSPHOT_ERR_CONFIG, false, "failed on to fit extended sources for %s entry %d", filerule, i); … … 37 42 int Nplain = 0; 38 43 int NplainPass = 0; 44 int Nfaint = 0; 39 45 40 46 psTimerStart ("psphot.extended"); … … 46 52 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); 47 53 psAssert (readout, "missing readout?"); 54 55 psLogMsg("psphot", PS_LOG_INFO, "extended source fits for image %d", index); 56 psphotVisualShowImage(readout); 48 57 49 58 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); … … 167 176 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Nplain 168 177 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for NplainPass 178 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Nfain 169 179 170 180 if (false && !psThreadJobAddPending(job)) { … … 189 199 scalar = job->args->data[11]; 190 200 NplainPass += scalar->data.S32; 201 scalar = job->args->data[12]; 202 Nfaint += scalar->data.S32; 191 203 psFree(job); 192 204 } … … 217 229 scalar = job->args->data[11]; 218 230 NplainPass += scalar->data.S32; 231 scalar = job->args->data[12]; 232 Nfaint += scalar->data.S32; 219 233 } 220 234 psFree(job); … … 227 241 psLogMsg ("psphot", PS_LOG_INFO, " %d convolved models (%d passed)\n", Nconvolve, NconvolvePass); 228 242 psLogMsg ("psphot", PS_LOG_INFO, " %d plain models (%d passed)\n", Nplain, NplainPass); 243 psLogMsg ("psphot", PS_LOG_INFO, " %d too faint to fit\n", Nfaint); 229 244 return true; 230 245 } … … 238 253 int NconvolvePass = 0; 239 254 int Nplain = 0; 255 int Nfaint = 0; 240 256 int NplainPass = 0; 241 257 bool savePics = false; … … 326 342 327 343 // array to store the pointers to the model flux images while the models are being fitted 328 psArray *modelFluxes = psArrayAllocEmpty ( 4);344 psArray *modelFluxes = psArrayAllocEmpty (models->list->n); 329 345 330 346 // allocate the array to store the model fits 331 347 if (source->modelFits == NULL) { 332 source->modelFits = psArrayAllocEmpty ( 4);348 source->modelFits = psArrayAllocEmpty (models->list->n); 333 349 } 334 350 … … 350 366 // limit selection to some SN limit 351 367 assert (source->peak); // how can a source not have a peak? 352 if (source->peak->SN < SNlim) continue; 368 if (source->peak->SN < SNlim) { 369 Nfaint ++; 370 continue; 371 } 353 372 354 373 // check on the model type … … 497 516 scalar->data.S32 = NplainPass; 498 517 518 scalar = job->args->data[12]; 519 scalar->data.S32 = Nfaint; 520 499 521 return true; 500 522 }
Note:
See TracChangeset
for help on using the changeset viewer.
