net.aerith.misao.image.io
Class Fits

java.lang.Object
  |
  +--net.aerith.misao.image.io.Format
        |
        +--net.aerith.misao.image.io.Fits
Direct Known Subclasses:
UnsignedFits

public class Fits
extends Format

The Fits is a class to read and save FITS file. It is just an access interface to FITS file.


Fields inherited from class net.aerith.misao.image.io.Format
url
 
Constructor Summary
Fits(java.net.URL url)
          Constructs a Fits with URL.
 
Method Summary
 java.lang.String getName()
          Gets the name of the image format.
 boolean isFits()
          Returns true if the format is FITS.
 MonoImage read()
          Reads FITS file and creates image buffer.
 FitsDocument readDocument()
          Reads FITS file and creates the FITS document.
 void save(MonoImage image)
          Saves image buffer into a FITS file.
 void saveDocument(FitsDocument document)
          Saves the FITS document into a FITS file.
protected  boolean signed()
          True if the 16-bit FITS image contains signed data.
 
Methods inherited from class net.aerith.misao.image.io.Format
create, create, getTruncatedFilename, setURL
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

Fits

public Fits(java.net.URL url)
Constructs a Fits with URL.
Parameters:
url - the URL of the FITS file.
Method Detail

getName

public java.lang.String getName()
Gets the name of the image format.
Overrides:
getName in class Format
Returns:
the name of the image format.

isFits

public boolean isFits()
Returns true if the format is FITS.
Overrides:
isFits in class Format
Returns:
true if the format is FITS.

signed

protected boolean signed()
True if the 16-bit FITS image contains signed data.
Returns:
true if the 16-bit FITS image contains signed data.

read

public MonoImage read()
               throws java.io.IOException,
                      UnsupportedBufferTypeException,
                      UnsupportedFileTypeException
Reads FITS file and creates image buffer. The url of the FITS file must be set previously. It only supports BITPIX 8, 16 and 32 bits images.
Overrides:
read in class Format
Returns:
the monochrome image buffer.
Throws:
java.io.IOException - if I/O error occurs.
UnsupportedBufferTypeException - if the data type is unsupported.
UnsupportedFileTypeException - if the file type is unsupported.

readDocument

public FitsDocument readDocument()
                          throws java.io.IOException,
                                 UnsupportedBufferTypeException
Reads FITS file and creates the FITS document. The url of the FITS file must be set previously. It only supports BITPIX 8, 16 and 32 bits images.
Returns:
the FITS document.
Throws:
java.io.IOException - if I/O error occurs.
UnsupportedBufferTypeException - if the data type is unsupported.

save

public void save(MonoImage image)
          throws java.io.IOException,
                 UnsupportedBufferTypeException,
                 UnsupportedFileTypeException
Saves image buffer into a FITS file. The url of the FITS file must be set previously. The type of FITS file is properly determined based on the buffer type. It only supports BITPIX 8, 16 and 32 bits images.
Overrides:
save in class Format
Parameters:
image - the monochrome image buffer to save.
Throws:
java.io.IOException - if I/O error occurs.
UnsupportedBufferTypeException - if the data type is unsupported.
UnsupportedFileTypeException - if the file type is unsupported.

saveDocument

public void saveDocument(FitsDocument document)
                  throws java.io.IOException,
                         UnsupportedBufferTypeException
Saves the FITS document into a FITS file. The url of the FITS file must be set previously.
Parameters:
document - the FITS document.
Throws:
java.io.IOException - if I/O error occurs.
UnsupportedBufferTypeException - if the data type is unsupported.