org.eso.fits
Class FitsHDUnit

java.lang.Object
  extended by org.eso.fits.FitsHDUnit

public class FitsHDUnit
extends java.lang.Object

FitsData class represents a FITS data unit


Constructor Summary
FitsHDUnit(java.io.DataInput file, boolean sflag)
          Constructor for FitsHDUnit class given a FITS stream and a internal storage flag.
FitsHDUnit(FitsHeader header, FitsData data)
          Constructor from individual header and data objects.
 
Method Summary
 boolean canSave()
          Check if HD unit can be save to FITS file in place that is a FITS file exists and has space enough.
 void closeFile()
          Remove all references to the DataInput file from data unit
 FitsData getData()
          Return the FitsData object in the Header/Data unit
 FitsHeader getHeader()
          Return the header object in the Header/Data unit
 int getType()
          Get the type of Header/Data unit as indicated by its header.
protected  void saveFile(java.io.RandomAccessFile file)
          Save changes of a HD unit to FITS file.
 void writeFile(java.io.DataOutput file)
          Write FITS header/Data unit to a DataOutput stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FitsHDUnit

public FitsHDUnit(java.io.DataInput file,
                  boolean sflag)
           throws FitsException
Constructor for FitsHDUnit class given a FITS stream and a internal storage flag.

Parameters:
file - DataInput file positioned at the start of the header/data unit
sflag - Flag for storing data matrix internally
Throws:
FitsException

FitsHDUnit

public FitsHDUnit(FitsHeader header,
                  FitsData data)
           throws FitsException
Constructor from individual header and data objects.

Parameters:
header - new FitsHeader object to used
data - new FitsData object associated to header
Throws:
FitsException
Method Detail

getType

public int getType()
Get the type of Header/Data unit as indicated by its header.


canSave

public boolean canSave()
Check if HD unit can be save to FITS file in place that is a FITS file exists and has space enough.


saveFile

protected void saveFile(java.io.RandomAccessFile file)
                 throws java.io.IOException,
                        FitsException
Save changes of a HD unit to FITS file. The HDunit must have been created from a read/write RandomAccess disk file. There are no check for the consistence of Header and Data.

Throws:
IOException, - FitsException
java.io.IOException
FitsException

writeFile

public void writeFile(java.io.DataOutput file)
               throws java.io.IOException,
                      FitsException
Write FITS header/Data unit to a DataOutput stream.

Parameters:
file - DataOutput object to which to write
Throws:
IOException, - FitsException
java.io.IOException
FitsException

closeFile

public void closeFile()
Remove all references to the DataInput file from data unit


getData

public FitsData getData()
Return the FitsData object in the Header/Data unit


getHeader

public FitsHeader getHeader()
Return the header object in the Header/Data unit