net.grelf.grip
Class FITS

java.lang.Object
  extended by net.grelf.grip.FITS

public class FITS
extends java.lang.Object

For loading and saving images as files in FITS format.
NB: Loads each image found in the file but does not attempt to analyse metadata (eg, exposure settings). Depending on the data type in an image, loading will either create a java.awt.image.BufferedImage or a net.grelf.grip.Accumulator. The behaviour is as indicated in this table:

Data typeBScale=1,BZero=0?Result
byte [][]yesBufferedImage.TYPE_BYTE_GRAY
byte [][]noAccumulatorDouble
short [][]yesBufferedImage.TYPE_USHORT_GRAY
short [][]noAccumulatorDouble
int [][]yesAccumulatorInt
int [][]noAccumulatorDouble
long [][]eitherNot handled
float [][]eitherAccumulatorDouble
double [][]eitherAccumulatorDouble
byte [][][]yesBufferedImage.TYPE_INT_RGB
byte [][][]noAccumulatorDouble
short [][][]yesBufferedImage.TYPE_INT_RGB
short [][][]noAccumulatorDouble
int [][][]yesAccumulatorInt
int [][][]noAccumulatorDouble
long [][][]eitherNot handled
float [][][]eitherAccumulatorDouble
double [][][]eitherAccumulatorDouble

Notes:
  1. For 3D arrays (FITS NAXES=3) it is assumed that the axis with the smallest length is the channels (bands) axis.
  2. The code can create images with more than 3 channels if the destination is an Accumulator. In that case only the first 3 channels will be displayed but the "Split channels" option on the levels menu will create as many monochrome images as there are channels. Any group of 3 can then be recombined via the image table. If the destination is a BufferedImage (8 or 16 bits) then instead multiple monochrome images are created and displayed immediately.


Constructor Summary
FITS()
           
 
Method Summary
 java.util.List<Im> load(java.io.File file)
          New version not using any third party packages, to avoid creating unnecessary intermediate data arrays.
 void save(java.lang.String filePath, Im im)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FITS

public FITS()
Method Detail

load

public java.util.List<Im> load(java.io.File file)
New version not using any third party packages, to avoid creating unnecessary intermediate data arrays. 11.10.23: Changed to return a list of Ims rather than a single one. Previously any additional images found were opened in new net.grelf.grip.ImFrames but we want to reduce interdependencies. It is now up to the caller to decide what to do with additional images.


save

public void save(java.lang.String filePath,
                 Im im)