IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14877


Ignore:
Timestamp:
Sep 17, 2007, 4:56:36 PM (19 years ago)
Author:
jhoblitt
Message:

add psFitsOptionsAlloc()
add psFitsSetOptions()

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

Legend:

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

    r14876 r14877  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2007-09-18 02:33:48 $
     9 *  @version $Revision: 1.70 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2007-09-18 02:56:36 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    182182}
    183183
     184static void psFitsOptionsFree(psFitsOptions *opt)
     185{
     186    psFree(opt->tilesize);
     187}
     188
     189psFitsOptions* psFitsOptionsAlloc(
     190    psFitsCompressionType type,         ///< type of compression
     191    psVector *tilesize,                 ///< vector defining compression tile size
     192    int noisebits,                      ///< noise bits
     193    int scale,                          ///< hcompress scale
     194    int smooth                          ///< hcompress smothing
     195)
     196{
     197    psFitsOptions *opt = psAlloc(sizeof(psFitsOptions));
     198
     199    opt->type = type;
     200    opt->tilesize = tilesize;
     201    opt->noisebits = noisebits;
     202    opt->scale = scale;
     203    opt->smooth = smooth;
     204
     205    psMemSetDeallocator(opt, (psFreeFunc) psFitsOptionsFree);
     206
     207    return opt;
     208}
     209
    184210bool psMemCheckFits(psPtr ptr)
    185211{
     
    656682
    657683
     684bool psFitsSetOptions(
     685    psFits* fits,                       ///< psFits object to close
     686    psFitsOptions *opt                  ///< options object
     687)
     688{
     689    return psFitsSetCompression(
     690            fits,
     691            opt->type,
     692            opt->tilesize,
     693            opt->noisebits,
     694            opt->scale,
     695            opt->smooth);
     696}
     697
     698
    658699psDataType p_psFitsTypeFromCfitsio(int datatype)
    659700{
  • trunk/psLib/src/fits/psFits.h

    r14872 r14877  
    44 * @author Robert DeSonia, MHPCC
    55 *
    6  * @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2007-09-17 23:01:00 $
     6 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2007-09-18 02:56:36 $
    88 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    99 */
     
    5656}
    5757psFits;
     58
     59/** FITS options object. */
     60typedef struct
     61{
     62    psFitsCompressionType type;         ///< type of compression
     63    psVector *tilesize;                 ///< vector defining compression tile size
     64    int noisebits;                      ///< noise bits
     65    int scale;                          ///< hcompress scale
     66    int smooth;                         ///< hcompress smothing
     67}
     68psFitsOptions;
    5869
    5970/** Opens a FITS file and allocates the associated psFits object.
     
    7384);
    7485
     86/** Creates a new FITS options struct
     87 *
     88 *  @return psFitsOptions or NULL on failure
     89 */
     90psFitsOptions* psFitsOptionsAlloc(
     91    psFitsCompressionType type,         ///< type of compression
     92    psVector *tilesize,                 ///< vector defining compression tile size
     93    int noisebits,                      ///< noise bits
     94    int scale,                          ///< hcompress scale
     95    int smooth                          ///< hcompress smothing
     96);
     97
    7598/** Closes a FITS file.
    7699 *
     
    96119);
    97120
     121/** Sets FITS write options
     122 *
     123 *  @return bool      TRUE if successfully configured, otherwise FALSE
     124 */
     125bool psFitsSetOptions(
     126    psFits* fits,                       ///< psFits object to close
     127    psFitsOptions *opt                  ///< options object
     128);
     129
    98130/** Checks the type of a particular pointer.
    99131 *
Note: See TracChangeset for help on using the changeset viewer.