IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11101


Ignore:
Timestamp:
Jan 15, 2007, 11:58:15 AM (19 years ago)
Author:
eugene
Message:

fix up the FRINGE.FILTERS parsing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImageParseCamera.c

    r11095 r11101  
    1818
    1919    // determine filter from the concepts
    20     char *filter = psMetadataLookupStr (&status, input->fpa->concepts, "FPA.FILTER");
     20    char *filter = pmConceptsFilterIDfromConcept ("FPA.FILTER", input->fpa->concepts, config->camera);
    2121
    2222#if 0
     
    8787
    8888    if (options->doFlat) {
    89         // select FLAT.FILTERS from the recipe and test if the filter matches
    90         // is the mdi saved with psList or string?
    91         psMetadataItem *mdi = psMetadataLookup (recipe, "FLAT.FILTERS");
    92         if (mdi == NULL) {
    93             // no valid filters for flat data for this camera
    94             options->doFlat = false;
    95             goto skip_flat;
    96         }
    97         // place entry on a list regardless of type
    98         psList *filters = NULL;
    99         if (mdi->type == PS_DATA_STRING) {
    100             filters = psListAlloc(NULL);
    101             psListAdd (filters, PS_LIST_HEAD, mdi);
    102         } else {
    103             if (mdi->type != PS_DATA_METADATA_MULTI) psAbort ("ppImage", "invalid type for FLAT.FILTERS");
    104             filter = psMemIncrRefCounter(mdi->data.list);
    105         }
    106 
    107         // search through list to find the current filter
    108         psListIterator *iter = psListIteratorAlloc (filters, PS_LIST_HEAD, FALSE);
    109         options->doFlat = false;
    110         for (int i = 0; !options->doFlat && (i < filters->n); i++) {
    111             psMetadataItem *item = psListGetAndIncrement (iter);
    112             char *validFilter = item->data.V;
    113             if (strcmp (validFilter, filter)) continue;
    114             options->doFlat = true;
    115         }
    116     }
    117 skip_flat:
    118     if (options->doFlat) {
     89        // if we fail to find the item in Args, we try again in Conf, then DetDB
     90        // we need to handle the errors and catch serious errors, as opposed to
     91        // data-not-found errors
    11992        bool status = false;
    12093        pmFPAfileDefineFromArgs  (&status, config, "PPIMAGE.FLAT", "FLAT");
     94        psErrorClear();
    12195        pmFPAfileDefineFromConf  (&status, config, "PPIMAGE.FLAT");
     96        psErrorClear();
    12297        pmFPAfileDefineFromDetDB (&status, config, "PPIMAGE.FLAT", input->fpa, PM_DETREND_TYPE_FLAT);
    12398        if (!status) {
     
    127102    }
    128103
     104    // fringe frame are only applied for a subset of the filters. 
     105    // if the filter is one of those identified by a FRINGE.FILTERS metadata entry
     106    // in ppImage.config, apply the fringe frame
    129107    if (options->doFringe) {
    130108        // select FRINGE.FILTERS from the recipe and test if the filter matches
     
    143121        } else {
    144122            if (mdi->type != PS_DATA_METADATA_MULTI) psAbort ("ppImage", "invalid type for FRINGE.FILTERS");
    145             filter = psMemIncrRefCounter(mdi->data.list);
     123            filters = psMemIncrRefCounter(mdi->data.list);
    146124        }
    147125
Note: See TracChangeset for help on using the changeset viewer.