IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36586


Ignore:
Timestamp:
Mar 14, 2014, 1:57:09 PM (12 years ago)
Author:
bills
Message:

Choose model type to include in cff file by recipe. Default is "BEST"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20140114/psModules/src/objects/pmSourceIO_CFF.c

    r36441 r36586  
    246246    pmModelType sersicModelType = pmModelClassGetType("PS_MODEL_SERSIC");
    247247
     248    psString modelToChoose = psMetadataLookupStr(&mdok, recipe, "EXT_MODEL_TYPE_FOR_CFF");
     249    pmModelType selectedModelType = -1;
     250    if (mdok && modelToChoose != NULL) {
     251        if (strcmp(modelToChoose, "BEST")) {
     252            selectedModelType = pmModelClassGetType(modelToChoose);
     253        }
     254    }
     255
    248256    for (int i = 0; i < sources->n; i++) {
    249257        pmSource *thisSource = sources->data[i];
     
    272280            theta = 0;
    273281        } else {
    274             // Choose the extended model to use for this source.
    275             // For now we use the one set as the modelEXT for this source which had the best fit.
    276             // XXX: make this controllable by recipe
    277             //   use best (as implemented here)
    278             //   choose specific type
     282            //   Find the model with the selected type. If selected type is -1 choose the one selected ad
     283            //   modelEXT which was the best
    279284            int iModel = -1;
    280285            if (source->modelEXT) {
    281                 pmModelType ext_model_type = source->modelEXT->type;
     286                pmModelType ext_model_type =  selectedModelType != -1  ? selectedModelType : source->modelEXT->type;
    282287                for (int j=0; j<source->modelFits->n; j++) {
    283288                    pmModel *aModel = source->modelFits->data[j];
Note: See TracChangeset for help on using the changeset viewer.