Package nom.tam.fits
Class BinaryTableHDU
- java.lang.Object
-
- nom.tam.fits.BasicHDU<T>
-
- nom.tam.fits.TableHDU<BinaryTable>
-
- nom.tam.fits.BinaryTableHDU
-
- All Implemented Interfaces:
FitsElement
- Direct Known Subclasses:
CompressedImageHDU,CompressedTableHDU
public class BinaryTableHDU extends TableHDU<BinaryTable>
FITS binary table header/data unit
-
-
Field Summary
Fields Modifier and Type Field Description private static IFitsHeader[]KEY_STEMSThe standard column keywords for a binary table.-
Fields inherited from class nom.tam.fits.BasicHDU
BITPIX_BYTE, BITPIX_DOUBLE, BITPIX_FLOAT, BITPIX_INT, BITPIX_LONG, BITPIX_SHORT, isPrimary, myData, myHeader
-
-
Constructor Summary
Constructors Constructor Description BinaryTableHDU(Header hdr, BinaryTable datum)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intaddColumn(java.lang.Object data)Add a column to the table without any associated header information.protected static IFitsHeader[]binaryTableColumnKeyStems()protected IFitsHeader[]columnKeyStems()What are the standard column stems for a binary table?static BinaryTableencapsulate(java.lang.Object o)voidinfo(java.io.PrintStream stream)Print out some information about this HDU.static booleanisData(java.lang.Object o)booleanisHeader()Check that this HDU has a valid header.static booleanisHeader(Header header)Check that this is a valid binary table header.static BinaryTablemanufactureData(Header header)static HeadermanufactureHeader(Data data)private voidprtField(java.io.PrintStream stream, java.lang.String type, java.lang.String field)booleansetComplexColumn(int index)Convert a column in the table to complex.voidwrite(ArrayDataOutput ado)Write the contents of the element to a data sink.-
Methods inherited from class nom.tam.fits.TableHDU
addRow, deleteColumnsIndexOne, deleteColumnsIndexOne, deleteColumnsIndexZero, deleteColumnsIndexZero, deleteRows, deleteRows, findColumn, getColumn, getColumn, getColumnFormat, getColumnMeta, getColumnName, getColumns, getElement, getNCols, getNRows, getRow, setColumn, setColumn, setColumnMeta, setColumnMeta, setColumnMeta, setColumnMeta, setColumnMeta, setColumnMeta, setColumnMeta, setColumnName, setCurrentColumn, setCurrentColumn, setElement, setRow
-
Methods inherited from class nom.tam.fits.BasicHDU
addValue, addValue, addValue, addValue, addValue, addValue, addValue, addValue, canBePrimary, card, getAuthor, getAxes, getBitPix, getBlankValue, getBScale, getBUnit, getBZero, getCreationDate, getData, getDummyHDU, getEpoch, getEquinox, getFileOffset, getGroupCount, getHeader, getInstrument, getKernel, getMaximumValue, getMinimumValue, getObject, getObservationDate, getObserver, getOrigin, getParameterCount, getReference, getSize, getTelescope, getTrimmedString, getTrimmedString, read, reset, rewrite, rewriteable, saveReplaceCard, setPrimaryHDU
-
-
-
-
Field Detail
-
KEY_STEMS
private static final IFitsHeader[] KEY_STEMS
The standard column keywords for a binary table.
-
-
Constructor Detail
-
BinaryTableHDU
public BinaryTableHDU(Header hdr, BinaryTable datum)
-
-
Method Detail
-
encapsulate
public static BinaryTable encapsulate(java.lang.Object o) throws FitsException
- Parameters:
o- data to encapsulate- Returns:
- Encapsulate data in a BinaryTable data type
- Throws:
FitsException- if the type of the data is not usable as data
-
isData
public static boolean isData(java.lang.Object o)
-
isHeader
public static boolean isHeader(Header header)
Check that this is a valid binary table header.- Parameters:
header- to validate.- Returns:
trueif this is a binary table header.
-
manufactureData
public static BinaryTable manufactureData(Header header) throws FitsException
- Parameters:
header- the template specifying the binary table.- Returns:
- a new created data from a binary table header.
- Throws:
FitsException- if there was a problem with the header.
-
manufactureHeader
public static Header manufactureHeader(Data data) throws FitsException
- Parameters:
data- the data used to build the binary table. This is typically some kind of array of objects.- Returns:
- a newly created binary table HDU from the supplied data.
- Throws:
FitsException- if there was a problem with the data.
-
addColumn
public int addColumn(java.lang.Object data) throws FitsExceptionDescription copied from class:TableHDUAdd a column to the table without any associated header information.- Overrides:
addColumnin classTableHDU<BinaryTable>- Parameters:
data- the new column information. the newCol should be an Object[] where type of all of the constituents is identical. The length of data should match the other columns. Note: It is valid for data to be a 2 or higher dimensionality primitive array. In this case the column index is the first (in Java speak) index of the array. E.g., if called with int[30][20][10], the number of rows in the table should be 30 and this column will have elements which are 2-d integer arrays with TDIM = (10,20).- Returns:
- the number of columns in the adapted table
- Throws:
FitsException- if the operation failed
-
binaryTableColumnKeyStems
protected static IFitsHeader[] binaryTableColumnKeyStems()
-
columnKeyStems
protected IFitsHeader[] columnKeyStems()
What are the standard column stems for a binary table?- Specified by:
columnKeyStemsin classTableHDU<BinaryTable>- Returns:
- the stems of the keywords that are associated with table columns. Users can supplement this with their own and call the appropriate deleteColumns fields.
-
info
public void info(java.io.PrintStream stream)
Print out some information about this HDU.- Specified by:
infoin classBasicHDU<BinaryTable>- Parameters:
stream- the printstream to write the info on
-
isHeader
public boolean isHeader()
Check that this HDU has a valid header.- Returns:
trueif this HDU has a valid header.
-
prtField
private void prtField(java.io.PrintStream stream, java.lang.String type, java.lang.String field)
-
setComplexColumn
public boolean setComplexColumn(int index) throws FitsExceptionConvert a column in the table to complex. Only tables with appropriate types and dimensionalities can be converted. It is legal to call this on a column that is already complex.- Parameters:
index- The 0-based index of the column to be converted.- Returns:
- Whether the column can be converted
- Throws:
FitsException- if the header could not be adapted
-
write
public void write(ArrayDataOutput ado) throws FitsException
Description copied from interface:FitsElementWrite the contents of the element to a data sink.- Specified by:
writein interfaceFitsElement- Overrides:
writein classBasicHDU<BinaryTable>- Parameters:
ado- The data sink.- Throws:
FitsException- if the write was unsuccessful.
-
-