edu.jhu.pha.sdss.fits
Class ScaleUtils

java.lang.Object
  extended byedu.jhu.pha.sdss.fits.ScaleUtils
Direct Known Subclasses:
SlowScaleUtils

public class ScaleUtils
extends java.lang.Object

   Current Version
   ===============
   ID:            $Id: ScaleUtils.html,v 1.1 2004/07/23 22:04:49 carliles Exp $
   Revision:      $Revision: 1.1 $
   Date/time:     $Date: 2004/07/23 22:04:49 $
   
Array operations that should be implemented in one method, but which have to be reimplemented for each primitive data type just to have the right type in the damn parameter list.


Field Summary
static int ASINH
           
static int HIST_EQ
           
static int LINEAR
           
static int LOG
           
static java.lang.String[] SCALE_NAMES
           
static int SQUARE
           
static int SQUARE_ROOT
           
 
Constructor Summary
ScaleUtils()
           
 
Method Summary
static double arcsinh(double val)
           
static Histogram computeHistogram(byte[][] data, double bZero, double bScale)
          Finds the minimum and maximum data values in data.
static Histogram computeHistogram(double[][] data, double bZero, double bScale)
          Finds the minimum and maximum data values in data.
static Histogram computeHistogram(float[][] data, double bZero, double bScale)
          Finds the minimum and maximum data values in data.
static Histogram computeHistogram(int[][] data, double bZero, double bScale)
          Finds the minimum and maximum data values in data.
static Histogram computeHistogram(short[][] data, double bZero, double bScale)
          Finds the minimum and maximum data values in data.
static java.lang.String[] getScaleNames()
           
static java.lang.String revision()
           
static short[][] scaleToUShort(byte[][] data, Histogram hist, int width, int height, double bZero, double bScale, double min, double max, double sigma)
           
static short[][] scaleToUShort(double[][] data, Histogram hist, int width, int height, double bZero, double bScale, double min, double max, double sigma)
           
static short[][] scaleToUShort(float[][] data, Histogram hist, int width, int height, double bZero, double bScale, double min, double max, double sigma)
           
static short[][] scaleToUShort(int[][] data, Histogram hist, int width, int height, double bZero, double bScale, double min, double max, double sigma)
           
static short[][] scaleToUShort(short[][] data, Histogram hist, int width, int height, double bZero, double bScale, double min, double max, double sigma)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCALE_NAMES

public static final java.lang.String[] SCALE_NAMES

LINEAR

public static final int LINEAR
See Also:
Constant Field Values

LOG

public static final int LOG
See Also:
Constant Field Values

SQUARE_ROOT

public static final int SQUARE_ROOT
See Also:
Constant Field Values

SQUARE

public static final int SQUARE
See Also:
Constant Field Values

HIST_EQ

public static final int HIST_EQ
See Also:
Constant Field Values

ASINH

public static final int ASINH
See Also:
Constant Field Values
Constructor Detail

ScaleUtils

public ScaleUtils()
Method Detail

getScaleNames

public static java.lang.String[] getScaleNames()

arcsinh

public static double arcsinh(double val)

scaleToUShort

public static short[][] scaleToUShort(byte[][] data,
                                      Histogram hist,
                                      int width,
                                      int height,
                                      double bZero,
                                      double bScale,
                                      double min,
                                      double max,
                                      double sigma)
Parameters:
data - The image intensity values indexed by y, then x.
width - The width of the image.
height - The height of the image.
bZero - The value of the BZERO field of the FITS header.
bScale - The value of the BSCALE field of the FITS header.
min - The minimum input data value over which to scale.
max - The maximum input data value over which to scale.
Returns:
An array of short arrays (suitable for use in a PixelInterleavedSampleModel with 3 bands) corresponding to linear, log, square root, and square scaling of intensities, in that order.

scaleToUShort

public static short[][] scaleToUShort(short[][] data,
                                      Histogram hist,
                                      int width,
                                      int height,
                                      double bZero,
                                      double bScale,
                                      double min,
                                      double max,
                                      double sigma)
Parameters:
data - The image intensity values indexed by y, then x.
width - The width of the image.
height - The height of the image.
bZero - The value of the BZERO field of the FITS header.
bScale - The value of the BSCALE field of the FITS header.
min - The minimum input data value over which to scale.
max - The maximum input data value over which to scale.
Returns:
An array of short arrays (suitable for use in a PixelInterleavedSampleModel with 3 bands) corresponding to linear, log, square root, and square scaling of intensities, in that order.

scaleToUShort

public static short[][] scaleToUShort(int[][] data,
                                      Histogram hist,
                                      int width,
                                      int height,
                                      double bZero,
                                      double bScale,
                                      double min,
                                      double max,
                                      double sigma)
Parameters:
data - The image intensity values indexed by y, then x.
width - The width of the image.
height - The height of the image.
bZero - The value of the BZERO field of the FITS header.
bScale - The value of the BSCALE field of the FITS header.
min - The minimum input data value over which to scale.
max - The maximum input data value over which to scale.
Returns:
An array of short arrays (suitable for use in a PixelInterleavedSampleModel with 3 bands) corresponding to linear, log, square root, and square scaling of intensities, in that order.

scaleToUShort

public static short[][] scaleToUShort(float[][] data,
                                      Histogram hist,
                                      int width,
                                      int height,
                                      double bZero,
                                      double bScale,
                                      double min,
                                      double max,
                                      double sigma)
Parameters:
data - The image intensity values indexed by y, then x.
width - The width of the image.
height - The height of the image.
bZero - The value of the BZERO field of the FITS header.
bScale - The value of the BSCALE field of the FITS header.
min - The minimum input data value over which to scale.
max - The maximum input data value over which to scale.
Returns:
An array of short arrays (suitable for use in a PixelInterleavedSampleModel with 3 bands) corresponding to linear, log, square root, and square scaling of intensities, in that order.

scaleToUShort

public static short[][] scaleToUShort(double[][] data,
                                      Histogram hist,
                                      int width,
                                      int height,
                                      double bZero,
                                      double bScale,
                                      double min,
                                      double max,
                                      double sigma)
Parameters:
data - The image intensity values indexed by y, then x.
width - The width of the image.
height - The height of the image.
bZero - The value of the BZERO field of the FITS header.
bScale - The value of the BSCALE field of the FITS header.
min - The minimum input data value over which to scale.
max - The maximum input data value over which to scale.
Returns:
An array of short arrays (suitable for use in a PixelInterleavedSampleModel with 3 bands) corresponding to linear, log, square root, and square scaling of intensities, in that order.

computeHistogram

public static Histogram computeHistogram(byte[][] data,
                                         double bZero,
                                         double bScale)
Finds the minimum and maximum data values in data.


computeHistogram

public static Histogram computeHistogram(short[][] data,
                                         double bZero,
                                         double bScale)
Finds the minimum and maximum data values in data.


computeHistogram

public static Histogram computeHistogram(int[][] data,
                                         double bZero,
                                         double bScale)
Finds the minimum and maximum data values in data.


computeHistogram

public static Histogram computeHistogram(float[][] data,
                                         double bZero,
                                         double bScale)
Finds the minimum and maximum data values in data.


computeHistogram

public static Histogram computeHistogram(double[][] data,
                                         double bZero,
                                         double bScale)
Finds the minimum and maximum data values in data.


revision

public static java.lang.String revision()
Returns:
CVS Revision number.