Class ColFitsTableSerializer
java.lang.Object
uk.ac.starlink.fits.ColFitsTableSerializer
- All Implemented Interfaces:
FitsTableSerializer
Object which can serialize a StarTable to a data stream as a one-row FITS
file in which each element contains an entire column of the table.
- Since:
- 26 Jun 2006
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionColFitsTableSerializer(FitsTableSerializerConfig config, uk.ac.starlink.table.StarTable table) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetBadValue(int icol) Returns the bad value (text of the TNULLnn card), if any, used for a given column.int[]getDimensions(int icol) Returns the dimensions of the items which will be output for a given column.chargetFormatChar(int icol) Returns the FITS TFORM letter which describes the type of data output for a given column.Returns header cards suitable for the HDU which will contain the table.longReturns the number of rows which will be output.voidwriteData(DataOutput out) Write the FITS data unit populated by this serializer.
-
Constructor Details
-
ColFitsTableSerializer
public ColFitsTableSerializer(FitsTableSerializerConfig config, uk.ac.starlink.table.StarTable table) throws IOException Constructor.- Parameters:
config- configurationtable- table to serialize- Throws:
IOException- if it won't be possible to write the given table
-
-
Method Details
-
getHeader
Description copied from interface:FitsTableSerializerReturns header cards suitable for the HDU which will contain the table. Additional metadata and an END marker will be added after these cards, so the returned array must not contain the END card.- Specified by:
getHeaderin interfaceFitsTableSerializer- Returns:
- header cards
-
writeData
Write the FITS data unit populated by this serializer.- Specified by:
writeDatain interfaceFitsTableSerializer- Parameters:
out- destination stream- Throws:
IOException
-
getRowCount
public long getRowCount()Description copied from interface:FitsTableSerializerReturns the number of rows which will be output.- Specified by:
getRowCountin interfaceFitsTableSerializer- Returns:
- row count
-
getFormatChar
public char getFormatChar(int icol) Description copied from interface:FitsTableSerializerReturns the FITS TFORM letter which describes the type of data output for a given column. This is as described by the FITS standard - 'J' for 4-byte integer, 'A' for characters, etc. If the column is not being output,(char)0will be returned.- Specified by:
getFormatCharin interfaceFitsTableSerializer- Parameters:
icol- column to query- Returns:
- format letter for data in column
icol, or 0 for a column being skipped
-
getDimensions
public int[] getDimensions(int icol) Description copied from interface:FitsTableSerializerReturns the dimensions of the items which will be output for a given column. This will benullonly if that column is not being output. Otherwise it will be a zero-element array for a scalar, 1-element array for a vector, etc.- Specified by:
getDimensionsin interfaceFitsTableSerializer- Parameters:
icol- column to query- Returns:
- dimensions array for data in column
icolornullfor a column being skipped
-
getBadValue
Description copied from interface:FitsTableSerializerReturns the bad value (text of the TNULLnn card), if any, used for a given column.- Specified by:
getBadValuein interfaceFitsTableSerializer- Parameters:
icol- column to query- Returns:
- blank value string, or null if there is none or the column is being skipped
-