org.eso.fits
Class FitsData

java.lang.Object
  extended by org.eso.fits.FitsData
Direct Known Subclasses:
FitsMatrix, FitsRGroup, FitsTable

public class FitsData
extends java.lang.Object

FitsData class represents a FITS data unit


Field Summary
protected  int bitpix
           
protected  boolean changeData
           
protected  byte[] dataArray
           
protected  java.io.RandomAccessFile dataFile
           
protected  long dataOffset
           
protected  boolean isRAFile
           
protected  int[] naxis
           
protected  int noGroup
           
protected  int noParm
           
protected  long size
           
protected  int type
           
 
Constructor Summary
FitsData(FitsHeader header, java.io.DataInput file, boolean sflag)
          Constructor for FitsData class given a FITS header with associated data unit as a file.
FitsData(int bitpix, int[] nax)
          Constructor for FitsData class given the size of the data matrix.
 
Method Summary
 void closeFile()
          Closes the associated data file
 FitsHeader getHeader()
          Create and return a minimum FITS header for data Matrix.
 int[] getNaxis()
          Gets the dimentions of the axes.
 int getNoAxes()
          Retrives number of axes defined for the data unit (ref.
 int getType()
          Gets FITS type of data unit.
 void writeFile(java.io.DataOutput file)
          Write data martix to DataOutput stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

protected int type

naxis

protected int[] naxis

size

protected long size

bitpix

protected int bitpix

noParm

protected int noParm

noGroup

protected int noGroup

changeData

protected boolean changeData

dataFile

protected java.io.RandomAccessFile dataFile

dataOffset

protected long dataOffset

dataArray

protected byte[] dataArray

isRAFile

protected boolean isRAFile
Constructor Detail

FitsData

public FitsData(FitsHeader header,
                java.io.DataInput file,
                boolean sflag)
         throws FitsException
Constructor for FitsData class given a FITS 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

FitsData

public FitsData(int bitpix,
                int[] nax)
         throws FitsException
Constructor for FitsData class given the size of the data matrix. An array equal to the size of the data matrix will be allocated.

Parameters:
bitpix - value of FITS BITPIX keyword bits/pixel
nax - Integer array defining the dimensions of the data matrix or for BINTABLE the heap size
Throws:
FitsException
Method Detail

getHeader

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


writeFile

public void writeFile(java.io.DataOutput file)
               throws java.io.IOException,
                      FitsException
Write data martix to DataOutput stream.

Parameters:
file - DataOutput stream to which data are written
Throws:
IOException, - FitsException
java.io.IOException
FitsException

closeFile

public void closeFile()
Closes the associated data file


getNoAxes

public int getNoAxes()
Retrives number of axes defined for the data unit (ref. NAXIS)


getType

public int getType()
Gets FITS type of data unit. This is specified in the assocated header such as Fits.IMAGE or Fits.BTABLE


getNaxis

public int[] getNaxis()
Gets the dimentions of the axes. This is defined for the data unit by the NAXISn keywords.