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 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 int
addColumn(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 BinaryTable
encapsulate(java.lang.Object o)
void
info(java.io.PrintStream stream)
Print out some information about this HDU.static boolean
isData(java.lang.Object o)
boolean
isHeader()
Check that this HDU has a valid header.static boolean
isHeader(Header header)
Check that this is a valid binary table header.static BinaryTable
manufactureData(Header header)
static Header
manufactureHeader(Data data)
boolean
setComplexColumn(int index)
Convert a column in the table to complex.void
write(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, 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
-
-
-
-
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:
true
if 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 FitsException
Description copied from class:TableHDU
Add a column to the table without any associated header information.- Overrides:
addColumn
in 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:
columnKeyStems
in 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:
info
in classBasicHDU<BinaryTable>
- Parameters:
stream
- the printstream to write the info on
-
isHeader
public boolean isHeader()
Check that this HDU has a valid header.- Returns:
true
if this HDU has a valid header.
-
setComplexColumn
public boolean setComplexColumn(int index) throws FitsException
Convert 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:FitsElement
Write the contents of the element to a data sink.- Specified by:
write
in interfaceFitsElement
- Overrides:
write
in classBasicHDU<BinaryTable>
- Parameters:
ado
- The data sink.- Throws:
FitsException
- if the write was unsuccessful.
-
-