IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 22, 2005, 11:52:49 AM (21 years ago)
Author:
desonia
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataIO/psFits.c

    r3407 r3476  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-03-11 20:38:56 $
     9 *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-03-22 21:52:49 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7878    case TDBLCOMPLEX:
    7979        return PS_TYPE_C64;
     80    case TLOGICAL:
     81        return PS_TYPE_BOOL;
    8082    default:
     83        psError(PS_ERR_IO, true,
     84                "Unknown FITS datatype, %d.",
     85                datatype);
    8186        return PS_TYPE_PTR;
    8287    }
    8388}
    84 
    8589
    8690static bool convertPsTypeToFits(psElemType type, int* bitPix, double* bZero, int* dataType)
     
    12951299    fits_get_num_rows(fits->p_fd, &numRows, &status);
    12961300
     1301    // get the column length.
     1302    int width;
     1303    if ( fits_get_col_display_width(fits->p_fd, colnum, &width, &status) != 0) {
     1304        char fitsErr[MAX_STRING_LENGTH];
     1305        (void)fits_get_errstatus(status, fitsErr);
     1306        psError(PS_ERR_IO, true,
     1307                PS_ERRORTEXT_psFits_GET_COLTYPE,
     1308                fitsErr);
     1309        return NULL;
     1310    }
     1311
     1312    // allocate the buffers
    12971313    psArray* result = psArrayAlloc(numRows);
     1314    for (int row = 0; row < numRows; row++) {
     1315        result->data[row] = psAlloc((width+1)*sizeof(char));
     1316    }
     1317    result->n = numRows;
    12981318
    12991319    fits_read_col_str(fits->p_fd,
     
    13221342                                   const char* colname)
    13231343{
     1344    int status = 0;
    13241345    int colnum = 0;
    1325     int status = 0;
    13261346
    13271347    if (fits == NULL) {
     
    13591379    // get the number of rows
    13601380    long numRows = 0;
    1361     fits_get_num_rows(fits->p_fd, &numRows, &status);
     1381    fits_get_num_rows(fits->p_fd,
     1382                      &numRows,
     1383                      &status);
    13621384
    13631385    // get the column datatype.
     
    13761398    psVector* result = psVectorAlloc(numRows, convertFitsToPsType(typecode));
    13771399
    1378     fits_read_col(fits->p_fd, typecode, colnum, 1 /* firstrow */,
    1379                   1 /* firstelem */, numRows, NULL, result->data.V,
    1380                   NULL, &status);
     1400    fits_read_col(fits->p_fd,
     1401                  typecode,
     1402                  colnum,
     1403                  1 /* firstrow */,
     1404                  1 /* firstelem */,
     1405                  numRows,
     1406                  NULL,
     1407                  (psPtr)(result->data.U8),
     1408                  NULL,
     1409                  &status);
    13811410
    13821411    if ( status != 0) {
Note: See TracChangeset for help on using the changeset viewer.