IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10201


Ignore:
Timestamp:
Nov 26, 2006, 12:35:10 PM (20 years ago)
Author:
eugene
Message:

added psphotReplaceAll; only replace failed sources

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotReplaceUnfit.c

    r9576 r10201  
    1010      source = sources->data[i];
    1111
    12         if (!(source->mode & PM_SOURCE_MODE_TEMPSUB)) continue;
     12      // replace other sources?
     13      if (source->mode & PM_SOURCE_MODE_FAIL) goto replace;
     14      continue;
     15
     16    replace:
    1317        if (source->modelPSF == NULL) continue;
    1418
     
    2327    return true;
    2428}
     29
     30bool psphotReplaceAll (psArray *sources) {
     31
     32    pmSource *source;
     33
     34    psTimerStart ("psphot");
     35
     36    for (int i = 0; i < sources->n; i++) {
     37      source = sources->data[i];
     38
     39      // replace other sources?
     40      if (!(source->mode & PM_SOURCE_MODE_SUBTRACTED)) continue;
     41
     42      // select appropriate model
     43      pmModel *model = pmSourceGetModel (NULL, source);
     44      if (model == NULL) continue;  // model must be defined
     45       
     46      psTrace ("psphot", 3, "replacing object at %f,%f\n",
     47               model->params->data.F32[2], model->params->data.F32[3]);
     48
     49      pmModelAdd (source->pixels, source->mask, model, false, false);
     50      source->mode &= ~PM_SOURCE_MODE_SUBTRACTED;
     51    }
     52    psLogMsg ("psphot.replace", 3, "replace models: %f sec (%ld objects)\n", psTimerMark ("psphot"), sources->n);
     53    return true;
     54}
Note: See TracChangeset for help on using the changeset viewer.