|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eso.fits.FitsFile
public class FitsFile
FitsFile class represents a FITS file consisting of a set of Header/Data Units. The header information is stored in FitsHeader objects while data are not saved in objects but accessed through file. Thus, files may be corrupted if the disk file is modified independently by other modules.
Constructor Summary | |
---|---|
FitsFile()
Default constructor for FitsFile class |
|
FitsFile(java.io.DataInput file)
Constructor for FitsFile class given a FITS stream. |
|
FitsFile(java.io.DataInput file,
boolean sflag)
Constructor for FitsFile class given a FITS stream and a flag indicating if the data matrices should be stored internally. |
|
FitsFile(java.io.File file)
Constructor specifying a name of a disk file. |
|
FitsFile(java.lang.String filename)
Constructor from name of disk file. |
Method Summary | |
---|---|
void |
addHDUnit(FitsHDUnit hdu)
Add new HDUnit to FITS file. |
void |
closeFile()
Remove all references to associated DataInput files. |
protected void |
finalize()
Finalize method which close disk file |
java.io.File |
getFile()
Gets file identifier for FITS file |
FitsHDUnit |
getHDUnit(int no)
Get HDUnit in FitsFile by its position. |
java.lang.String |
getName()
Gets Canonical path of FITS file |
int |
getNoHDUnits()
Gets numnber of HDUnits in FITS file |
void |
insertHDUnitAt(FitsHDUnit hdu,
int index)
Insert new HDUnit to FITS file at specified location. |
static boolean |
isFitsFile(java.io.File file)
Static method to test if a disk file possibly is in FITS format. |
static boolean |
isFitsFile(java.lang.String filename)
Static method to test if a disk file possibly is in FITS format. |
void |
removeHDUnitAt(int index)
Remove HDUnit with given location from FITS file. |
void |
saveFile()
Save changes made to a FITS file on disk. |
void |
writeFile(java.io.DataOutput filename)
Write FITS file to a DataOutput stream. |
void |
writeFile(java.io.File file)
Write FITS file on a new diskfile. |
void |
writeFile(java.lang.String filename)
Write FITS file on a new diskfile. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FitsFile()
public FitsFile(java.io.DataInput file) throws FitsException
file
- DataInput stream positioned at its start
FitsException
public FitsFile(java.io.DataInput file, boolean sflag) throws FitsException
file
- DataInput stream positioned at its startsflag
- Flag indicating if data matrices should be
stored internally in the class.
FitsException
public FitsFile(java.io.File file) throws java.io.IOException, FitsException
file
- name of disk file in FITS format
IOException,FitsException
java.io.IOException
FitsException
public FitsFile(java.lang.String filename) throws java.io.IOException, FitsException
filename
- name of disk file in FITS format
IOException,FitsException
java.io.IOException
FitsException
Method Detail |
---|
protected void finalize() throws java.io.IOException
finalize
in class java.lang.Object
java.io.IOException
public static boolean isFitsFile(java.io.File file)
file
- disk filepublic static boolean isFitsFile(java.lang.String filename)
filename
- name of disk filepublic void addHDUnit(FitsHDUnit hdu)
hdu
- FitsHDUnit to be addedpublic void insertHDUnitAt(FitsHDUnit hdu, int index)
hdu
- FitsHDUnit to be insertedindex
- location at which hte HDU should be insertedpublic void removeHDUnitAt(int index)
index
- location of the HDU to be removedpublic final FitsHDUnit getHDUnit(int no)
no
- number of HDUnit to retrieve (starting with 0)public void saveFile() throws java.io.IOException, FitsException
IOException,
- FitsException
java.io.IOException
FitsException
public void writeFile(java.io.DataOutput filename) throws java.io.IOException, FitsException
filename
- name of new file to be written
IOException,
- FitsException
java.io.IOException
FitsException
public void writeFile(java.io.File file) throws java.io.IOException, FitsException
file
- new file to be written
IOException,
- FitsException
java.io.IOException
FitsException
public void writeFile(java.lang.String filename) throws java.io.IOException, FitsException
filename
- name of new file to be written
IOException,
- FitsException
java.io.IOException
FitsException
public void closeFile()
public final int getNoHDUnits()
public java.lang.String getName()
public java.io.File getFile()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |