IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 17, 2005, 2:48:18 PM (21 years ago)
Author:
Paul Price
Message:

Reading in an FPA seems to be working!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/archive/scripts/src/psAdditionals.c

    r4093 r4309  
    22#include <string.h>
    33#include "pslib.h"
    4 #include "psmodule.h"
     4#include "papmodule.h"
    55
    66
     
    3535
    3636
    37 const char *psMetadataLookupString(bool *status, const psMetadata *md, const char *key)
     37char *psMetadataLookupString(bool *status, const psMetadata *md, const char *key)
    3838{
    3939    psMetadataItem *item = psMetadataLookup((psMetadata*)md, key); // The metadata with instruments
    40     const char *value = NULL;           // The value to return
     40    char *value = NULL;                 // The value to return
    4141    if (!item) {
    4242        // The given key isn't in the metadata
     
    6464}
    6565
     66papChip *psMetadataLookupChip(bool *status, const psMetadata *md, const char *key)
     67{
     68    psMetadataItem *item = psMetadataLookup((psMetadata*)md, key); // The metadata with instruments
     69    papChip *value = NULL;              // The value to return
     70    if (!item) {
     71        // The given key isn't in the metadata
     72        if (status) {
     73            *status = false;
     74        } else {
     75            psError(PS_ERR_IO, true, "Couldn't find %s in the metadata.\n");
     76        }
     77    } else if (item->type != PS_META_CHIP) {
     78        // The value at the key isn't metadata
     79        if (status) {
     80            *status = false;
     81        } else {
     82            psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_META_CHIP, as expected.\n");
     83        }
     84        value = NULL;
     85    } else {
     86        // We have the requested metadata
     87        if (status) {
     88            *status = true;
     89        }
     90        value = item->data.V; // The requested metadata
     91    }
     92    return value;
     93}
     94
     95papCell *psMetadataLookupCell(bool *status, const psMetadata *md, const char *key)
     96{
     97    psMetadataItem *item = psMetadataLookup((psMetadata*)md, key); // The metadata with instruments
     98    papCell *value = NULL;              // The value to return
     99    if (!item) {
     100        // The given key isn't in the metadata
     101        if (status) {
     102            *status = false;
     103        } else {
     104            psError(PS_ERR_IO, true, "Couldn't find %s in the metadata.\n");
     105        }
     106    } else if (item->type != PS_META_CELL) {
     107        // The value at the key isn't metadata
     108        if (status) {
     109            *status = false;
     110        } else {
     111            psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_META_CHIP, as expected.\n");
     112        }
     113        value = NULL;
     114    } else {
     115        // We have the requested metadata
     116        if (status) {
     117            *status = true;
     118        }
     119        value = item->data.V; // The requested metadata
     120    }
     121    return value;
     122}
    66123
    67124void psMetadataPrint(psMetadata *md, int level)
Note: See TracChangeset for help on using the changeset viewer.