uk.ac.starlink.fits
Class ColFitsTableSerializer

java.lang.Object
  |
  +--uk.ac.starlink.fits.ColFitsTableSerializer
All Implemented Interfaces:
FitsTableSerializer

public class ColFitsTableSerializer
extends Object
implements 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

Constructor Summary
ColFitsTableSerializer(StarTable table)
          Constructor.
 
Method Summary
 String getBadValue(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.
 char getFormatChar(int icol)
          Returns the FITS TFORM letter which describes the type of data output for a given column.
 Header getHeader()
          Returns a header suitable for the HDU which will contain the table.
 long getRowCount()
          Returns the number of rows which will be output.
 void writeData(DataOutput out)
          Write the FITS data unit populated by this serializer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColFitsTableSerializer

public ColFitsTableSerializer(StarTable table)
                       throws IOException
Constructor.

Parameters:
table - table to serialize
Method Detail

getHeader

public Header getHeader()
                 throws HeaderCardException
Description copied from interface: FitsTableSerializer
Returns a header suitable for the HDU which will contain the table.

Specified by:
getHeader in interface FitsTableSerializer
Returns:
header object
HeaderCardException

writeData

public void writeData(DataOutput out)
               throws IOException
Write the FITS data unit populated by this serializer.

Specified by:
writeData in interface FitsTableSerializer
Parameters:
out - destination stream
IOException

getRowCount

public long getRowCount()
Description copied from interface: FitsTableSerializer
Returns the number of rows which will be output.

Specified by:
getRowCount in interface FitsTableSerializer
Returns:
row count

getFormatChar

public char getFormatChar(int icol)
Description copied from interface: FitsTableSerializer
Returns 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)0 will be returned.

Specified by:
getFormatChar in interface FitsTableSerializer
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: FitsTableSerializer
Returns the dimensions of the items which will be output for a given column. This will be null only 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:
getDimensions in interface FitsTableSerializer
Parameters:
icol - column to query
Returns:
dimensions array for data in column icol or null for a column being skipped

getBadValue

public String getBadValue(int icol)
Description copied from interface: FitsTableSerializer
Returns the bad value (text of the TNULLnn card), if any, used for a given column.

Specified by:
getBadValue in interface FitsTableSerializer
Parameters:
icol - column to query
Returns:
blank value string, or null if there is none or the column is being skipped

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.