IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 25, 2006, 5:24:49 PM (20 years ago)
Author:
Paul Price
Message:

psFitsWriteHeader checks that the HDU exists, and creates one if necessary. Added p_psFitsWriteHeader, which does not check. This allows psFitsInsertImage to call p_psFitsWriteHeader, since that already creates the HDU. Was getting into trouble by having psFitsInsertImage create a primary HDU for data, then calling psFitsWriteHeader, which created a primary HDU just for the header (dummy values for BITPIX, NAXIS, etc), then the data couldn't be written out. It would be much better if cfitsio treated data-less PHUs better --- if it recognised an HDU as extant once fits_create_img had been called.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/fits/tst_psFits.c

    r6912 r7227  
    66*  @author Robert DeSonia, MHPCC
    77*
    8 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2006-04-20 01:13:11 $
     8*  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2006-05-26 03:24:37 $
    1010*
    1111*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    119119
    120120        // set the pixels in the image
    121         psBinaryOp(image,image,"=",psScalarAlloc(lcv,PS_TYPE_F32));
    122         if (! psFitsWriteImage(fitsFile,header,image,1,extname) ) {
     121        psImageInit(image, lcv);
     122        if (! psFitsWriteImage(fitsFile,header,image,0,extname) ) {
    123123            psError(PS_ERR_UNKNOWN, false,
    124124                    "Could not write image.");
Note: See TracChangeset for help on using the changeset viewer.