Index: /branches/pap_branch_080117/psLib/src/fits/psFits.c
===================================================================
--- /branches/pap_branch_080117/psLib/src/fits/psFits.c	(revision 16140)
+++ /branches/pap_branch_080117/psLib/src/fits/psFits.c	(revision 16141)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.76.2.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-01-18 03:37:50 $
+ *  @version $Revision: 1.76.2.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-01-19 01:04:13 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -78,5 +78,5 @@
         fitsClose(fits);
     }
-    psFree (fits->extword);
+    psFree(fits->options);
 }
 
@@ -160,24 +160,45 @@
 
     psFits* fits = psAlloc(sizeof(psFits));
+    psMemSetDeallocator(fits, (psFreeFunc)fitsFree);
+
     fits->fd = fptr;
     fits->writable = (iomode == READWRITE);
-    fits->extword = NULL;
-    fits->conventions.compression = true;
-    fits->conventions.psBitpix = true;
-
-    fits->floatType = PS_FITS_FLOAT_NONE;
-    fits->bitpix = 0;
-    fits->scaling = PS_FITS_SCALE_NONE;
-    fits->fuzz = true;
-    fits->bscale = 1.0;
-    fits->bzero = 0.0;
-    fits->mean = NAN;
-    fits->stdev = NAN;
-    fits->stdevBits = 4;
-    fits->stdevNum = 5.0;
-
-    psMemSetDeallocator(fits,(psFreeFunc)fitsFree);
+
+    fits->options = NULL;
 
     return fits;
+}
+
+
+static void fitsOptionsFree(psFitsOptions *options)
+{
+    psFree(options->extword);
+}
+
+
+psFitsOptions *psFitsOptionsAlloc(void)
+{
+    psFitsOptions *options = psAlloc(sizeof(psFitsOptions)); // Options, to return
+    psMemSetDeallocator(options, (psFreeFunc)fitsOptionsFree);
+
+    options->extword = NULL;
+
+    options->conventions.compression = true;
+    options->conventions.psBitpix = true;
+
+    options->floatType = PS_FITS_FLOAT_NONE;
+
+    options->bitpix = 0;
+
+    options->scaling = PS_FITS_SCALE_NONE;
+    options->fuzz = true;
+    options->bscale = 1.0;
+    options->bzero = 0.0;
+    options->mean = NAN;
+    options->stdev = NAN;
+    options->stdevBits = 4;
+    options->stdevNum = 5.0;
+
+    return options;
 }
 
@@ -237,11 +258,15 @@
 }
 
-bool psFitsSetExtnameWord (psFits *fits, const char *extword)
+bool psFitsSetExtnameWord(psFits *fits, const char *extword)
 {
     PS_ASSERT_PTR_NON_NULL(fits,    false);
     PS_ASSERT_PTR_NON_NULL(extword, false);
 
-    psFree (fits->extword);
-    fits->extword = psStringCopy (extword);
+    if (!fits->options) {
+        fits->options = psFitsOptionsAlloc();
+    }
+
+    psFree(fits->options->extword);
+    fits->options->extword = psStringCopy(extword);
     return true;
 }
@@ -261,5 +286,6 @@
     int status = 0;
 
-    if (!fits->conventions.compression && !fits->extword) {
+    psFitsOptions *options = fits->options; // FITS options
+    if (options && !options->conventions.compression && !options->extword) {
         // User wants to use cfitsio.  Good luck to them!
         if (fits_movnam_hdu(fits->fd, ANY_HDU, (char*)extname, 0, &status) != 0) {
@@ -270,7 +296,7 @@
     }
 
-    bool ignoreCI = (fits->conventions.compression &&
+    bool ignoreCI = (options->conventions.compression &&
                      (strcmp(extname, "COMPRESSED_IMAGE") != 0)); // Ignore COMPRESSED_IMAGE extension name?
-    char *extword = (fits->extword ? fits->extword : "EXTNAME"); // Word to use as extension name
+    char *extword = (options->extword ? options->extword : "EXTNAME"); // Word to use as extension name
 
 #if 0
@@ -375,9 +401,9 @@
     char name[MAX_STRING_LENGTH];
 
-    char *extword = (fits->extword == NULL) ? defaultExtword : fits->extword;
+    psFitsOptions *options = fits->options; // FITS options
+    char *extword = (!options || !options->extword) ? defaultExtword : options->extword;
 
     if (fits_read_key_str(fits->fd, extword, name, NULL, &status) != 0) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, true,
-                _("Header keyword %s is not found"), extword);
+        psError(PS_ERR_BAD_PARAMETER_NULL, true, _("Header keyword %s is not found"), extword);
         return NULL;
     }
@@ -392,12 +418,11 @@
     int status = 0;
 
-    char *extword = (fits->extword == NULL) ? defaultExtword : fits->extword;
+    psFitsOptions *options = fits->options; // FITS options
+    char *extword = (!options || !options->extword) ? defaultExtword : options->extword;
 
     if (fits_update_key_str(fits->fd, extword, (char*)name, NULL, &status) != 0) {
         char fitsErr[MAX_STRING_LENGTH];
         (void)fits_get_errstatus(status, fitsErr);
-        psError(PS_ERR_IO, true,
-                _("Could not write data to file. CFITSIO Error: %s"),
-                fitsErr);
+        psError(PS_ERR_IO, true, _("Could not write data to file. CFITSIO Error: %s"), fitsErr);
         return false;
     }
@@ -414,8 +439,6 @@
 
     // move to the specified HDU
-    if (! psFitsMoveExtNum(fits,extnum,relative) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "Failed to delete HDU #%d",
-                extnum);
+    if (!psFitsMoveExtNum(fits, extnum, relative) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Failed to delete HDU #%d", extnum);
         return false;
     }
@@ -427,7 +450,5 @@
         char fitsErr[MAX_STRING_LENGTH];
         (void)fits_get_errstatus(status, fitsErr);
-        psError(PS_ERR_IO, true,
-                _("Could not write data to file. CFITSIO Error: %s"),
-                fitsErr);
+        psError(PS_ERR_IO, true, _("Could not write data to file. CFITSIO Error: %s"), fitsErr);
         return false;
     }
Index: /branches/pap_branch_080117/psLib/src/fits/psFits.h
===================================================================
--- /branches/pap_branch_080117/psLib/src/fits/psFits.h	(revision 16140)
+++ /branches/pap_branch_080117/psLib/src/fits/psFits.h	(revision 16141)
@@ -4,6 +4,6 @@
  * @author Robert DeSonia, MHPCC
  *
- * @version $Revision: 1.35.2.2 $ $Name: not supported by cvs2svn $
- * @date $Date: 2008-01-18 03:37:50 $
+ * @version $Revision: 1.35.2.3 $ $Name: not supported by cvs2svn $
+ * @date $Date: 2008-01-19 01:04:13 $
  * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
  */
@@ -43,5 +43,5 @@
 } psFitsCompressionType;
 
-/// FITS scaling: how to set BSCALE and BZERO
+/// FITS scaling method: how to set BSCALE and BZERO
 typedef enum {
     PS_FITS_SCALE_NONE,                 ///< No auto-scaling to be applied (BSCALE = 1, BZERO = 0)
@@ -53,13 +53,6 @@
 } psFitsScaling;
 
-/** FITS file object.
- *
- *  This object should be considered opaque to the user; no item in this
- *  struct should be accessed directly.
- *
- */
+/// Options for FITS I/O
 typedef struct {
-    fitsfile* fd;                       ///< the CFITSIO fits files handle.
-    bool writable;                      ///< Is the file writable?
     char *extword;                      ///< user-specified word to name extensions (NULL implies EXTNAME)
     struct {
@@ -72,9 +65,18 @@
     psFitsScaling scaling;              ///< Scaling scheme to use when quantising floating-point values
     bool fuzz;                          ///< Fuzz the values when quantising floating-point values?
-    double bscale, bzero;               ///< Manually specified BSCALE and BZERO (SCALE_MANUAL)
+    double bscale, bzero;               ///< Manually specified BSCALE and BZERO (for SCALE_MANUAL)
     double mean, stdev;                 ///< Mean and standard deviation of image
-    int stdevBits;                      ///< Number of bits to sample a standard deviation (SCALE_STDEV)
+    int stdevBits;                      ///< Number of bits to sample a standard deviation (for SCALE_STDEV_*)
     float stdevNum;                     ///< Number of standard deviations to pad off the edge
+} psFitsOptions;
+
+
+/// FITS file
+typedef struct {
+    fitsfile* fd;                       ///< the CFITSIO fits files handle.
+    bool writable;                      ///< Is the file writable?
+    psFitsOptions *options;             ///< Options for FITS I/O, or NULL
 } psFits;
+
 
 /** FITS compression settings. */
@@ -154,4 +156,7 @@
 );
 
+/// Allocator for options
+psFitsOptions *psFitsOptionsAlloc(void);
+
 /** Enables/configures FITS compression.
  *
Index: /branches/pap_branch_080117/psLib/src/fits/psFitsFloatFile.c
===================================================================
--- /branches/pap_branch_080117/psLib/src/fits/psFitsFloatFile.c	(revision 16140)
+++ /branches/pap_branch_080117/psLib/src/fits/psFitsFloatFile.c	(revision 16141)
@@ -44,5 +44,7 @@
     PS_ASSERT_FITS_NON_NULL(fits, PS_FITS_FLOAT_NONE);
 
-    if (!fits->conventions.psBitpix) {
+    psFitsOptions *options = fits->options; // FITS I/O options
+
+    if (!options || !options->conventions.psBitpix) {
         return PS_FITS_FLOAT_NONE;
     }
Index: /branches/pap_branch_080117/psLib/src/fits/psFitsHeader.c
===================================================================
--- /branches/pap_branch_080117/psLib/src/fits/psFitsHeader.c	(revision 16140)
+++ /branches/pap_branch_080117/psLib/src/fits/psFitsHeader.c	(revision 16141)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-11-16 01:04:56 $
+ *  @version $Revision: 1.38.2.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-01-19 01:04:13 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -112,5 +112,5 @@
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    if (!fits->conventions.compression) {
+    if (fits->options && !fits->options->conventions.compression) {
         // User has turned off compression conventions; doesn't want any nasty surprises
         return false;
@@ -220,5 +220,6 @@
 
     bool compressed = false;            // Is this a compressed image?
-    if (fits->conventions.compression && fits_is_compressed_image(fits->fd, &status)) {
+    if ((!fits->options || fits->options->conventions.compression) &&
+        fits_is_compressed_image(fits->fd, &status)) {
         compressed = true;
     }
Index: /branches/pap_branch_080117/psLib/src/fits/psFitsImage.c
===================================================================
--- /branches/pap_branch_080117/psLib/src/fits/psFitsImage.c	(revision 16140)
+++ /branches/pap_branch_080117/psLib/src/fits/psFitsImage.c	(revision 16141)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.23.2.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-01-18 02:41:43 $
+ *  @version $Revision: 1.23.2.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-01-19 01:04:13 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -263,18 +263,23 @@
     *floatType = PS_FITS_FLOAT_NONE;
 
+    psFitsOptions *options = fits->options;
+    if (!options) {
+        return psMemIncrRefCounter((psImage*)image); // Casting away const
+    }
+
     // Custom floating-point
-    if (PS_IS_PSELEMTYPE_REAL(image->type.type) && fits->conventions.psBitpix &&
-        fits->floatType != PS_FITS_FLOAT_NONE) {
-        *floatType = fits->floatType;
-        return psFitsFloatImageToDisk(image, fits->floatType);
+    if (PS_IS_PSELEMTYPE_REAL(image->type.type) && options->conventions.psBitpix &&
+        options->floatType != PS_FITS_FLOAT_NONE) {
+        *floatType = options->floatType;
+        return psFitsFloatImageToDisk(image, options->floatType);
     }
 
     // Automatically select what we're given
-    if (fits->bitpix == 0) {
+    if (options->bitpix == 0) {
         return psMemIncrRefCounter((psImage*)image); // Casting away const
     }
 
     // Quantise floating-point images
-    if (PS_IS_PSELEMTYPE_REAL(image->type.type) && fits->bitpix > 0) {
+    if (PS_IS_PSELEMTYPE_REAL(image->type.type) && options->bitpix > 0) {
         if (newScaleZero) {
             // Choose an appropriate BSCALE and BZERO
@@ -303,5 +308,5 @@
         }
 
-        return psFitsScaleForDisk(image, fits->bitpix, *bscale, *bzero, fits->fuzz, rng);
+        return psFitsScaleForDisk(image, fits, *bscale, *bzero, rng);
     }
 
@@ -320,5 +325,5 @@
     psElemType inType = image->type.type; // Type for input image
     psElemType outType;                 // Type for output image
-    switch (fits->bitpix) {
+    switch (options->bitpix) {
         CONVERT_TYPE_INT_CASE(outType, inType, 8);
         CONVERT_TYPE_INT_CASE(outType, inType, 16);
@@ -329,5 +334,5 @@
       default:
         psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Target bitpix (%d) is not one of 8,16,32,64",
-                fits->bitpix);
+                options->bitpix);
         return NULL;
     }
@@ -514,5 +519,6 @@
         bzero = cfitsioBzero;
     }
-    assert(bitPix == fits->bitpix || fits->bitpix == 0);
+    psFitsOptions *options = fits->options; // FITS I/O options
+    assert(!options || bitPix == options->bitpix || options->bitpix == 0);
 
     int naxis = 3;                      // Number of axes
@@ -644,5 +650,6 @@
         bzero = cfitsioBzero;
     }
-    assert(bitPix == fits->bitpix || fits->bitpix == 0);
+    psFitsOptions *options = fits->options; // FITS I/O options
+    assert(!options || bitPix == options->bitpix || options->bitpix == 0);
 
     //check to see if the HDU has the same datatype
Index: /branches/pap_branch_080117/psLib/src/fits/psFitsScale.c
===================================================================
--- /branches/pap_branch_080117/psLib/src/fits/psFitsScale.c	(revision 16140)
+++ /branches/pap_branch_080117/psLib/src/fits/psFitsScale.c	(revision 16141)
@@ -5,4 +5,5 @@
 #include <stdio.h>
 #include <assert.h>
+#include <string.h>
 
 #include "psAbort.h"
@@ -21,5 +22,5 @@
 
 // Remember:
-// TRUE(MEMORY) = BZERO + BSCALE * FITS(DISK)
+// TRUE(i.e., value in memory) = BZERO + BSCALE * FITS(i.e., value on disk)
 
 
@@ -36,5 +37,5 @@
                        double *bzero, // Zero point, to return
                        const psImage *image, // Image to scale
-                       const psFits *fits // FITS options
+                       const psFitsOptions *options // FITS options
     )
 {
@@ -42,7 +43,7 @@
     assert(bzero);
     assert(image);
-    assert(fits);
-
-    double range = pow(2.0, fits->bitpix); // Range of values for target BITPIX
+    assert(options);
+
+    double range = pow(2.0, options->bitpix); // Range of values for target BITPIX
     double min = INFINITY, max = -INFINITY; // Minimum and maximum values
     int numCols = image->numCols, numRows = image->numRows; // Size of image
@@ -96,5 +97,5 @@
                        double *bzero, // Zero point, to return
                        const psImage *image, // Image to scale
-                       const psFits *fits // FITS options
+                       const psFitsOptions *options // FITS options
     )
 {
@@ -102,7 +103,7 @@
     assert(bzero);
     assert(image);
-    assert(fits);
-
-    double mean = fits->mean, stdev = fits->stdev; // Mean and standard deviation
+    assert(options);
+
+    double mean = options->mean, stdev = options->stdev; // Mean and standard deviation
     if (!isfinite(mean) || !isfinite(stdev)) {
         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
@@ -112,20 +113,19 @@
     }
 
-    long range = 1 << fits->stdevBits;  // Range of values to carry standard deviation
+    long range = 1 << options->stdevBits;  // Range of values to carry standard deviation
     *bscale = stdev / (double) range;
 
-    int bitpix = fits->bitpix;          // Bits per pixel
     double imageVal;                    // Value on image
     long diskVal;                       // Corresponding value on disk
-    switch (fits->scaling) {
+    switch (options->scaling) {
       case PS_FITS_SCALE_STDEV_POSITIVE:
         // Put (mean - N sigma) at the lowest possible value: predominantly positive images
-        imageVal = mean - fits->stdevNum * stdev;
-        diskVal = - (1 << (bitpix - 1));
+        imageVal = mean - options->stdevNum * stdev;
+        diskVal = - (1 << (options->bitpix - 1));
         break;
       case PS_FITS_SCALE_STDEV_NEGATIVE:
         // Put (mean + N sigma) at the highest possible value: predominantly negative images
-        imageVal = mean + fits->stdevNum * stdev;
-        diskVal = (1 << (bitpix - 1)) - 1;
+        imageVal = mean + options->stdevNum * stdev;
+        diskVal = (1 << (options->bitpix - 1)) - 1;
         break;
       case PS_FITS_SCALE_STDEV_BOTH:
@@ -165,7 +165,13 @@
     // If we don't have a RNG, we will allocate one
 
-    if (fits->scaling != PS_FITS_SCALE_STDEV_POSITIVE &&
-        fits->scaling != PS_FITS_SCALE_STDEV_NEGATIVE &&
-        fits->scaling != PS_FITS_SCALE_STDEV_BOTH) {
+    psFitsOptions *options = fits->options; // FITS options
+    if (!options) {
+        // No scaling desired
+        return true;
+    }
+
+    if (options->scaling != PS_FITS_SCALE_STDEV_POSITIVE &&
+        options->scaling != PS_FITS_SCALE_STDEV_NEGATIVE &&
+        options->scaling != PS_FITS_SCALE_STDEV_BOTH) {
         // No need to do anything
         return true;
@@ -186,6 +192,6 @@
     psFree(rng);
 
-    fits->mean = psStatsGetValue(stats, MEAN_STAT); // Mean
-    fits->stdev = psStatsGetValue(stats, STDEV_STAT); // Standard deviation
+    options->mean = psStatsGetValue(stats, MEAN_STAT); // Mean
+    options->stdev = psStatsGetValue(stats, STDEV_STAT); // Standard deviation
     psFree(stats);
 
@@ -208,9 +214,10 @@
     *bzero = 0.0;
 
-    if (!PS_IS_PSELEMTYPE_REAL(image->type.type)) {
+    psFitsOptions *options = fits->options; // FITS options
+    if (!PS_IS_PSELEMTYPE_REAL(image->type.type) || !options) {
         return true;
     }
 
-    switch (fits->bitpix) {
+    switch (options->bitpix) {
       case 0:
         // No scaling applied
@@ -224,14 +231,14 @@
       default:
         psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Target bitpix (%d) is not one of 0,8,16,32,64",
-                fits->bitpix);
+                options->bitpix);
         return false;
     }
 
-    switch (fits->scaling) {
+    switch (options->scaling) {
       case PS_FITS_SCALE_NONE:
         // No scaling applied
         break;
       case PS_FITS_SCALE_RANGE:
-        if (!scaleRange(bscale, bzero, image, fits)) {
+        if (!scaleRange(bscale, bzero, image, options)) {
             psError(PS_ERR_UNKNOWN, false, "Unable to set BSCALE and BZERO from range");
             return false;
@@ -241,5 +248,5 @@
       case PS_FITS_SCALE_STDEV_NEGATIVE:
       case PS_FITS_SCALE_STDEV_BOTH:
-        if (!scaleStdev(bscale, bzero, image, fits)) {
+        if (!scaleStdev(bscale, bzero, image, options)) {
             psError(PS_ERR_UNKNOWN, false, "Unable to set BSCALE and BZERO from stdev");
             return false;
@@ -247,9 +254,10 @@
         break;
       case PS_FITS_SCALE_MANUAL:
-        *bscale = fits->bscale;
-        *bzero = fits->bzero;
-        break;
-      default:
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unrecognised FITS scaling option: %x", fits->scaling);
+        *bscale = options->bscale;
+        *bzero = options->bzero;
+        break;
+      default:
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unrecognised FITS scaling method: %x",
+                options->scaling);
         return false;
     }
@@ -260,13 +268,17 @@
 
 
-psImage *psFitsScaleForDisk(const psImage *image, int bitpix, double bscale, double bzero, bool fuzz,
+psImage *psFitsScaleForDisk(const psImage *image, const psFits *fits, double bscale, double bzero,
                             psRandom *rng)
 {
     PS_ASSERT_IMAGE_NON_NULL(image, NULL);
-
-    if (!PS_IS_PSELEMTYPE_REAL(image->type.type) || bitpix == 0) {
+    PS_ASSERT_FITS_NON_NULL(fits, NULL);
+
+    psFitsOptions *options = fits->options; // FITS options
+    if (!PS_IS_PSELEMTYPE_REAL(image->type.type) || !options || options->bitpix == 0) {
+        // No scaling desired
         return psMemIncrRefCounter((psImage*)image); // Casting away "const"
     }
 
+    int bitpix = options->bitpix;       // Bits per pixel
     psElemType outType;                 // Type for output image
     // Choosing to use signed types because those don't require BSCALE,BZERO to represent them in the FITS
@@ -290,5 +302,5 @@
     }
 
-    if (bscale == 1.0 && bzero == 0.0) {
+    if (bscale == 1.0 && bzero == 0.0 && !options->fuzz) {
         return psImageCopy(NULL, image, outType);
     }
@@ -297,5 +309,5 @@
     psImage *out = psImageAlloc(numCols, numRows, outType); // Output image
 
-    if (!psMemIncrRefCounter(rng) && fuzz) {
+    if (!psMemIncrRefCounter(rng) && options->fuzz) {
         // Don't blab about which seed we're going to get --- it's not necessary for this purpose
         psU64 seed = p_psRandomGetSystemSeed(false);
@@ -307,5 +319,5 @@
         ps##INTYPE scale = 1.0 / bscale; \
         ps##INTYPE zero = bzero; \
-        if (fuzz) { \
+        if (options->fuzz) { \
             /* Add random factor [0,1): adds a variance of 1/12, but preserves the expectation value */ \
             for (int y = 0; y < numRows; y++) { \
@@ -435,2 +447,20 @@
 }
 #endif
+
+
+
+psFitsScaling psFitsScalingFromString(const char *string)
+{
+    PS_ASSERT_STRING_NON_EMPTY(string, PS_FITS_SCALE_NONE);
+
+    if (strcasecmp(string, "RANGE") == 0)          return PS_FITS_SCALE_RANGE;
+    if (strcasecmp(string, "STDEV_POSITIVE") == 0) return PS_FITS_SCALE_STDEV_POSITIVE;
+    if (strcasecmp(string, "STDEV_NEGATIVE") == 0) return PS_FITS_SCALE_STDEV_NEGATIVE;
+    if (strcasecmp(string, "STDEV_BOTH") == 0)     return PS_FITS_SCALE_STDEV_BOTH;
+    if (strcasecmp(string, "MANUAL") == 0)         return PS_FITS_SCALE_MANUAL;
+
+    psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unable to interpret FITS scaling: %s", string);
+    return PS_FITS_SCALE_NONE;
+}
+
+
Index: /branches/pap_branch_080117/psLib/src/fits/psFitsScale.h
===================================================================
--- /branches/pap_branch_080117/psLib/src/fits/psFitsScale.h	(revision 16140)
+++ /branches/pap_branch_080117/psLib/src/fits/psFitsScale.h	(revision 16141)
@@ -14,16 +14,16 @@
 /// functions.  Therefore, since the other FITS functions don't have the mask, while the user may, it is the
 /// user's responsibility to call this function.
-bool psFitsScaleMeasure(psFits *fits,   ///< FITS options
+bool psFitsScaleMeasure(psFits *fits,   ///< FITS file
                         const psImage *image, ///< Image to measure
                         const psImage *mask, ///< Mask image, or NULL
                         psMaskType maskVal, ///< Value to mask
-                        psRandom *rng // Random number generator, or NULL
+                        psRandom *rng ///< Random number generator, or NULL
     );
 
 /// Determine BSCALE and BZERO for an image
-bool psFitsScaleDetermine(double *bscale, // Scaling, to return
-                          double *bzero, // Zero point, to return
-                          const psImage *image, // Image to scale
-                          const psFits *fits // FITS options
+bool psFitsScaleDetermine(double *bscale, ///< Scaling, to return
+                          double *bzero, ///< Zero point, to return
+                          const psImage *image, ///< Image to scale
+                          const psFits *fits ///< FITS options
     );
 
@@ -34,12 +34,14 @@
 /// time, and unity 10% of the time), though at the cost of adding an additional variance of 1/12 (a standard
 /// deviation of ~0.29).
-psImage *psFitsScaleForDisk(const psImage *image, // Image to which to apply BSCALE and BZERO
-                            int bitpix, // Output BITPIX
-                            double bscale, // Scaling
-                            double bzero, // Zero point
-                            bool fuzz,  // Apply fuzz?
-                            psRandom *rng // Random number generator (for the "fuzz"), or NULL
+psImage *psFitsScaleForDisk(const psImage *image, ///< Image to which to apply BSCALE and BZERO
+                            const psFits *fits, ///< FITS file
+                            double bscale, ///< Scaling
+                            double bzero, ///< Zero point
+                            psRandom *rng ///< Random number generator (for the "fuzz"), or NULL
     );
 
+/// Interpret a string as a scaling method
+psFitsScaling psFitsScalingFromString(const char *string ///< String to interpret
+    );
 
 #endif
