uk.ac.starlink.fits
Class FitsTableWriter

java.lang.Object
  extended byuk.ac.starlink.table.StreamStarTableWriter
      extended byuk.ac.starlink.fits.AbstractFitsTableWriter
          extended byuk.ac.starlink.fits.FitsTableWriter
All Implemented Interfaces:
StarTableWriter

public class FitsTableWriter
extends AbstractFitsTableWriter

Handles writing of a StarTable in FITS binary format. Not all columns can be written to a FITS table, only those ones whose contentClass is in the following list:

In all other cases a warning message will be logged and the column will be ignored for writing purposes.

Output is currently to fixed-width columns only. For StarTable columns of variable size, a first pass is made through the table data to determine the largest size they assume, and the size in the output table is set to the largest of these. Excess space is padded with some sort of blank value (NaN for floating point values, spaces for strings, zero-like values otherwise).


Constructor Summary
FitsTableWriter()
           
 
Method Summary
protected  FitsTableSerializer createSerializer(StarTable table)
          Provides a suitable serializer for a given table.
 boolean looksLikeFile(String location)
          Returns true if location ends with something like ".fit" or ".fits" or ".fts".
 void writePrimaryHDU(StarTable startab, FitsTableSerializer fitser, DataOutput out)
          Writes the primary HDU.
 
Methods inherited from class uk.ac.starlink.fits.AbstractFitsTableWriter
addMetadata, getCurrentDate, getFormatName, getMimeType, setFormatName, writeStarTable, writeTableHDU
 
Methods inherited from class uk.ac.starlink.table.StreamStarTableWriter
writeStarTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FitsTableWriter

public FitsTableWriter()
Method Detail

looksLikeFile

public boolean looksLikeFile(String location)
Returns true if location ends with something like ".fit" or ".fits" or ".fts".

Parameters:
location - filename
Returns:
true if it sounds like a fits file

writePrimaryHDU

public void writePrimaryHDU(StarTable startab,
                            FitsTableSerializer fitser,
                            DataOutput out)
                     throws IOException
Description copied from class: AbstractFitsTableWriter
Writes the primary HDU. This cannot contain the table since BINTABLE HDUs can only be extensions.

Specified by:
writePrimaryHDU in class AbstractFitsTableWriter
Parameters:
startab - the table which will be written into the next HDU
fitser - fits serializer initialised from table
out - destination stream
Throws:
IOException

createSerializer

protected FitsTableSerializer createSerializer(StarTable table)
                                        throws IOException
Description copied from class: AbstractFitsTableWriter
Provides a suitable serializer for a given table.

Specified by:
createSerializer in class AbstractFitsTableWriter
Parameters:
table - table to serialize
Returns:
FITS serializer
Throws:
IOException

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