uk.ac.starlink.votable
Class ColFitsPlusTableWriter

java.lang.Object
  extended by uk.ac.starlink.table.StreamStarTableWriter
      extended by uk.ac.starlink.fits.AbstractFitsTableWriter
          extended by uk.ac.starlink.votable.VOTableFitsTableWriter
              extended by uk.ac.starlink.votable.ColFitsPlusTableWriter
All Implemented Interfaces:
MultiStarTableWriter, StarTableWriter

public class ColFitsPlusTableWriter
extends VOTableFitsTableWriter

Handles writing of a StarTable in a column-oriented FITS binary table format. The table data is stored in a BINTABLE extension which has a single row; each cell in this row contains the data for an entire column of the represented table. The primary HDU is a byte array containing a VOTable representation of the table metadata, as for FitsPlusTableWriter.

This rather specialised format may provide good performance for certain operations on very large, especially very wide, tables. Although it is FITS and can therefore be used in principle for data interchange, in practice most non-STIL processors are unlikely to be able to do much useful with it.

Since:
21 Jun 2006

Constructor Summary
ColFitsPlusTableWriter()
          Default constructor.
ColFitsPlusTableWriter(String name, WideFits wide)
          Custom constructor.
 
Method Summary
protected  FitsTableSerializer createSerializer(StarTable table)
          Provides a suitable serializer for a given table.
protected  void customisePrimaryHeader(nom.tam.fits.Header hdr)
          Hook for adding custom entries to the FITS header which is written to the primary HDU.
protected  boolean isMagic(int icard, String key, String value)
          Tests a header card to see if it looks like part of the magic number for the format written by this handler.
 boolean looksLikeFile(String location)
          Indicates whether the destination is of a familiar form for this kind of writer.
 
Methods inherited from class uk.ac.starlink.votable.VOTableFitsTableWriter
isMagic, setVotableVersion, writeStarTables
 
Methods inherited from class uk.ac.starlink.fits.AbstractFitsTableWriter
addMetadata, getCurrentDate, getFormatName, getMimeType, setFormatName, writePrimaryHDU, writeStarTable, writeStarTables, 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
 
Methods inherited from interface uk.ac.starlink.table.StarTableWriter
writeStarTable
 

Constructor Detail

ColFitsPlusTableWriter

public ColFitsPlusTableWriter()
Default constructor.


ColFitsPlusTableWriter

public ColFitsPlusTableWriter(String name,
                              WideFits wide)
Custom constructor.

Parameters:
name - writer name
wide - convention for representing over-wide tables; null to avoid this convention
Method Detail

looksLikeFile

public boolean looksLikeFile(String location)
Description copied from interface: StarTableWriter
Indicates whether the destination is of a familiar form for this kind of writer. This may be used to guess what kind of format a table should be written in. Implementations should return true for values of location which look like the normal form for their output format, for instance one with the usual file extension.

Parameters:
location - the location name (probably filename)
Returns:
true iff it looks like a file this writer would normally write

customisePrimaryHeader

protected void customisePrimaryHeader(nom.tam.fits.Header hdr)
                               throws nom.tam.fits.HeaderCardException
Description copied from class: VOTableFitsTableWriter
Hook for adding custom entries to the FITS header which is written to the primary HDU. This is called just after the required cards (SIMPLE, BITPIX, NAXIS, NAXIS1 ) are added and just before the EXTEND card.

Specified by:
customisePrimaryHeader in class VOTableFitsTableWriter
Throws:
nom.tam.fits.HeaderCardException

isMagic

protected boolean isMagic(int icard,
                          String key,
                          String value)
Description copied from class: VOTableFitsTableWriter
Tests a header card to see if it looks like part of the magic number for the format written by this handler. The VOTableFitsTableWriter implementation tests that the first four cards read:
    SIMPLE = T
    BITPIX = 8
    NAXIS  = 1
    NAXIS1 = ???
 
Subclasses may override this to add tests for later cards (as written in VOTableFitsTableWriter.customisePrimaryHeader(nom.tam.fits.Header)).

Overrides:
isMagic in class VOTableFitsTableWriter
Parameters:
icard - 0-based card index
key - card name
value - card value
Returns:
true iff the presented card is one that could have been written by this writer

createSerializer

protected FitsTableSerializer createSerializer(StarTable table)
                                        throws IOException
Description copied from class: AbstractFitsTableWriter
Provides a suitable serializer for a given table. Note this should throw an IOException if it can be determined that the submitted table cannot be written by this writer, for instance if it has too many columns.

Specified by:
createSerializer in class AbstractFitsTableWriter
Parameters:
table - table to serialize
Returns:
FITS serializer
Throws:
IOException - if the table can't be written

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