IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12681


Ignore:
Timestamp:
Mar 29, 2007, 12:22:22 PM (19 years ago)
Author:
Paul Price
Message:

Warn on bad DETREND.CONSTRAINTS rather than bail out.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAfileDefine.c

    r12603 r12681  
    778778    // XXX use PPIMAGE or DETREND for the recipe name?
    779779    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, "PPIMAGE");
    780     if (!status)
    781         psAbort("PPIMAGE recipe not found");
     780    if (!status) {
     781        psError(PS_ERR_UNEXPECTED_NULL, true, "PPIMAGE recipe not found.");
     782        psFree(options);
     783        psFree(fpa);
     784        retrun false;
     785    }
    782786    psMetadata *detConstraints = psMetadataLookupPtr (&status, recipe, "DETREND.CONSTRAINTS");
    783     if (!status)
    784         psAbort("DETREND.CONSTRAINTS not found");
    785     // XXX allow this and just skip?
     787    if (!status) {
     788        psWarning("DETREND.CONSTRAINTS not found --- no constraints will be applied.");
     789        goto DETREND_SELECT;
     790    }
    786791
    787792    psString typeName = pmDetrendTypeToString (type);
    788793    psMetadata *constraints = psMetadataLookupPtr (&status, detConstraints, typeName);
    789794    if (!status) {
    790         psAbort("DETREND.CONSTRAINTS for type %s not found", typeName);
     795        psWarning("DETREND.CONSTRAINTS for type %s not found --- no contraints will be applied.", typeName);
     796        psFree(typeName);
     797        goto DETREND_SELECT;
    791798    }
    792799    psFree(typeName);
     
    797804    while ((item = psMetadataGetAndIncrement (iter)) != NULL) {
    798805        if (item->type != PS_DATA_STRING) {
    799             psAbort("invalid type for DETREND.CONSTRAINT element");
     806            psWarning("Invalid type for DETREND.CONSTRAINT element %s --- ignoring constraint", item->name);
     807            continue;
    800808        }
    801809        char *option  = item->name;     // item->name must correspond to a valid detselect option
     
    809817            if (!status)
    810818                psAbort("failed to find filter (concept %s)", concept);
    811 
    812         }
    813         if (!strcasecmp (option, "exptime")) {
     819        } else if (!strcasecmp (option, "exptime")) {
    814820            options->exptime = psMetadataLookupF32 (&status, input->concepts, concept);
    815821            options->exptimeSet = true;
    816822            if (!status)
    817823                psAbort("exptime not found (concept %s)", concept);
    818         }
    819         if (!strcasecmp (option, "airmass")) {
     824        } else if (!strcasecmp (option, "airmass")) {
    820825            options->airmass = psMetadataLookupF32 (&status, input->concepts, concept);
    821826            options->airmassSet = true;
    822827            if (!status)
    823828                psAbort("airmass not found (concept %s)", concept);
    824         }
    825         if (!strcasecmp (option, "dettemp")) {
     829        } else if (!strcasecmp (option, "dettemp")) {
    826830            options->dettemp = psMetadataLookupF32 (&status, input->concepts, concept);
    827831            options->dettempSet = true;
    828832            if (!status)
    829833                psAbort("dettemp not found (concept %s)", concept);
    830         }
    831         if (!strcasecmp (option, "twilight")) {
     834        } else if (!strcasecmp (option, "twilight")) {
    832835            options->twilight = psMetadataLookupF32 (&status, input->concepts, concept);
    833836            options->twilightSet = true;
     
    849852    psFree(iter);
    850853
     854DETREND_SELECT:
     855
    851856    // search for existing detrend data (detID)
    852857    pmDetrendSelectResults *results = pmDetrendSelect (options, config);
     
    859864    psFree (options);
    860865
    861     if (found)
     866    if (found) {
    862867        *found = true;
     868    }
    863869    return file;
    864870}
     
    930936
    931937    if (config->cameraName[0] == '_' &&
    932         strcmp(config->cameraName + strlen(config->cameraName) - 5, "-CHIP") == 0) {
     938        strcmp(config->cameraName + strlen(config->cameraName) - 5, "-CHIP") == 0) {
    933939        // The input camera has already been mosaicked to this level
    934940        pmFPAfile *file = pmFPAfileDefineOutput(config, NULL, filename);
Note: See TracChangeset for help on using the changeset viewer.