IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 41732


Ignore:
Timestamp:
Jul 29, 2021, 4:41:25 PM (5 years ago)
Author:
eugene
Message:

remove PSCAMERA from SKYCELL format rule : do not restrict to the same camera for diffs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSub/src/ppSubCamera.c

    r41528 r41732  
    188188    altconfig->recipes = psMetadataCopy(NULL, config->recipes); // container for camera-specific recipe values (to be dropped)
    189189
     190    // remove PSCAMERA entries from *-SKYCELL cameras
     191    // XXX make this optional to force matching cameras if desired?
     192    bool mdok = false;
     193    psMetadata *cameras = psMetadataLookupMetadata(&mdok, altconfig->system, "CAMERAS");
     194    psAssert(cameras, "missing cameras in system config info");
     195   
     196    // iterate over the cameras and find ones with names like _*-SKYCELLS
     197    // psMetadataIterator *camerasIter = psMetadataIteratorAlloc(cameras, PS_LIST_HEAD, "^_.+-SKYCELL$");
     198    psMetadataIterator *camerasIter = psMetadataIteratorAlloc(cameras, PS_LIST_HEAD, NULL);
     199    psAssert(camerasIter, "unable to generate iterator?");
     200
     201    psMetadataItem *camerasItem = NULL; // Item from the metadata
     202    while ((camerasItem = psMetadataGetAndIncrement(camerasIter))) {
     203      psAssert(camerasItem->type == PS_DATA_METADATA, "camerasItem has invalid type");
     204     
     205      char *name = camerasItem->name;
     206      psAssert (name, "NULL name for item");
     207
     208      int nameLen = strlen(name);
     209      if (name[0] != '_') continue;
     210      if (nameLen <= 9) continue;
     211      char *p = &name[nameLen - 8];
     212      if (strcmp(p, "-SKYCELL")) continue;
     213
     214      // remove PSCAMERA entries from *-SKYCELL cameras
     215      psMetadata *formats = psMetadataLookupMetadata(&mdok, camerasItem->data.md, "FORMATS"); // List of formats
     216      psAssert (formats, "missing FORMATS in camera.config ");
     217
     218      psMetadata *format = psMetadataLookupMetadata(&mdok, formats, "SKYCELL"); // one true format for skycells
     219      psAssert (format, "missing SKYCELL metaformat for -SKYCELL entry ");
     220
     221      psMetadata *rule = psMetadataLookupMetadata(&mdok, format, "RULE"); // one true format for skycells
     222      psAssert (rule, "missing RULE in SKYCELL metaformat for -SKYCELL entry ");
     223
     224      psString pscamera = psMetadataLookupStr(&mdok, rule, "PSCAMERA"); // one true format for skycells
     225      if (!pscamera) continue; // already removed, or never supplied
     226
     227      psMetadataRemoveKey (rule, "PSCAMERA"); // allow any camera skycell to match
     228    }
    190229    return (altconfig);
    191230}
     
    231270    pmConfig *refconfig = pmConfigMakeTemp(config);
    232271
     272# if (0)
     273    // EAM TEST: can we bind the ref to the input to force the right skycell format?
     274    // Reference image
     275    pmFPAfile *ref = defineInputFile(&success, config, input, "PPSUB.REF", "REF", PM_FPA_FILE_IMAGE);
     276    if (!success) {
     277        psError(psErrorCodeLast(), false, "Failed to build FPA from PPSUB.REF");
     278        return false;
     279    }
     280# else
    233281    // Reference image
    234282    pmFPAfile *ref = defineInputFile(&success, refconfig, NULL, "PPSUB.REF", "REF", PM_FPA_FILE_IMAGE);
     
    237285        return false;
    238286    }
     287# endif
    239288
    240289    defineInputFile(&success, refconfig, ref, "PPSUB.REF.MASK", "REF.MASK", PM_FPA_FILE_MASK);
Note: See TracChangeset for help on using the changeset viewer.