IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27701


Ignore:
Timestamp:
Apr 15, 2010, 3:26:27 PM (16 years ago)
Author:
rhenders
Message:

Fixed issue where NULL values read from a FITS input header would propogate to output FITS

File:
1 edited

Legend:

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

    r27607 r27701  
    735735
    736736                case TBYTE:
    737                     if (fromHeader) fits_read_key(fitsIn, TBYTE, table->columns[i].ippName, &int8col[0], NULL, &readStatus);
     737                    if (fromHeader) {
     738                        fits_read_key(fitsIn, TBYTE, table->columns[i].ippName, &int8col[0], NULL, &readStatus);
     739                        if (!isnormal(int8col[0])) int8col[0] = int8null;
     740                    }
    738741                    else fits_read_col(fitsIn, TBYTE, table->columns[i].ippColNum, 1, 1, nRows, &int8null, int8col, &anynull, &readStatus);
    739742                    fits_write_col(fitsOut, TBYTE, col, 1, 1, nRows, int8col, &writeStatus);
    740743                    break;
    741744                case TSHORT:
    742                     if (fromHeader) fits_read_key(fitsIn, TSHORT, table->columns[i].ippName, &int16col[0], NULL, &readStatus);
     745                    if (fromHeader) {
     746                        fits_read_key(fitsIn, TSHORT, table->columns[i].ippName, &int16col[0], NULL, &readStatus);
     747                        if (!isnormal(int16col[0])) int16col[0] = int16null;
     748                    }
    743749                    else fits_read_col(fitsIn, TSHORT, table->columns[i].ippColNum, 1, 1, nRows, &int16null, int16col, &anynull, &readStatus);
    744750                    fits_write_col(fitsOut, TSHORT, col, 1, 1, nRows, int16col, &writeStatus);
    745751                    break;
    746752                case TLONG:
    747                     if (fromHeader) fits_read_key(fitsIn, TLONG, table->columns[i].ippName, &longcol[0], NULL, &readStatus);
     753                    if (fromHeader) {
     754                        fits_read_key(fitsIn, TLONG, table->columns[i].ippName, &longcol[0], NULL, &readStatus);
     755                        if (!isnormal(longcol[0])) longcol[0] = longnull;
     756                    }
    748757                    else fits_read_col(fitsIn, TLONG, table->columns[i].ippColNum, 1, 1, nRows, &longnull, longcol, &anynull, &readStatus);
    749758                    fits_write_col(fitsOut, TLONG, col, 1, 1, nRows, longcol, &writeStatus);
    750759                    break;
    751760                case TLONGLONG:
    752                     if (fromHeader) fits_read_key(fitsIn, TLONGLONG, table->columns[i].ippName, &longcol[0], NULL, &readStatus);
     761                    if (fromHeader) {
     762                        fits_read_key(fitsIn, TLONGLONG, table->columns[i].ippName, &longcol[0], NULL, &readStatus);
     763                        if (!isnormal(longcol[0])) longcol[0] = longnull;
     764                    }
    753765                    else fits_read_col(fitsIn, TLONGLONG, table->columns[i].ippColNum, 1, 1, nRows, &longnull, longcol, &anynull, &readStatus);
    754766                    fits_write_col(fitsOut, TLONGLONG, col, 1, 1, nRows, longcol, &writeStatus);
    755767                    break;
    756768                case TFLOAT:
    757                     if (fromHeader) fits_read_key(fitsIn, TFLOAT, table->columns[i].ippName,&floatcol[0], NULL, &readStatus);
     769                    if (fromHeader) {
     770                        fits_read_key(fitsIn, TFLOAT, table->columns[i].ippName,&floatcol[0], NULL, &readStatus);
     771                        if (!isnormal(floatcol[0])) floatcol[0] = floatnull;
     772                    }
    758773                    else fits_read_col(fitsIn, TFLOAT, table->columns[i].ippColNum, 1, 1, nRows, &floatnull, floatcol, &anynull, &readStatus);
    759774                    fits_write_col(fitsOut, TFLOAT, col, 1, 1, nRows, floatcol, &writeStatus);
    760775                    break;
    761776                case TDOUBLE:
    762                     if (fromHeader) fits_read_key(fitsIn, TDOUBLE, table->columns[i].ippName, &doublecol[0], NULL, &readStatus);
     777                    if (fromHeader) {
     778                        fits_read_key(fitsIn, TDOUBLE, table->columns[i].ippName, &doublecol[0], NULL, &readStatus);
     779                        if (!isnormal(doublecol[0])) doublecol[0] = doublenull;
     780                    }
    763781                    else fits_read_col(fitsIn, TDOUBLE, table->columns[i].ippColNum, 1, 1, nRows, &doublenull, doublecol, &anynull, &readStatus);
    764782                    fits_write_col(fitsOut, TDOUBLE, col, 1, 1, nRows, doublecol, &writeStatus);
Note: See TracChangeset for help on using the changeset viewer.