net.grelf.grip
Class FITS
java.lang.Object
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 type | BScale=1,BZero=0? | Result |
byte [][] | yes | BufferedImage.TYPE_BYTE_GRAY |
byte [][] | no | AccumulatorDouble |
short [][] | yes | BufferedImage.TYPE_USHORT_GRAY |
short [][] | no | AccumulatorDouble |
int [][] | yes | AccumulatorInt |
int [][] | no | AccumulatorDouble |
long [][] | either | Not handled |
float [][] | either | AccumulatorDouble |
double [][] | either | AccumulatorDouble |
byte [][][] | yes | BufferedImage.TYPE_INT_RGB |
byte [][][] | no | AccumulatorDouble |
short [][][] | yes | BufferedImage.TYPE_INT_RGB |
short [][][] | no | AccumulatorDouble |
int [][][] | yes | AccumulatorInt |
int [][][] | no | AccumulatorDouble |
long [][][] | either | Not handled |
float [][][] | either | AccumulatorDouble |
double [][][] | either | AccumulatorDouble |
Notes:
- For 3D arrays (FITS NAXES=3) it is assumed that the axis with the smallest length is the channels (bands)
axis.
- 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 |
FITS
public FITS()
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)