IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 13, 2007, 3:42:04 PM (19 years ago)
Author:
Paul Price
Message:

Fixing up the skycell header keywords.

File:
1 edited

Legend:

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

    r14475 r14477  
    9191const static char *skycellConceptsFPA[] = { "FPA.EXPOSURE", "FPA.TIME", 0 };
    9292
    93 // Do we update a particular concept for a skycell?
    94 static bool updateConcept(const char *name, // Name of concept
    95                           const char **concepts // List of concepts NOT to update
    96                           )
     93// What do we call the skycell concept in the FITS header?
     94static const char *skycellConceptName(const char *name, // Name of concept
     95                                      const char **concepts, // List of concepts NOT to update
     96                                      const psMetadata *site // Site configuration
     97                                      )
    9798{
    9899    for (int i = 0; concepts[i]; i++) {
    99100        if (strcmp(name, concepts[i]) == 0) {
    100             return false;
    101         }
    102     }
    103     return true;
    104 }
    105 
    106 // What do we call the skycell concept in the FITS header?
    107 static const char* skycellConceptName(const char *name, // Name of concept
    108                                       const psMetadata *site // Site configuration
    109                                       )
    110 {
     101            return NULL;
     102        }
     103    }
     104
    111105    if (!site) {
    112106        return name;
     
    224218        iter = psListIteratorAlloc(concepts, PS_LIST_HEAD, false);
    225219        while ((name = psListGetAndIncrement(iter))) {
    226             psMetadataAddStr(translation, PS_LIST_TAIL, name, 0, NULL, name);
    227             if (updateConcept(name, skycellConceptsFPA)) {
    228                 psMetadataAddStr(translation, PS_LIST_TAIL, name, 0, NULL, skycellConceptName(name, site));
     220            const char *new = skycellConceptName(name, skycellConceptsFPA, site); // Name for skycell
     221            if (new) {
     222                psMetadataAddStr(translation, PS_LIST_TAIL, name, 0, NULL, new);
    229223            }
    230224        }
     
    235229        iter = psListIteratorAlloc(concepts, PS_LIST_HEAD, false);
    236230        while ((name = psListGetAndIncrement(iter))) {
    237             if (updateConcept(name, skycellConceptsChip)) {
    238                 psMetadataAddStr(translation, PS_LIST_TAIL, name, 0, NULL, skycellConceptName(name, site));
     231            const char *new = skycellConceptName(name, skycellConceptsChip, site); // Name for skycell
     232            if (new) {
     233                psMetadataAddStr(translation, PS_LIST_TAIL, name, 0, NULL, new);
    239234            }
    240235        }
     
    245240        iter = psListIteratorAlloc(concepts, PS_LIST_HEAD, false);
    246241        while ((name = psListGetAndIncrement(iter))) {
    247             if (updateConcept(name, skycellConceptsCell)) {
    248                 psMetadataAddStr(translation, PS_LIST_TAIL, name, 0, NULL, skycellConceptName(name, site));
     242            const char *new = skycellConceptName(name, skycellConceptsCell, site); // Name for skycell
     243            if (new) {
     244                psMetadataAddStr(translation, PS_LIST_TAIL, name, 0, NULL, new);
    249245            }
    250246        }
Note: See TracChangeset for help on using the changeset viewer.