IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 26, 2009, 2:45:31 PM (17 years ago)
Author:
Paul Price
Message:

Reorganised the concepts files, moving the Write functions into pmConceptsWrite, and the Read functions into pmConceptsRead, which sort of makes sense. Added new type of concept property: copy. Most concepts use the default copy method (which is to simply copy the item), but for the TIMESYS concepts, we want to ensure that the target is of the correct type --- if it's already set (e.g., via the DEFAULTS), then we don't copy it. This will allow us to set the target TIMESYS using the DEFAULTS in the camera format, and have the output time be adjusted appropriately. Without this, the TIMESYS is simply copied, and specifying the TIMESYS in the DEFAULTS results in a warning ('values don't match'). Removed pmFPACopyConcepts, since it is pretty much the same as pmConceptsCopyFPA.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/config/pmConfigCamera.c

    r20048 r22699  
    280280        psMetadata *translation = psMetadataAlloc(); // The TRANSLATION --- how to read the FITS headers
    281281
    282         psList *concepts;               // List of concepts for each level
    283         psListIterator *iter;           // Iterator for concepts
    284         psString name;                  // Concept name, from iteration
    285 
    286         concepts = pmConceptsList(PM_FPA_LEVEL_FPA); // FPA-level concepts
    287         iter = psListIteratorAlloc(concepts, PS_LIST_HEAD, false);
    288         while ((name = psListGetAndIncrement(iter))) {
    289             const char *new = skycellConceptName(name, skycellConceptsFPA, system); // Name for skycell
     282        psMetadata *concepts;           // List of concepts for each level
     283        psMetadataIterator *iter;       // Iterator for concepts
     284        psMetadataItem *item;           // Concept specification item, from iteration
     285
     286        concepts = pmConceptsSpecs(PM_FPA_LEVEL_FPA); // FPA-level concepts
     287        iter = psMetadataIteratorAlloc(concepts, PS_LIST_HEAD, NULL);
     288        while ((item = psMetadataGetAndIncrement(iter))) {
     289            const char *new = skycellConceptName(item->name, skycellConceptsFPA, system); // Name for skycell
    290290            if (new) {
    291                 psMetadataAddStr(translation, PS_LIST_TAIL, name, 0, NULL, new);
     291                psMetadataAddStr(translation, PS_LIST_TAIL, item->name, 0, NULL, new);
    292292            }
    293293        }
     
    295295        psFree(concepts);
    296296
    297         concepts = pmConceptsList(PM_FPA_LEVEL_CHIP);
    298         iter = psListIteratorAlloc(concepts, PS_LIST_HEAD, false);
    299         while ((name = psListGetAndIncrement(iter))) {
    300             const char *new = skycellConceptName(name, skycellConceptsChip, system); // Name for skycell
     297        concepts = pmConceptsSpecs(PM_FPA_LEVEL_CHIP);
     298        iter = psMetadataIteratorAlloc(concepts, PS_LIST_HEAD, NULL);
     299        while ((item = psMetadataGetAndIncrement(iter))) {
     300            const char *new = skycellConceptName(item->name, skycellConceptsChip, system); // Name for skycell
    301301            if (new) {
    302                 psMetadataAddStr(translation, PS_LIST_TAIL, name, 0, NULL, new);
     302                psMetadataAddStr(translation, PS_LIST_TAIL, item->name, 0, NULL, new);
    303303            }
    304304        }
     
    306306        psFree(concepts);
    307307
    308         concepts = pmConceptsList(PM_FPA_LEVEL_CELL);
    309         iter = psListIteratorAlloc(concepts, PS_LIST_HEAD, false);
    310         while ((name = psListGetAndIncrement(iter))) {
    311             const char *new = skycellConceptName(name, skycellConceptsCell, system); // Name for skycell
     308        concepts = pmConceptsSpecs(PM_FPA_LEVEL_CELL);
     309        iter = psMetadataIteratorAlloc(concepts, PS_LIST_HEAD, false);
     310        while ((item = psMetadataGetAndIncrement(iter))) {
     311            const char *new = skycellConceptName(item->name, skycellConceptsCell, system); // Name for skycell
    312312            if (new) {
    313                 psMetadataAddStr(translation, PS_LIST_TAIL, name, 0, NULL, new);
     313                psMetadataAddStr(translation, PS_LIST_TAIL, item->name, 0, NULL, new);
    314314            }
    315315        }
Note: See TracChangeset for help on using the changeset viewer.