IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 7, 2005, 6:32:40 PM (21 years ago)
Author:
eugene
Message:

cleanup, organization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psLibUtils.c

    r4954 r4977  
    11# include <strings.h>  // for strncasecmp
    22# include <pslib.h>
     3# include "psLibUtils.h"
    34
    45// XXX EAM : this is NOT included in the C99 headers ??
     
    157158    memcpy (tmpVector->data.F32, image->data.F32[row], image->numCols*sizeof(psF32));
    158159    return(tmpVector);
    159 }
    160 
    161 // extract config informatin from config data or from image header, if specified
    162 psF32 pmConfigLookupF32 (bool *status, psMetadata *config, psMetadata *header, char *name) {
    163 
    164     char *source;
    165     char *keyword;
    166     psF32 value;
    167     psMetadataItem *item;
    168 
    169     // look for the entry in the config collection
    170     item = psMetadataLookup (config, name);
    171     if (item == NULL) {
    172         psLogMsg ("pmConfigLookupF32", 2, "no key %s in config data, trying as header keyword", name);
    173         value = psMetadataLookupF32 (status, header, name);
    174         if (*status == false) {
    175             psAbort ("pmConfigLookupF32", "no key %s in header", name);
    176         }
    177         *status = true;
    178         return (value);
    179     }   
    180 
    181     // I'm either expecting a string, with the name "HD:keyword"...
    182     if (item->type == PS_META_STR) {
    183         source = item->data.V;
    184         if (!strncasecmp (source, "HD:", 3)) {
    185             keyword = &source[3];
    186             value = psMetadataLookupF32 (status, header, keyword);
    187             if (*status == false) {
    188                 psAbort ("pmConfigLookupF32", "no key %s in config", name);
    189             }
    190             *status = true;
    191             // psFree (item);
    192             return (value);
    193         }       
    194     }
    195 
    196     //  ... or a value (F32?)
    197     if (item->type == PS_META_F32) {
    198         value = item->data.F32;
    199         // psFree (item);
    200         return (value);
    201     }
    202 
    203     *status = false;
    204     psError(PS_ERR_UNKNOWN, true, "invalid item");
    205     return (0);
    206160}
    207161
Note: See TracChangeset for help on using the changeset viewer.