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/Fits.c

    r31010 r31016  
    66 *
    77 *  @author IfA
    8  *  Copyright 2009 Institute for Astronomy, University of Hawaii
     8 *  Copyright 2011 Institute for Astronomy, University of Hawaii
    99 */
    1010
    1111#include "Fits.h"
     12
     13/**
     14  Non-class method
     15
     16  Gets cfitsio type from string
     17  */
     18int Fits_getDataType(char *typename) {
     19
     20    if (!strncmp(typename, "TBYTE", 5))  return TBYTE;
     21    if (!strncmp(typename, "TSHORT", 6)) return TSHORT;
     22    if (!strncmp(typename, "TLONGLONG", 9)) return TLONGLONG;
     23    if (!strncmp(typename, "TLONG", 5)) return TLONG;
     24    if (!strncmp(typename, "TFLOAT", 6)) return TFLOAT;
     25    if (!strncmp(typename, "TDOUBLE", 7)) return TDOUBLE;
     26    if (!strncmp(typename, "TSTRING", 7)) return TSTRING;
     27
     28    psError(PS_ERR_IO, false, "* Fits: Don't understand data type '%s'", typename);
     29
     30    return 0;
     31}
    1232
    1333/**
Note: See TracChangeset for help on using the changeset viewer.