uk.ac.starlink.fits
Class FitsTableSerializer

java.lang.Object
  |
  +--uk.ac.starlink.fits.FitsTableSerializer

public class FitsTableSerializer
extends Object

Class which knows how to do the various bits of serializing a StarTable to FITS BINTABLE format. This does the hard work for FitsTableWriter.


Constructor Summary
FitsTableSerializer(StarTable table)
          Constructs a serializer which will be able to write a given StarTable.
 
Method Summary
 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.
 void writeData(DataOutput strm)
          Writes the data part of the BINTABLE extension HDU which holds the table data.
 void writeHeader(DataOutput strm)
          Writes the header block for the BINTABLE extension HDU which holds the table data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FitsTableSerializer

public FitsTableSerializer(StarTable table)
                    throws IOException
Constructs a serializer which will be able to write a given StarTable.

Parameters:
table - the table to be written
Method Detail

writeHeader

public void writeHeader(DataOutput strm)
                 throws IOException
Writes the header block for the BINTABLE extension HDU which holds the table data.

Parameters:
strm - destination stream
IOException

writeData

public void writeData(DataOutput strm)
               throws IOException
Writes the data part of the BINTABLE extension HDU which holds the table data.

Parameters:
strm - destination stream
IOException

getFormatChar

public char getFormatChar(int icol)
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.

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)
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.

Parameters:
icol - column to query
Returns:
dimensions array for data in column icol or null for a column being skipped

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