Index: branches/czw_branch/20101203/psLib/src/fits/psFits.h
===================================================================
--- branches/czw_branch/20101203/psLib/src/fits/psFits.h	(revision 30331)
+++ branches/czw_branch/20101203/psLib/src/fits/psFits.h	(revision 30419)
@@ -50,10 +50,10 @@
     PS_FITS_SCALE_STDEV_NEGATIVE,       ///< Auto-scale to sample stdev, place mean at upper limit
     PS_FITS_SCALE_STDEV_BOTH,           ///< Auto-scale to sample stdev, place mean at middle
+    PS_FITS_SCALE_MANUAL,                ///< Manual scaling (use specified BSCALE and BZERO)
     PS_FITS_SCALE_LOG_RANGE,            ///< Take logarithm, Auto-scale to preserve dynamic range
     PS_FITS_SCALE_LOG_STDEV_POSITIVE,   ///< Take logarithm, Auto-scale to sample stdev, place mean at lower limit
     PS_FITS_SCALE_LOG_STDEV_NEGATIVE,   ///< Take logarithm, Auto-scale to sample stdev, place mean at upper limit
     PS_FITS_SCALE_LOG_STDEV_BOTH,       ///< Take logarithm, Auto-scale to sample stdev, place mean at middle
-
-    PS_FITS_SCALE_MANUAL                ///< Manual scaling (use specified BSCALE and BZERO)
+    PS_FITS_SCALE_LOG_MANUAL            ///< Manual scaling (use specified BSCALE, BZERO, and BOFFSET)
 } psFitsScaling;
 
@@ -71,4 +71,5 @@
     bool fuzz;                          ///< Fuzz the values when quantising floating-point values?
     double bscale, bzero;               ///< Manually specified BSCALE and BZERO (for SCALE_MANUAL)
+    double boffset;                     ///< Manually specified BOFFSET (for SCALE_MANUAL)
     double mean, stdev;                 ///< Mean and standard deviation of image
     int stdevBits;                      ///< Number of bits to sample a standard deviation (for SCALE_STDEV_*)
Index: branches/czw_branch/20101203/psLib/src/fits/psFitsImage.c
===================================================================
--- branches/czw_branch/20101203/psLib/src/fits/psFitsImage.c	(revision 30331)
+++ branches/czw_branch/20101203/psLib/src/fits/psFitsImage.c	(revision 30419)
@@ -692,4 +692,5 @@
     // Remove any BOFFSET values that exist in the header if we are not using that scaling anymore
     if (options&&(!((options->scaling == PS_FITS_SCALE_LOG_RANGE)||
+		    (options->scaling == PS_FITS_SCALE_LOG_MANUAL)||
 		   (options->scaling == PS_FITS_SCALE_LOG_STDEV_POSITIVE)||
 		   (options->scaling == PS_FITS_SCALE_LOG_STDEV_NEGATIVE)||
@@ -718,4 +719,5 @@
                            "Scaling: TRUE = BZERO + BSCALE * DISK", &status);
 	if (options&&(((options->scaling == PS_FITS_SCALE_LOG_RANGE)||
+		       (options->scaling == PS_FITS_SCALE_LOG_MANUAL)||
 		       (options->scaling == PS_FITS_SCALE_LOG_STDEV_POSITIVE)||
 		       (options->scaling == PS_FITS_SCALE_LOG_STDEV_NEGATIVE)||
Index: branches/czw_branch/20101203/psLib/src/fits/psFitsScale.c
===================================================================
--- branches/czw_branch/20101203/psLib/src/fits/psFitsScale.c	(revision 30331)
+++ branches/czw_branch/20101203/psLib/src/fits/psFitsScale.c	(revision 30419)
@@ -539,4 +539,9 @@
         *bzero = options->bzero;
         break;
+      case PS_FITS_SCALE_LOG_MANUAL:
+        *bscale = options->bscale;
+        *bzero = options->bzero;
+	*boffset = options->boffset;
+        break;
       default:
         psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unrecognised FITS scaling method: %x",
@@ -616,4 +621,5 @@
 	      ps##INTYPE value; \
 	      if ((options->scaling == PS_FITS_SCALE_LOG_RANGE)||	\
+		(options->scaling == PS_FITS_SCALE_LOG_MANUAL)||        \
 		  (options->scaling == PS_FITS_SCALE_LOG_STDEV_POSITIVE)|| \
 		  (options->scaling == PS_FITS_SCALE_LOG_STDEV_NEGATIVE)|| \
@@ -756,4 +762,5 @@
     if (strcasecmp(string, "STDEV_BOTH") == 0)     return PS_FITS_SCALE_STDEV_BOTH;
     if (strcasecmp(string, "LOG_RANGE") == 0)      return PS_FITS_SCALE_LOG_RANGE;
+    if (strcasecmp(string, "LOG_MANUAL") == 0)      return PS_FITS_SCALE_LOG_MANUAL;
     if (strcasecmp(string, "LOG_STDEV_POSITIVE") == 0) return PS_FITS_SCALE_LOG_STDEV_POSITIVE;
     if (strcasecmp(string, "LOG_STDEV_NEGATIVE") == 0) return PS_FITS_SCALE_LOG_STDEV_NEGATIVE;
