org.jscience.io.fits
Class FitsHDU

java.lang.Object
  extended by org.jscience.io.fits.FitsHDU

public class FitsHDU
extends java.lang.Object

*********************************************************************** Represents the basic building block of a FITS file - the "Header Data Unit". Each HDU consists of a header containing metadata and a data section containing the actual data (e.g. a table or image).

************************************************************************


Constructor Summary
FitsHDU()
          *********************************************************************** Create an empty HDU with no data and no keywords in the header.
FitsHDU(FitsHeader header, FitsData data)
          *********************************************************************** Create an HDU with the given header and data.
 
Method Summary
 int blockCount()
          *********************************************************************** returns the number of blocks in both the header and data sections
 FitsData getData()
          *********************************************************************** returns the data part of this HDU.
 FitsHeader getHeader()
          *********************************************************************** returns the header part of this HDU ************************************************************************
 void initData()
          *********************************************************************** internally creates an object to represent the data part of the HDU which corresponds to the header of this HDU.
 java.lang.String name()
          *********************************************************************** returns the result of calling FitsHeader.getName() for the header of this HDU
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FitsHDU

public FitsHDU()
*********************************************************************** Create an empty HDU with no data and no keywords in the header. This constructor is useful when creating a FITS file in memory. The proceedure is as follows:
  1. Call this constructor
  2. use getHeader() to obtain the header object
  3. set the required keywords in the header
  4. use initData() to create the data section internally
  5. use getData() to obtain the newly created data object
  6. set the data values
************************************************************************


FitsHDU

public FitsHDU(FitsHeader header,
               FitsData data)
*********************************************************************** Create an HDU with the given header and data. The caller is responsible for ensuring that the header and data are compatible. If you are creating an HDU in memory, it may be more convenient to use FitsHDU() and then initData().

Parameters:
header - the header object to use in this HDU
data - the data object to use in this HDU ************************************************************************
Method Detail

getHeader

public FitsHeader getHeader()
*********************************************************************** returns the header part of this HDU ************************************************************************


getData

public FitsData getData()
*********************************************************************** returns the data part of this HDU. If the data section is uninitialized, then this method returns null. The data can be uninitialized if the HDU is being created in memory and you have not yet called initData(), or you did not require the data to be read when you obtained the HDU from the FitsFile.

See Also:
************************************************************************

name

public java.lang.String name()
*********************************************************************** returns the result of calling FitsHeader.getName() for the header of this HDU. ************************************************************************


blockCount

public int blockCount()
*********************************************************************** returns the number of blocks in both the header and data sections

Throws:
java.lang.NullPointerException - if the data part is not initialized. ************************************************************************

initData

public void initData()
              throws FitsException
*********************************************************************** internally creates an object to represent the data part of the HDU which corresponds to the header of this HDU. Any existing data in this HDU are discarded. This method does nothing if the header is not complete.

Throws:
FitsException - if the header is improperly formed. ************************************************************************