Index: trunk/psLib/src/fits/psFitsScale.c
===================================================================
--- trunk/psLib/src/fits/psFitsScale.c	(revision 24886)
+++ trunk/psLib/src/fits/psFitsScale.c	(revision 24901)
@@ -46,4 +46,6 @@
     psAssert(image, "impossible");
     psAssert(options, "impossible");
+
+    psTrace("psLib.fits", 3, "Scaling image to preserve dynamic range");
 
     double range = pow(2.0, options->bitpix) - 1.0; // Range of values for target BITPIX, reduced by the BLANK
@@ -109,4 +111,6 @@
     psAssert(options, "impossible");
 
+    psTrace("psLib.fits", 3, "Scaling image by statistics");
+
     // Measure the mean and stdev
     // psImageBackground automatically excludes pixels that are non-finite, so we don't need to bother about a
@@ -131,6 +135,10 @@
     }
 
+    psTrace("psLib.fits", 5, "Mean: %lf Stdev: %lf", mean, stdev);
+
     long range = 1 << options->stdevBits;  // Range of values to carry standard deviation
     *bscale = stdev / (double) range;
+
+    psTrace("psLib.fits", 5, "Number of bits: %ld BSCALE: %lf", range, *bscale);
 
     double imageVal;                    // Value on image
@@ -157,4 +165,6 @@
 
     *bzero = imageVal - *bscale * diskVal;
+
+    psTrace("psLib.fits", 5, "Image %lf corresponds to disk %ld --> BZERO: %lf", imageVal, diskVal, *bzero);
 
     return true;
