IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 5, 2009, 3:13:53 PM (17 years ago)
Author:
Paul Price
Message:

Fixing bug that prevents funpack from decompressing FITS files cleanly --- for a single compressed image, funpack would decompress it into a PHU and an image extension. This is fixed by adding ZSIMPLE to the header, but it has to go in early in the header (after the bunch of stuff written by fits_insert_img is not good enough). Yuk!

File:
1 edited

Legend:

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

    r24863 r25002  
    616616    }
    617617
     618    bool createPHU = false;             // Are we creating a PHU?
     619
    618620    // Create the image HDU
    619621    int hdus = psFitsGetSize(fits);     // Number of HDUs in file
     
    621623        // We're creating the first image
    622624        fits_create_img(fits->fd, bitPix, naxis, naxes, &status);
     625        createPHU = true;
    623626    } else {
    624627        if (!after) {
     
    627630                // Set status to signal fits_insert_img to insert a new primary HDU
    628631                status = PREPEND_PRIMARY;
     632                createPHU = true;
    629633            } else {
    630634                // Move back one to perform an insert after the previous HDU
     
    641645
    642646    // write the header, if any.
    643     if (header && !psFitsWriteHeader(fits, header)) {
     647    if (header && !psFitsWriteHeaderImage(fits, header, createPHU)) {
    644648        psError(PS_ERR_IO, false, "Unable to write FITS header.\n");
    645649        success = false;
Note: See TracChangeset for help on using the changeset viewer.