IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16141


Ignore:
Timestamp:
Jan 18, 2008, 3:04:13 PM (18 years ago)
Author:
Paul Price
Message:

Moving all options on FITS I/O into an additional structure, psFitsOptions. The idea is that this can be carried around independently of the FITS structure, which is only created when opening a file.

Location:
branches/pap_branch_080117/psLib/src/fits
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_080117/psLib/src/fits/psFits.c

    r16131 r16141  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.76.2.2 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2008-01-18 03:37:50 $
     9 *  @version $Revision: 1.76.2.3 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2008-01-19 01:04:13 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7878        fitsClose(fits);
    7979    }
    80     psFree (fits->extword);
     80    psFree(fits->options);
    8181}
    8282
     
    160160
    161161    psFits* fits = psAlloc(sizeof(psFits));
     162    psMemSetDeallocator(fits, (psFreeFunc)fitsFree);
     163
    162164    fits->fd = fptr;
    163165    fits->writable = (iomode == READWRITE);
    164     fits->extword = NULL;
    165     fits->conventions.compression = true;
    166     fits->conventions.psBitpix = true;
    167 
    168     fits->floatType = PS_FITS_FLOAT_NONE;
    169     fits->bitpix = 0;
    170     fits->scaling = PS_FITS_SCALE_NONE;
    171     fits->fuzz = true;
    172     fits->bscale = 1.0;
    173     fits->bzero = 0.0;
    174     fits->mean = NAN;
    175     fits->stdev = NAN;
    176     fits->stdevBits = 4;
    177     fits->stdevNum = 5.0;
    178 
    179     psMemSetDeallocator(fits,(psFreeFunc)fitsFree);
     166
     167    fits->options = NULL;
    180168
    181169    return fits;
     170}
     171
     172
     173static void fitsOptionsFree(psFitsOptions *options)
     174{
     175    psFree(options->extword);
     176}
     177
     178
     179psFitsOptions *psFitsOptionsAlloc(void)
     180{
     181    psFitsOptions *options = psAlloc(sizeof(psFitsOptions)); // Options, to return
     182    psMemSetDeallocator(options, (psFreeFunc)fitsOptionsFree);
     183
     184    options->extword = NULL;
     185
     186    options->conventions.compression = true;
     187    options->conventions.psBitpix = true;
     188
     189    options->floatType = PS_FITS_FLOAT_NONE;
     190
     191    options->bitpix = 0;
     192
     193    options->scaling = PS_FITS_SCALE_NONE;
     194    options->fuzz = true;
     195    options->bscale = 1.0;
     196    options->bzero = 0.0;
     197    options->mean = NAN;
     198    options->stdev = NAN;
     199    options->stdevBits = 4;
     200    options->stdevNum = 5.0;
     201
     202    return options;
    182203}
    183204
     
    237258}
    238259
    239 bool psFitsSetExtnameWord (psFits *fits, const char *extword)
     260bool psFitsSetExtnameWord(psFits *fits, const char *extword)
    240261{
    241262    PS_ASSERT_PTR_NON_NULL(fits,    false);
    242263    PS_ASSERT_PTR_NON_NULL(extword, false);
    243264
    244     psFree (fits->extword);
    245     fits->extword = psStringCopy (extword);
     265    if (!fits->options) {
     266        fits->options = psFitsOptionsAlloc();
     267    }
     268
     269    psFree(fits->options->extword);
     270    fits->options->extword = psStringCopy(extword);
    246271    return true;
    247272}
     
    261286    int status = 0;
    262287
    263     if (!fits->conventions.compression && !fits->extword) {
     288    psFitsOptions *options = fits->options; // FITS options
     289    if (options && !options->conventions.compression && !options->extword) {
    264290        // User wants to use cfitsio.  Good luck to them!
    265291        if (fits_movnam_hdu(fits->fd, ANY_HDU, (char*)extname, 0, &status) != 0) {
     
    270296    }
    271297
    272     bool ignoreCI = (fits->conventions.compression &&
     298    bool ignoreCI = (options->conventions.compression &&
    273299                     (strcmp(extname, "COMPRESSED_IMAGE") != 0)); // Ignore COMPRESSED_IMAGE extension name?
    274     char *extword = (fits->extword ? fits->extword : "EXTNAME"); // Word to use as extension name
     300    char *extword = (options->extword ? options->extword : "EXTNAME"); // Word to use as extension name
    275301
    276302#if 0
     
    375401    char name[MAX_STRING_LENGTH];
    376402
    377     char *extword = (fits->extword == NULL) ? defaultExtword : fits->extword;
     403    psFitsOptions *options = fits->options; // FITS options
     404    char *extword = (!options || !options->extword) ? defaultExtword : options->extword;
    378405
    379406    if (fits_read_key_str(fits->fd, extword, name, NULL, &status) != 0) {
    380         psError(PS_ERR_BAD_PARAMETER_NULL, true,
    381                 _("Header keyword %s is not found"), extword);
     407        psError(PS_ERR_BAD_PARAMETER_NULL, true, _("Header keyword %s is not found"), extword);
    382408        return NULL;
    383409    }
     
    392418    int status = 0;
    393419
    394     char *extword = (fits->extword == NULL) ? defaultExtword : fits->extword;
     420    psFitsOptions *options = fits->options; // FITS options
     421    char *extword = (!options || !options->extword) ? defaultExtword : options->extword;
    395422
    396423    if (fits_update_key_str(fits->fd, extword, (char*)name, NULL, &status) != 0) {
    397424        char fitsErr[MAX_STRING_LENGTH];
    398425        (void)fits_get_errstatus(status, fitsErr);
    399         psError(PS_ERR_IO, true,
    400                 _("Could not write data to file. CFITSIO Error: %s"),
    401                 fitsErr);
     426        psError(PS_ERR_IO, true, _("Could not write data to file. CFITSIO Error: %s"), fitsErr);
    402427        return false;
    403428    }
     
    414439
    415440    // move to the specified HDU
    416     if (! psFitsMoveExtNum(fits,extnum,relative) ) {
    417         psError(PS_ERR_BAD_PARAMETER_VALUE, false,
    418                 "Failed to delete HDU #%d",
    419                 extnum);
     441    if (!psFitsMoveExtNum(fits, extnum, relative) ) {
     442        psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Failed to delete HDU #%d", extnum);
    420443        return false;
    421444    }
     
    427450        char fitsErr[MAX_STRING_LENGTH];
    428451        (void)fits_get_errstatus(status, fitsErr);
    429         psError(PS_ERR_IO, true,
    430                 _("Could not write data to file. CFITSIO Error: %s"),
    431                 fitsErr);
     452        psError(PS_ERR_IO, true, _("Could not write data to file. CFITSIO Error: %s"), fitsErr);
    432453        return false;
    433454    }
  • branches/pap_branch_080117/psLib/src/fits/psFits.h

    r16131 r16141  
    44 * @author Robert DeSonia, MHPCC
    55 *
    6  * @version $Revision: 1.35.2.2 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2008-01-18 03:37:50 $
     6 * @version $Revision: 1.35.2.3 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2008-01-19 01:04:13 $
    88 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    99 */
     
    4343} psFitsCompressionType;
    4444
    45 /// FITS scaling: how to set BSCALE and BZERO
     45/// FITS scaling method: how to set BSCALE and BZERO
    4646typedef enum {
    4747    PS_FITS_SCALE_NONE,                 ///< No auto-scaling to be applied (BSCALE = 1, BZERO = 0)
     
    5353} psFitsScaling;
    5454
    55 /** FITS file object.
    56  *
    57  *  This object should be considered opaque to the user; no item in this
    58  *  struct should be accessed directly.
    59  *
    60  */
     55/// Options for FITS I/O
    6156typedef struct {
    62     fitsfile* fd;                       ///< the CFITSIO fits files handle.
    63     bool writable;                      ///< Is the file writable?
    6457    char *extword;                      ///< user-specified word to name extensions (NULL implies EXTNAME)
    6558    struct {
     
    7265    psFitsScaling scaling;              ///< Scaling scheme to use when quantising floating-point values
    7366    bool fuzz;                          ///< Fuzz the values when quantising floating-point values?
    74     double bscale, bzero;               ///< Manually specified BSCALE and BZERO (SCALE_MANUAL)
     67    double bscale, bzero;               ///< Manually specified BSCALE and BZERO (for SCALE_MANUAL)
    7568    double mean, stdev;                 ///< Mean and standard deviation of image
    76     int stdevBits;                      ///< Number of bits to sample a standard deviation (SCALE_STDEV)
     69    int stdevBits;                      ///< Number of bits to sample a standard deviation (for SCALE_STDEV_*)
    7770    float stdevNum;                     ///< Number of standard deviations to pad off the edge
     71} psFitsOptions;
     72
     73
     74/// FITS file
     75typedef struct {
     76    fitsfile* fd;                       ///< the CFITSIO fits files handle.
     77    bool writable;                      ///< Is the file writable?
     78    psFitsOptions *options;             ///< Options for FITS I/O, or NULL
    7879} psFits;
     80
    7981
    8082/** FITS compression settings. */
     
    154156);
    155157
     158/// Allocator for options
     159psFitsOptions *psFitsOptionsAlloc(void);
     160
    156161/** Enables/configures FITS compression.
    157162 *
  • branches/pap_branch_080117/psLib/src/fits/psFitsFloatFile.c

    r15630 r16141  
    4444    PS_ASSERT_FITS_NON_NULL(fits, PS_FITS_FLOAT_NONE);
    4545
    46     if (!fits->conventions.psBitpix) {
     46    psFitsOptions *options = fits->options; // FITS I/O options
     47
     48    if (!options || !options->conventions.psBitpix) {
    4749        return PS_FITS_FLOAT_NONE;
    4850    }
  • branches/pap_branch_080117/psLib/src/fits/psFitsHeader.c

    r15630 r16141  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2007-11-16 01:04:56 $
     9 *  @version $Revision: 1.38.2.1 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2008-01-19 01:04:13 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    112112    PS_ASSERT_FITS_NON_NULL(fits, false);
    113113
    114     if (!fits->conventions.compression) {
     114    if (fits->options && !fits->options->conventions.compression) {
    115115        // User has turned off compression conventions; doesn't want any nasty surprises
    116116        return false;
     
    220220
    221221    bool compressed = false;            // Is this a compressed image?
    222     if (fits->conventions.compression && fits_is_compressed_image(fits->fd, &status)) {
     222    if ((!fits->options || fits->options->conventions.compression) &&
     223        fits_is_compressed_image(fits->fd, &status)) {
    223224        compressed = true;
    224225    }
  • branches/pap_branch_080117/psLib/src/fits/psFitsImage.c

    r16127 r16141  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.23.2.3 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2008-01-18 02:41:43 $
     9 *  @version $Revision: 1.23.2.4 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2008-01-19 01:04:13 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    263263    *floatType = PS_FITS_FLOAT_NONE;
    264264
     265    psFitsOptions *options = fits->options;
     266    if (!options) {
     267        return psMemIncrRefCounter((psImage*)image); // Casting away const
     268    }
     269
    265270    // Custom floating-point
    266     if (PS_IS_PSELEMTYPE_REAL(image->type.type) && fits->conventions.psBitpix &&
    267         fits->floatType != PS_FITS_FLOAT_NONE) {
    268         *floatType = fits->floatType;
    269         return psFitsFloatImageToDisk(image, fits->floatType);
     271    if (PS_IS_PSELEMTYPE_REAL(image->type.type) && options->conventions.psBitpix &&
     272        options->floatType != PS_FITS_FLOAT_NONE) {
     273        *floatType = options->floatType;
     274        return psFitsFloatImageToDisk(image, options->floatType);
    270275    }
    271276
    272277    // Automatically select what we're given
    273     if (fits->bitpix == 0) {
     278    if (options->bitpix == 0) {
    274279        return psMemIncrRefCounter((psImage*)image); // Casting away const
    275280    }
    276281
    277282    // Quantise floating-point images
    278     if (PS_IS_PSELEMTYPE_REAL(image->type.type) && fits->bitpix > 0) {
     283    if (PS_IS_PSELEMTYPE_REAL(image->type.type) && options->bitpix > 0) {
    279284        if (newScaleZero) {
    280285            // Choose an appropriate BSCALE and BZERO
     
    303308        }
    304309
    305         return psFitsScaleForDisk(image, fits->bitpix, *bscale, *bzero, fits->fuzz, rng);
     310        return psFitsScaleForDisk(image, fits, *bscale, *bzero, rng);
    306311    }
    307312
     
    320325    psElemType inType = image->type.type; // Type for input image
    321326    psElemType outType;                 // Type for output image
    322     switch (fits->bitpix) {
     327    switch (options->bitpix) {
    323328        CONVERT_TYPE_INT_CASE(outType, inType, 8);
    324329        CONVERT_TYPE_INT_CASE(outType, inType, 16);
     
    329334      default:
    330335        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Target bitpix (%d) is not one of 8,16,32,64",
    331                 fits->bitpix);
     336                options->bitpix);
    332337        return NULL;
    333338    }
     
    514519        bzero = cfitsioBzero;
    515520    }
    516     assert(bitPix == fits->bitpix || fits->bitpix == 0);
     521    psFitsOptions *options = fits->options; // FITS I/O options
     522    assert(!options || bitPix == options->bitpix || options->bitpix == 0);
    517523
    518524    int naxis = 3;                      // Number of axes
     
    644650        bzero = cfitsioBzero;
    645651    }
    646     assert(bitPix == fits->bitpix || fits->bitpix == 0);
     652    psFitsOptions *options = fits->options; // FITS I/O options
     653    assert(!options || bitPix == options->bitpix || options->bitpix == 0);
    647654
    648655    //check to see if the HDU has the same datatype
  • branches/pap_branch_080117/psLib/src/fits/psFitsScale.c

    r16131 r16141  
    55#include <stdio.h>
    66#include <assert.h>
     7#include <string.h>
    78
    89#include "psAbort.h"
     
    2122
    2223// Remember:
    23 // TRUE(MEMORY) = BZERO + BSCALE * FITS(DISK)
     24// TRUE(i.e., value in memory) = BZERO + BSCALE * FITS(i.e., value on disk)
    2425
    2526
     
    3637                       double *bzero, // Zero point, to return
    3738                       const psImage *image, // Image to scale
    38                        const psFits *fits // FITS options
     39                       const psFitsOptions *options // FITS options
    3940    )
    4041{
     
    4243    assert(bzero);
    4344    assert(image);
    44     assert(fits);
    45 
    46     double range = pow(2.0, fits->bitpix); // Range of values for target BITPIX
     45    assert(options);
     46
     47    double range = pow(2.0, options->bitpix); // Range of values for target BITPIX
    4748    double min = INFINITY, max = -INFINITY; // Minimum and maximum values
    4849    int numCols = image->numCols, numRows = image->numRows; // Size of image
     
    9697                       double *bzero, // Zero point, to return
    9798                       const psImage *image, // Image to scale
    98                        const psFits *fits // FITS options
     99                       const psFitsOptions *options // FITS options
    99100    )
    100101{
     
    102103    assert(bzero);
    103104    assert(image);
    104     assert(fits);
    105 
    106     double mean = fits->mean, stdev = fits->stdev; // Mean and standard deviation
     105    assert(options);
     106
     107    double mean = options->mean, stdev = options->stdev; // Mean and standard deviation
    107108    if (!isfinite(mean) || !isfinite(stdev)) {
    108109        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     
    112113    }
    113114
    114     long range = 1 << fits->stdevBits;  // Range of values to carry standard deviation
     115    long range = 1 << options->stdevBits;  // Range of values to carry standard deviation
    115116    *bscale = stdev / (double) range;
    116117
    117     int bitpix = fits->bitpix;          // Bits per pixel
    118118    double imageVal;                    // Value on image
    119119    long diskVal;                       // Corresponding value on disk
    120     switch (fits->scaling) {
     120    switch (options->scaling) {
    121121      case PS_FITS_SCALE_STDEV_POSITIVE:
    122122        // Put (mean - N sigma) at the lowest possible value: predominantly positive images
    123         imageVal = mean - fits->stdevNum * stdev;
    124         diskVal = - (1 << (bitpix - 1));
     123        imageVal = mean - options->stdevNum * stdev;
     124        diskVal = - (1 << (options->bitpix - 1));
    125125        break;
    126126      case PS_FITS_SCALE_STDEV_NEGATIVE:
    127127        // Put (mean + N sigma) at the highest possible value: predominantly negative images
    128         imageVal = mean + fits->stdevNum * stdev;
    129         diskVal = (1 << (bitpix - 1)) - 1;
     128        imageVal = mean + options->stdevNum * stdev;
     129        diskVal = (1 << (options->bitpix - 1)) - 1;
    130130        break;
    131131      case PS_FITS_SCALE_STDEV_BOTH:
     
    165165    // If we don't have a RNG, we will allocate one
    166166
    167     if (fits->scaling != PS_FITS_SCALE_STDEV_POSITIVE &&
    168         fits->scaling != PS_FITS_SCALE_STDEV_NEGATIVE &&
    169         fits->scaling != PS_FITS_SCALE_STDEV_BOTH) {
     167    psFitsOptions *options = fits->options; // FITS options
     168    if (!options) {
     169        // No scaling desired
     170        return true;
     171    }
     172
     173    if (options->scaling != PS_FITS_SCALE_STDEV_POSITIVE &&
     174        options->scaling != PS_FITS_SCALE_STDEV_NEGATIVE &&
     175        options->scaling != PS_FITS_SCALE_STDEV_BOTH) {
    170176        // No need to do anything
    171177        return true;
     
    186192    psFree(rng);
    187193
    188     fits->mean = psStatsGetValue(stats, MEAN_STAT); // Mean
    189     fits->stdev = psStatsGetValue(stats, STDEV_STAT); // Standard deviation
     194    options->mean = psStatsGetValue(stats, MEAN_STAT); // Mean
     195    options->stdev = psStatsGetValue(stats, STDEV_STAT); // Standard deviation
    190196    psFree(stats);
    191197
     
    208214    *bzero = 0.0;
    209215
    210     if (!PS_IS_PSELEMTYPE_REAL(image->type.type)) {
     216    psFitsOptions *options = fits->options; // FITS options
     217    if (!PS_IS_PSELEMTYPE_REAL(image->type.type) || !options) {
    211218        return true;
    212219    }
    213220
    214     switch (fits->bitpix) {
     221    switch (options->bitpix) {
    215222      case 0:
    216223        // No scaling applied
     
    224231      default:
    225232        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Target bitpix (%d) is not one of 0,8,16,32,64",
    226                 fits->bitpix);
     233                options->bitpix);
    227234        return false;
    228235    }
    229236
    230     switch (fits->scaling) {
     237    switch (options->scaling) {
    231238      case PS_FITS_SCALE_NONE:
    232239        // No scaling applied
    233240        break;
    234241      case PS_FITS_SCALE_RANGE:
    235         if (!scaleRange(bscale, bzero, image, fits)) {
     242        if (!scaleRange(bscale, bzero, image, options)) {
    236243            psError(PS_ERR_UNKNOWN, false, "Unable to set BSCALE and BZERO from range");
    237244            return false;
     
    241248      case PS_FITS_SCALE_STDEV_NEGATIVE:
    242249      case PS_FITS_SCALE_STDEV_BOTH:
    243         if (!scaleStdev(bscale, bzero, image, fits)) {
     250        if (!scaleStdev(bscale, bzero, image, options)) {
    244251            psError(PS_ERR_UNKNOWN, false, "Unable to set BSCALE and BZERO from stdev");
    245252            return false;
     
    247254        break;
    248255      case PS_FITS_SCALE_MANUAL:
    249         *bscale = fits->bscale;
    250         *bzero = fits->bzero;
    251         break;
    252       default:
    253         psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unrecognised FITS scaling option: %x", fits->scaling);
     256        *bscale = options->bscale;
     257        *bzero = options->bzero;
     258        break;
     259      default:
     260        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unrecognised FITS scaling method: %x",
     261                options->scaling);
    254262        return false;
    255263    }
     
    260268
    261269
    262 psImage *psFitsScaleForDisk(const psImage *image, int bitpix, double bscale, double bzero, bool fuzz,
     270psImage *psFitsScaleForDisk(const psImage *image, const psFits *fits, double bscale, double bzero,
    263271                            psRandom *rng)
    264272{
    265273    PS_ASSERT_IMAGE_NON_NULL(image, NULL);
    266 
    267     if (!PS_IS_PSELEMTYPE_REAL(image->type.type) || bitpix == 0) {
     274    PS_ASSERT_FITS_NON_NULL(fits, NULL);
     275
     276    psFitsOptions *options = fits->options; // FITS options
     277    if (!PS_IS_PSELEMTYPE_REAL(image->type.type) || !options || options->bitpix == 0) {
     278        // No scaling desired
    268279        return psMemIncrRefCounter((psImage*)image); // Casting away "const"
    269280    }
    270281
     282    int bitpix = options->bitpix;       // Bits per pixel
    271283    psElemType outType;                 // Type for output image
    272284    // Choosing to use signed types because those don't require BSCALE,BZERO to represent them in the FITS
     
    290302    }
    291303
    292     if (bscale == 1.0 && bzero == 0.0) {
     304    if (bscale == 1.0 && bzero == 0.0 && !options->fuzz) {
    293305        return psImageCopy(NULL, image, outType);
    294306    }
     
    297309    psImage *out = psImageAlloc(numCols, numRows, outType); // Output image
    298310
    299     if (!psMemIncrRefCounter(rng) && fuzz) {
     311    if (!psMemIncrRefCounter(rng) && options->fuzz) {
    300312        // Don't blab about which seed we're going to get --- it's not necessary for this purpose
    301313        psU64 seed = p_psRandomGetSystemSeed(false);
     
    307319        ps##INTYPE scale = 1.0 / bscale; \
    308320        ps##INTYPE zero = bzero; \
    309         if (fuzz) { \
     321        if (options->fuzz) { \
    310322            /* Add random factor [0,1): adds a variance of 1/12, but preserves the expectation value */ \
    311323            for (int y = 0; y < numRows; y++) { \
     
    435447}
    436448#endif
     449
     450
     451
     452psFitsScaling psFitsScalingFromString(const char *string)
     453{
     454    PS_ASSERT_STRING_NON_EMPTY(string, PS_FITS_SCALE_NONE);
     455
     456    if (strcasecmp(string, "RANGE") == 0)          return PS_FITS_SCALE_RANGE;
     457    if (strcasecmp(string, "STDEV_POSITIVE") == 0) return PS_FITS_SCALE_STDEV_POSITIVE;
     458    if (strcasecmp(string, "STDEV_NEGATIVE") == 0) return PS_FITS_SCALE_STDEV_NEGATIVE;
     459    if (strcasecmp(string, "STDEV_BOTH") == 0)     return PS_FITS_SCALE_STDEV_BOTH;
     460    if (strcasecmp(string, "MANUAL") == 0)         return PS_FITS_SCALE_MANUAL;
     461
     462    psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unable to interpret FITS scaling: %s", string);
     463    return PS_FITS_SCALE_NONE;
     464}
     465
     466
  • branches/pap_branch_080117/psLib/src/fits/psFitsScale.h

    r16122 r16141  
    1414/// functions.  Therefore, since the other FITS functions don't have the mask, while the user may, it is the
    1515/// user's responsibility to call this function.
    16 bool psFitsScaleMeasure(psFits *fits,   ///< FITS options
     16bool psFitsScaleMeasure(psFits *fits,   ///< FITS file
    1717                        const psImage *image, ///< Image to measure
    1818                        const psImage *mask, ///< Mask image, or NULL
    1919                        psMaskType maskVal, ///< Value to mask
    20                         psRandom *rng // Random number generator, or NULL
     20                        psRandom *rng ///< Random number generator, or NULL
    2121    );
    2222
    2323/// Determine BSCALE and BZERO for an image
    24 bool psFitsScaleDetermine(double *bscale, // Scaling, to return
    25                           double *bzero, // Zero point, to return
    26                           const psImage *image, // Image to scale
    27                           const psFits *fits // FITS options
     24bool psFitsScaleDetermine(double *bscale, ///< Scaling, to return
     25                          double *bzero, ///< Zero point, to return
     26                          const psImage *image, ///< Image to scale
     27                          const psFits *fits ///< FITS options
    2828    );
    2929
     
    3434/// time, and unity 10% of the time), though at the cost of adding an additional variance of 1/12 (a standard
    3535/// deviation of ~0.29).
    36 psImage *psFitsScaleForDisk(const psImage *image, // Image to which to apply BSCALE and BZERO
    37                             int bitpix, // Output BITPIX
    38                             double bscale, // Scaling
    39                             double bzero, // Zero point
    40                             bool fuzz,  // Apply fuzz?
    41                             psRandom *rng // Random number generator (for the "fuzz"), or NULL
     36psImage *psFitsScaleForDisk(const psImage *image, ///< Image to which to apply BSCALE and BZERO
     37                            const psFits *fits, ///< FITS file
     38                            double bscale, ///< Scaling
     39                            double bzero, ///< Zero point
     40                            psRandom *rng ///< Random number generator (for the "fuzz"), or NULL
    4241    );
    4342
     43/// Interpret a string as a scaling method
     44psFitsScaling psFitsScalingFromString(const char *string ///< String to interpret
     45    );
    4446
    4547#endif
Note: See TracChangeset for help on using the changeset viewer.