Class AsciiTableHDU
- All Implemented Interfaces:
FitsElement
FITS ASCII table header/data unit
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final IFitsHeader[]The standard column stems for an ASCII table.private static final LoggerFields inherited from class BasicHDU
BITPIX_BYTE, BITPIX_DOUBLE, BITPIX_FLOAT, BITPIX_INT, BITPIX_LONG, BITPIX_SHORT, isPrimary, myData, myHeader -
Constructor Summary
ConstructorsConstructorDescriptionAsciiTableHDU(Header h, AsciiTable d) Create an ASCII table header/data unit. -
Method Summary
Modifier and TypeMethodDescriptionintAdd a column to the table without any associated header information.protected IFitsHeader[]static AsciiTablevoidinfo(PrintStream stream) Print out some information about this HDU.static booleanstatic booleanCheck that this is a valid ascii table header.booleanisNull(int row, int col) static DatamanufactureData(Header hdr) Create a Data object to correspond to the header description.static HeadervoidsetNull(int row, int col, boolean flag) Mark an entry as null.voidsetNullString(int col, String newNull) Set the null string for a column.Methods inherited from class 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, setRowMethods inherited from class 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, write
-
Field Details
-
LOG
-
KEY_STEMS
The standard column stems for an ASCII table. Note that TBCOL is not included here -- it needs to be handled specially since it does not simply shift.
-
-
Constructor Details
-
AsciiTableHDU
Create an ASCII table header/data unit.- Parameters:
h- the template specifying the ASCII table.d- the FITS data structure containing the table data.
-
-
Method Details
-
encapsulate
- Parameters:
o- the array of object to create the ASCII table- Returns:
- a ASCII table data structure from an array of objects representing the columns.
- Throws:
FitsException- if the table could not be created.
-
isData
- Parameters:
o- object representing the data- Returns:
- true if this data is usable as an ASCII table.
-
isHeader
Check that this is a valid ascii table header.- Parameters:
header- to validate.- Returns:
trueif this is an ascii table header.
-
manufactureData
Create a Data object to correspond to the header description.- Parameters:
hdr- the header to create the data for- Returns:
- An unfilled Data object which can be used to read in the data for this HDU.
- Throws:
FitsException- if the Data object could not be created from this HDU's Header
-
manufactureHeader
- Parameters:
d- data to create a header for- Returns:
- a created header to match the input data.
- Throws:
FitsException- if the header could not b e created
-
addColumn
Description copied from class:TableHDUAdd a column to the table without any associated header information.- Overrides:
addColumnin classTableHDU<AsciiTable>- Parameters:
newCol- 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
-
columnKeyStems
- Specified by:
columnKeyStemsin classTableHDU<AsciiTable>- 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
Description copied from class:BasicHDUPrint out some information about this HDU.- Specified by:
infoin classBasicHDU<AsciiTable>- Parameters:
stream- the printstream to write the info on
-
isNull
public boolean isNull(int row, int col) - Parameters:
row- row index of the elementcol- column index of the element- Returns:
trueif an element is null
-
setNull
public void setNull(int row, int col, boolean flag) Mark an entry as null.- Parameters:
row- row index of the elementcol- column index of the elementflag- set to null or not
-
setNullString
Set the null string for a column.- Parameters:
col- the column indexnewNull- the String representing null
-