Class CompressedImageData
java.lang.Object
nom.tam.fits.Data
nom.tam.fits.AbstractTableData
nom.tam.fits.BinaryTable
nom.tam.image.compression.hdu.CompressedImageData
- All Implemented Interfaces:
Cloneable, FitsElement, TableData
FITS representation of a compressed image. Compressed images are essentially stored as FITS binary tables. They are
distinguished only by a set of mandatory header keywords and specific column data structure. The image-specific
header keywords of the original image are re-mapped to keywords starting with 'Z' prefixed so as to not interfere
with the binary table description. (e.g. NAXIS1 of the original image is stored as ZNAXIS1 in the compressed table).
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class BinaryTable
BinaryTable.ColumnDescModifier and TypeClassDescriptionstatic classDescribes the data type and shape stored in a binary table column. -
Method Summary
Methods inherited from class BinaryTable
addBitsColumn, addColumn, addColumn, addComplexColumn, addFlattenedColumn, addRow, addStringColumn, addVariableSizeColumn, compact, containsHeap, convertToBits, copy, createColumnDataFor, defragment, deleteColumns, deleteRows, fromColumnMajor, fromRowMajor, get, getArrayElement, getArrayElementAs, getBases, getColumn, getData, getDescriptor, getDescriptor, getDescriptor, getDimens, getDouble, getElement, getFlatColumns, getFlattenedColumn, getLogical, getLong, getModelRow, getNCols, getNRows, getNumber, getRawElement, getRow, getSizes, getString, getTypes, indexOf, parseTDims, read, reserveHeapSpace, reserveRowSpace, set, setColumn, setComplexColumn, setElement, setFlattenedColumn, setRow, toHDU, updateAfterDelete, writeModifier and TypeMethodDescriptionintAdds a column of bits.intAdds a new column with the specified data array, with some default mappings.intaddColumn(BinaryTable.ColumnDesc descriptor) Adds a new empty column to the table to the specification.intaddComplexColumn(Object o, Class<?> decimalType) Adds a column of complex values stored as the specified decimal type of components in the FITS.intaddFlattenedColumn(Object o, int... dims) Deprecated.(for internal use) No longer used, will be removed in the futureintAdds a row to the table.intaddStringColumn(String[] o) Adds a column of string values (one per row), optimized for storage size.intAdds a new variable-length data column, populating it with the specified data object.voidcompact()Discard the information about the original heap size (if this table was read from an input), and instead use the real size of the actual heap (plus reserved space around it) when writing to an output.final booleanChecks if this table contains a heap for storing variable length arrays (VLAs).booleanconvertToBits(int col) Converts a column from FITS logical values to bits.copy()Returns an independent copy of the binary table.static voidcreateColumnDataFor(BinaryTable table) Deprecated.(for internal use) It may become a private method in the future.longDefragments the heap area of this table, compacting the heap area, and returning the number of bytes by which the heap size has been reduced.voiddeleteColumns(int start, int len) Removes a set of consecutive columns from this table, without updating assocu=iated the header information for the columns that were removed.voiddeleteRows(int row, int len) Removes a set of consecutive rows from this table without updating any associated header information for an encompassing HDU.static BinaryTablefromColumnMajor(Object[] columns) Creates a binary table from existing data in column-major format order.static BinaryTablefromRowMajor(Object[][] table) Creates a binary table from existing table data in row-major format.get(int row, int col) Returns a table element using the usual Java boxing for primitive scalar (singleton) entries, or packaging complex values asComplexValue, or as appropriate primitive or object arrays.getArrayElement(int row, int col) Returns a table element as an array of the FITS storage type.getArrayElementAs(int row, int col, Class<?> asType) Returns a numerical table element as an array of a specific underlying other numerical type.Class<?>[]getBases()Deprecated.(for internal use) Ambiguous, useBinaryTable.ColumnDesc.getElementClass()instead.getColumn(int col) Returns the data for a particular column in as an array of elements.ColumnTable<?> getData()Returns the underlying Java representation of the data contained in this HDU's data segment.getDescriptor(int column) Returns the column descriptor of a given column in this tablegetDescriptor(String name) Returns the (first) column descriptor whose name matches the specified value.static BinaryTable.ColumnDescgetDescriptor(Header header, int col) Extracts a column descriptor from the FITS header for a given column indexint[][]Deprecated.(for internal use) UseBinaryTable.ColumnDesc.getEntryShape()to access the shape of Java elements individually for columns instead.final doublegetDouble(int row, int col) Returns the decimal value, if possible, of a scalar table entry.getElement(int row, int col) Returns a table element as a Java array.Object[]Deprecated.(for internal use) It may be private in the future.getFlattenedColumn(int col) Deprecated.(for internal use) It may be reduced to private visibility in the future.final BooleangetLogical(int row, int col) Returns the boolean value, if possible, for scalar elements.final longgetLong(int row, int col) Returns a 64-bit integer value, if possible, of a scalar table entry.Object[]Deprecated.(for internal use) UseBinaryTable.getElement(int, int)instead for low-level reading of tables in deferred mode.intgetNCols()Returns the number of columns contained in this table.intgetNRows()Returns the number of columns contained in this table.final NumbergetNumber(int row, int col) Returns the numerical value, if possible, for scalar elements.getRawElement(int row, int col) Deprecated.(for internal use) Will reduce visibility in the future.Object[]getRow(int row) Returns an array of elements in a particualr table row.int[]getSizes()Deprecated.(for internal use) UseBinaryTable.ColumnDesc.getElementCount()instead.final StringgetString(int row, int col) Returns the string value, if possible, for scalar elements.char[]getTypes()Deprecated.(for internal use) UseBinaryTable.ColumnDesc.getElementClass()instead.intReturns the Java index of the first column by the specified name.static int[]parseTDims(String tdims) Deprecated.(for internal use) It may be reduced to private visibility in the future.voidread(ArrayDataInput in) Reads the data or skips over it for reading later, depending on whether reading from a stream or a random acessible input, respectively.voidreserveHeapSpace(int bytes) Reserves space in the file at the end of the heap for future heap growth (e.g. different/longer or new VLA entries).voidreserveRowSpace(int rows) Reserves space for future addition of rows at the end of the regular table.voidThe Swiss-army knife of setting table entries, including Java boxing, and with some support for automatic type conversions.voidSets new data for a table column.booleansetComplexColumn(int index) Convert a column from float/double to float complex/double complex.voidsetElement(int row, int col, Object o) Consider using the more Java-friendlyBinaryTable.set(int, int, Object)with implicit scalar type conversions.voidsetFlattenedColumn(int col, Object data) Deprecated.(for internal use) It may be reduced to private visibility in the future.voidSets new data for a table row.toHDU()Returns an approprotae HDU object that encapsulates this FITS data, and contains the minimal mandatory header description for that data.voidupdateAfterDelete(int oldNcol, Header hdr) Deprecated.It is not entirely foolproof for keeping the header in sync -- it is better to (re)wrap tables in a new HDU after column deletions, and then edit the new header as necessary to incorporate custom entries.voidwrite(ArrayDataOutput os) Writes the contents of the element to a data sink, adding padding as necessary if the element (such as a header or data segment) is expected to complete the FITS block of 2880 bytes.Methods inherited from class Data
calcChecksum, detach, getFileOffset, getKernel, getSize, isDeferred, isEmpty, reset, rewrite, rewriteableModifier and TypeMethodDescriptionlongComputes and returns the FITS checksum for this data, for example to compare against the storedDATASUMin the FITS header (e.g. viaBasicHDU.getStoredDatasum()).voiddetach()Detaches this data object from the input (if any), such as a file or stream, but not before loading data from the previously assigned input into memory.longReturns the byte offset at which this element starts ina file.final ObjectSame asData.getData().longgetSize()Returns the size of this elements in the FITS representation.booleanChecks if the data should be assumed to be in deferred read mode.booleanisEmpty()Checks if the data content is currently empty, i.e. no actual data is currently stored in memory.booleanreset()Reset the input stream to point to the beginning of this elementvoidrewrite()Rewrite the contents of the element in place.booleanChecks if we can write this element back to its source.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TableData
addRowEntries, setRowEntriesModifier and TypeMethodDescriptiondefault intaddRowEntries(Object... entries) LikeTableData.addRow(Object[]), but with a vararg list of row entries.default voidsetRowEntries(int row, Object... entries) LikeTableData.setRow(int, Object[])but with vararg list of entries.
-
Method Details
-
fillHeader
- Overrides:
fillHeaderin classBinaryTable- Throws:
FitsException
-