org.eso.fits
Class FitsRGroup

java.lang.Object
  extended by org.eso.fits.FitsData
      extended by org.eso.fits.FitsRGroup

public class FitsRGroup
extends FitsData

FitsRGroup class represents a FITS data matrix in the Random Group format.


Field Summary
 
Fields inherited from class org.eso.fits.FitsData
bitpix, changeData, dataArray, dataFile, dataOffset, isRAFile, naxis, noGroup, noParm, size, type
 
Constructor Summary
FitsRGroup(FitsHeader header, java.io.DataInput file, boolean sflag)
          Constructor for FitsRGroup class given a FITS prime matrix or an image extension header with associated data unit as a file.
 
Method Summary
 double[] getCdelt()
          Gets step size for the axes (see CDELTn).
 double[] getCrpix()
          Gets reference pixel for the axes (see CRPIXn).
 double[] getCrval()
          Gets coordinate value for the reference pixel of the axes (see CRVALn).
 float[] getFloatValues(int offset, int size, float[] data)
          Read set of data values from the matrix as a float array.
 int[] getFloatValues(int offset, int size, int[] data)
          Gets set of data points from the matrix as a int values.
 FitsHeader getHeader()
          Create and return a minimum FITS header for data Matrix.
 int getNoValues()
          Gets the total number of data values in the data matrix.
 short[] getShortValues(int offset, int size, short[] data)
          Gets set of data points from the matrix as a short values.
 FitsWCS getWCS()
          Gets the WCS object for the image.
 double[] toPixel(double[] wc)
          Compute pixel coordinates from a set of World Coordinates.
 double[] toWCS(double[] pix)
          Compute World Coordinates from pixel coordinates.
 
Methods inherited from class org.eso.fits.FitsData
closeFile, getNaxis, getNoAxes, getType, writeFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FitsRGroup

public FitsRGroup(FitsHeader header,
                  java.io.DataInput file,
                  boolean sflag)
           throws FitsException
Constructor for FitsRGroup class given a FITS prime matrix or an image extension header with associated data unit as a file.

Parameters:
header - FitsHeader object with the image header
file - RandomAccess file positioned at the start of the associated data unit
sflag - Flag for storing data matrix internally
Throws:
FitsException
Method Detail

getHeader

public FitsHeader getHeader()
Create and return a minimum FITS header for data Matrix.

Overrides:
getHeader in class FitsData

getShortValues

public short[] getShortValues(int offset,
                              int size,
                              short[] data)
                       throws FitsException
Gets set of data points from the matrix as a short values. Only FITS file with BITPIX 8, 16 and 32 are read.

Parameters:
offset - pixel offset within hte data matrix
size - no. of pixel values to be read
data - array which will hold the return values. If null an array of size is created.
Returns:
data[] array updated with pixel values
Throws:
FitsException

getFloatValues

public int[] getFloatValues(int offset,
                            int size,
                            int[] data)
                     throws FitsException
Gets set of data points from the matrix as a int values. Only FITS file with BITPIX 8, 16 and 32 are read.

Parameters:
offset - pixel offset within hte data matrix
size - no. of pixel values to be read
data - array which will hold the return values. If null an array of size is created.
Returns:
data[] array updated with pixel values
Throws:
FitsException

getFloatValues

public float[] getFloatValues(int offset,
                              int size,
                              float[] data)
                       throws FitsException
Read set of data values from the matrix as a float array. The values are returned as a float array.

Parameters:
offset - pixel offset within hte data matrix
size - no. of pixel values to be read
data - array which will hold the return values. If null an array of size is created.
Returns:
data[] array updated with pixel values
Throws:
FitsException

getNoValues

public int getNoValues()
Gets the total number of data values in the data matrix.


getCrpix

public double[] getCrpix()
Gets reference pixel for the axes (see CRPIXn).


getCrval

public double[] getCrval()
Gets coordinate value for the reference pixel of the axes (see CRVALn).


getCdelt

public double[] getCdelt()
Gets step size for the axes (see CDELTn).


getWCS

public FitsWCS getWCS()
Gets the WCS object for the image.


toWCS

public double[] toWCS(double[] pix)
Compute World Coordinates from pixel coordinates.

Parameters:
pix - Array with pixel coordinates

toPixel

public double[] toPixel(double[] wc)
Compute pixel coordinates from a set of World Coordinates.

Parameters:
wc - Array with World Coordinates