IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 23, 2011, 9:53:44 AM (15 years ago)
Author:
rhenders
Message:

Added non-class utility method to Fits class for getting FITS data type from string

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/src/Config.c

    r31015 r31016  
    44 *
    55 *  @author IfA
    6  *  Copyright 2009 Institute for Astronomy, University of Hawaii
     6 *  Copyright 2011 Institute for Astronomy, University of Hawaii
    77 */
    88
     
    1313
    1414#include "Fits.h"
    15 
    16 /**
    17    Gets PS type from string TODO FITS types? should be in Fits class
    18    */
    19 static int ippToPsps_GetDataType(char *typename) {
    20 
    21     if (!strncmp(typename, "TBYTE", 5))  return TBYTE;
    22     if (!strncmp(typename, "TSHORT", 6)) return TSHORT;
    23     if (!strncmp(typename, "TLONGLONG", 9)) return TLONGLONG;
    24     if (!strncmp(typename, "TLONG", 5)) return TLONG;
    25     if (!strncmp(typename, "TFLOAT", 6)) return TFLOAT;
    26     if (!strncmp(typename, "TDOUBLE", 7)) return TDOUBLE;
    27     if (!strncmp(typename, "TSTRING", 7)) return TSTRING;
    28 
    29     psError(PS_ERR_IO, false, "Don't understand type '%s'", typename);
    30 
    31     return 0;
    32 }
    3315
    3416/**
     
    385367        // column type
    386368        getAttribute(node, "type", buffer);
    387         table->columns[columnNum].pspsType = ippToPsps_GetDataType(buffer);
     369        table->columns[columnNum].pspsType = Fits_getDataType(buffer);
    388370
    389371        // default value
     
    514496                // IPP type
    515497                getAttribute(node, "ippType", buffer);
    516                 column->ippType = ippToPsps_GetDataType(buffer);
     498                column->ippType = Fits_getDataType(buffer);
    517499
    518500                column->usingDefault = false;
Note: See TracChangeset for help on using the changeset viewer.