IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17048


Ignore:
Timestamp:
Mar 18, 2008, 2:11:36 PM (18 years ago)
Author:
Paul Price
Message:

Including strings.h for strcasecmp

Location:
trunk/psLib/src/fits
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/fits/psFitsHeader.c

    r16822 r17048  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2008-03-05 02:19:28 $
     9 *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2008-03-19 00:11:36 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    1818
    1919#include <unistd.h>
     20#include <string.h>
     21#include <strings.h>
    2022
    2123#include "psAssert.h"
    2224#include "psFits.h"
    23 #include "string.h"
    24 #include "strings.h"
    2525#include "psError.h"
    2626
     
    479479    int status = 0;                     // Status of cfitsio calls
    480480    bool simple = true;                 // If SIMPLE is T, then the file should conform to the FITS standard
     481    psFitsCompressionType compress = psFitsCompressionGetType(fits); // Compression type
    481482    if (psFitsGetExtNum(fits) == 0) {
    482483        // We allow the user to write SIMPLE, but it must be boolean
     
    485486            if (simpleItem->type != PS_DATA_BOOL) {
    486487                psError(PS_ERR_BAD_PARAMETER_TYPE, true, "SIMPLE in a FITS header must be of boolean type: "
    487                         "not %x --- assuming TRUE.\n", simpleItem->type);
     488                        "not %x --- assuming FALSE.\n", simpleItem->type);
    488489                int value = false;          // Temporary holder for boolean
    489490                fits_update_key(fits->fd, TLOGICAL, "SIMPLE", &value,
     
    492493            } else if (!simpleItem->data.B) {
    493494                simple = false;
    494                 int value = false;          // Temporary holder for boolean
     495                int value = false;      // Temporary holder for boolean
    495496                fits_update_key(fits->fd, TLOGICAL, "SIMPLE", &value,
    496497                                "File does not conform to FITS standard", &status);
    497498            }
    498             // SIMPLE = T is taken care of by cfitsio.
    499         }
     499            // Uncompressed SIMPLE = T is taken care of by cfitsio.
     500        }
     501    }
     502    if ((!fits->options || fits->options->conventions.compression) && compress != PS_FITS_COMPRESS_NONE) {
     503        psMetadataItem *simpleItem = psMetadataLookup(output, "SIMPLE"); // SIMPLE in the header
     504        if (simpleItem) {
     505            if (simpleItem->type != PS_DATA_BOOL) {
     506                psError(PS_ERR_BAD_PARAMETER_TYPE, true, "SIMPLE in a FITS header must be of boolean type: "
     507                        "not %x --- assuming FALSE.\n", simpleItem->type);
     508                simple = false;
     509            } else {
     510                simple = simpleItem->data.B;
     511            }
     512        }
     513        //        int value = simple;             // Temporary holder for boolean
     514        //        fits_update_key(fits->fd, TLOGICAL, "ZSIMPLE", &value,
     515        //                        "Uncompressed file's conformance to FITS standard", &status);
    500516    }
    501517
    502518    // Traverse the metadata list and add each key.
    503     psFitsCompressionType compress = psFitsCompressionGetType(fits); // Compression type
    504519    psListIterator* iter = psListIteratorAlloc(output->list, PS_LIST_HEAD, true); // Iterator
    505520    psMetadataItem* item;               // Item from iteration
     
    513528            // changed) so we'll take care of that for them.
    514529            if (keywordInList(name, noWriteFitsKeys)) {
    515                 if ((fits->options && !fits->options->conventions.compression) ||
    516                     compress == PS_FITS_COMPRESS_NONE) {
     530                if (strcmp(name, "SIMPLE") == 0 || compress == PS_FITS_COMPRESS_NONE ||
     531                    (fits->options && !fits->options->conventions.compression)) {
    517532                    // No compression happening, so don't write keyword
    518533                    continue;
  • trunk/psLib/src/fits/psFitsScale.c

    r16672 r17048  
    66#include <assert.h>
    77#include <string.h>
     8#include <strings.h>
    89
    910#include "psAbort.h"
Note: See TracChangeset for help on using the changeset viewer.