IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14872


Ignore:
Timestamp:
Sep 17, 2007, 1:01:00 PM (19 years ago)
Author:
jhoblitt
Message:

check psFitsSetCompression() to accept a psVector in place of an dim array and size

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

Legend:

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

    r14871 r14872  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.67 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2007-09-17 22:48:36 $
     9 *  @version $Revision: 1.68 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2007-09-17 23:01:00 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    565565    psFits* fits,                       ///< psFits object to close
    566566    psFitsCompressionType type,         ///< type of compression
    567     int ndim,                           ///< number of dim in tile size array
    568     long *tilesize,                     ///< pointer to an array defining compression tile size
     567    psVector *tilesize,
    569568    int noisebits,                      ///< noise bits
    570569    int scale,                          ///< hcompress scale
     
    600599        goto ERROR;
    601600    }
    602     fits_set_tile_dim(fits->fd, ndim, tilesize, &status);
     601
     602    // convert a psVector into the (long *) array that cfitsio requires
     603    psVector *dim = NULL;
     604    if (sizeof(long) == sizeof(psS64)) {
     605        dim = psVectorCopy(NULL, tilesize, PS_DATA_S64);
     606        fits_set_tile_dim(fits->fd, psVectorLength(dim), (long *)dim->data.S64, &status);
     607    } else if (sizeof(long) == sizeof(psS32)) {
     608        dim = psVectorCopy(NULL, tilesize, PS_DATA_S32);
     609        fits_set_tile_dim(fits->fd, psVectorLength(dim), (long *)dim->data.S32, &status);
     610    } else {
     611        psAbort("can't map (long) type to a psLib type");
     612    }
     613    // status check belongs to fits_set_tile_dim() call
    603614    if (!status) {
    604615        goto ERROR;
    605616    }
     617
    606618    fits_set_noise_bits(fits->fd, noisebits, &status);
    607619    if (!status) {
  • trunk/psLib/src/fits/psFits.h

    r14868 r14872  
    44 * @author Robert DeSonia, MHPCC
    55 *
    6  * @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2007-09-17 21:35:35 $
     6 * @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2007-09-17 23:01:00 $
    88 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    99 */
     
    9090    psFits* fits,                       ///< psFits object to close
    9191    psFitsCompressionType type,         ///< type of compression
    92     int ndim,                           ///< number of dim in tile size array
    93     long *tilesize,                     ///< pointer to an array defining compression tile size
     92    psVector *tilesize,                 ///< vector defining compression tile size
    9493    int noisebits,                      ///< noise bits
    9594    int scale,                          ///< hcompress scale
Note: See TracChangeset for help on using the changeset viewer.