Package nom.tam.fits
Class AsciiTableHDU
- All Implemented Interfaces:
FitsElement
ASCII table header/data unit. ASCII table HDUs were desgined for human readability, e.g. on a console, without any
special tools. However, they are far less flexible or compact than
BinaryTableHDU
. As such, users are
generally discouraged from using this type of HDU to encapsulate FITS table data.
FitsFactory.setUseAsciiTables(boolean)
can be toggled to adjust whether Fits.makeHDU(Object)
or
similar methods should construct ASCII tables when possible. (The default setting is to produce binary tables
always.)- See Also:
-
Field Summary
Fields inherited from class nom.tam.fits.BasicHDU
BITPIX_BYTE, BITPIX_DOUBLE, BITPIX_FLOAT, BITPIX_INT, BITPIX_LONG, BITPIX_SHORT
-
Constructor Summary
ConstructorDescriptionAsciiTableHDU
(Header h, AsciiTable d) Deprecated.(for internal use) Its visibility should be reduced to package level in the future. -
Method Summary
Modifier and TypeMethodDescriptionint
Add a column to the table without any associated header information.static AsciiTable
Deprecated.(for internal use) UseAsciiTable.fromColumnMajor(Object[])
instead.void
info
(PrintStream stream) Print out some information about this HDU.static boolean
Deprecated.(for internal use) Will reduce visibility in the futurestatic boolean
Deprecated.(for internal use) Will reduce visibility in the futureboolean
isNull
(int row, int col) Checks if a table entry isnull
static AsciiTable
manufactureData
(Header hdr) Deprecated.(for internal use) Will reduce visibility in the futurestatic Header
Deprecated.(for internal use) Will reduce visibility in the futurevoid
setColumnName
(int index, String name, String comment) Sets the name / ID of a specific column in this table.void
setNull
(int row, int col, boolean flag) Mark an entry as null.void
setNullString
(int col, String newNull) Set the null string for a column.Methods inherited from class nom.tam.fits.TableHDU
addRow, deleteColumnsIndexOne, deleteColumnsIndexOne, deleteColumnsIndexZero, deleteColumnsIndexZero, deleteRows, deleteRows, findColumn, getColumn, getColumn, getColumnFormat, getColumnMeta, getColumnName, getColumns, getDefaultColumnName, getElement, getNCols, getNRows, getRow, setColumn, setColumn, setColumnMeta, setColumnMeta, setColumnMeta, setColumnMeta, setColumnMeta, setColumnMeta, setColumnMeta, setCurrentColumn, setCurrentColumn, setElement, setRow
Methods inherited from class nom.tam.fits.BasicHDU
addValue, addValue, addValue, addValue, addValue, addValue, addValue, addValue, calcChecksum, card, getAuthor, getAxes, getBitpix, getBitPix, getBlankValue, getBScale, getBUnit, getBZero, getCreationDate, getData, getDummyHDU, getEpoch, getEquinox, getFileOffset, getGroupCount, getHeader, getInstrument, getKernel, getMaximumValue, getMinimumValue, getObject, getObservationDate, getObserver, getOrigin, getParameterCount, getReference, getSize, getStoredChecksum, getStoredDatasum, getTelescope, getTrimmedString, getTrimmedString, read, reset, rewrite, rewriteable, setChecksum, verifyDataIntegrity, verifyIntegrity, write
-
Constructor Details
-
AsciiTableHDU
Deprecated.(for internal use) Its visibility should be reduced to package level in the future.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
Deprecated.(for internal use) UseAsciiTable.fromColumnMajor(Object[])
instead. Will reduce visibility in the future- 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
Deprecated.(for internal use) Will reduce visibility in the future- Parameters:
o
- object representing the data- Returns:
- true if this data is usable as an ASCII table.
-
isHeader
Deprecated.(for internal use) Will reduce visibility in the futureCheck that this is a valid ascii table header.- Parameters:
header
- to validate.- Returns:
true
if this is an ascii table header.
-
manufactureData
Deprecated.(for internal use) Will reduce visibility in the futurePrepares a data object into which the actual data can be read from an input subsequently or at a later time.- Parameters:
hdr
- The FITS header that describes the data- Returns:
- A data object that support reading content from a stream.
- Throws:
FitsException
- if the data could not be prepared to prescriotion.
-
manufactureHeader
Deprecated.(for internal use) Will reduce visibility in the future- 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
-
setColumnName
public void setColumnName(int index, String name, String comment) throws IndexOutOfBoundsException, HeaderCardException Description copied from class:TableHDU
Sets the name / ID of a specific column in this table. Naming columns is generally a good idea so that people can figure out what sort of data actually appears in specific table columns.- Overrides:
setColumnName
in classTableHDU<AsciiTable>
- Parameters:
index
- the column indexname
- the name or ID we want to assing to the columncomment
- Any additional comment we would like to store alongside in the FITS header. (The comment may be truncated or even ommitted, depending on space constraints in the FITS header.- Throws:
IndexOutOfBoundsException
- if the table has no column matching the indexHeaderCardException
- if there was a problem wil adding the associated descriptive FITS header keywords to this table's header.- See Also:
-
addColumn
Description copied from class:TableHDU
Add a column to the table without any associated header information.- Overrides:
addColumn
in 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
-
info
Description copied from class:BasicHDU
Print out some information about this HDU.- Specified by:
info
in classBasicHDU<AsciiTable>
- Parameters:
stream
- the printstream to write the info on
-
isNull
public boolean isNull(int row, int col) Checks if a table entry isnull
- Parameters:
row
- row index of the elementcol
- column index of the element- Returns:
true
if the specified element isnull
- See Also:
-
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- See Also:
-
setNullString
Set the null string for a column.- Parameters:
col
- the column indexnewNull
- the String representing null- Throws:
IllegalArgumentException
- if the string argument contains characters that are not allowed in FITS headers. That is if it contains characters outside the range of 0x20 thru 0x7E.
-