uk.ac.starlink.votable
Class FitsPlusTableWriter

java.lang.Object
  |
  +--uk.ac.starlink.table.StreamStarTableWriter
        |
        +--uk.ac.starlink.fits.FitsTableWriter
              |
              +--uk.ac.starlink.votable.FitsPlusTableWriter
All Implemented Interfaces:
StarTableWriter

public class FitsPlusTableWriter
extends FitsTableWriter

TableWriter which writes table data into the first extension of a FITS file, Unlike FitsTableWriter however, the primary extension is not left contentless, instead it gets the text of a DATA-less VOTable written into it. This VOTable describes the metadata of the table, as if the DATA element contained a FITS element referencing the first extension HDU of the file. Tables stored in this format have all the rich metadata associated with VOTables, and benefit from the compactness of FITS tables, without the considerable disdvantage of being split into two files.

The header cards in the primary HDU look like this:

     SIMPLE  =                    T / Standard FITS format
     BITPIX  =                    8 / Character data
     NAXIS   =                    1 / Text string
     NAXIS1  =                 nnnn / Number of characters
     VOTMETA =                    T / Table metadata in VOTABLE format
     EXTEND  =                    T / There are standard extensions
 
the VOTMETA card in particular marking that this HDU contains VOTable metadata.

Since:
26 Aug 2004

Constructor Summary
FitsPlusTableWriter()
           
 
Method Summary
 String getFormatName()
          Returns "FITS".
 String getMimeType()
          Returns a string suitable for use as the value of a MIME Content-Type header.
static StarTableWriter[] getStarTableWriters()
          Returns a list of FITS-plus table writers with variant values of attributes.
 boolean looksLikeFile(String location)
          Returns true if location ends with something like ".fit" or ".fits".
protected  void writePrimary(StarTable table, FitsTableSerializer fitser, DataOutputStream strm)
          Attempts to write a VOTable containing metadata for table into the primary HDU.
 
Methods inherited from class uk.ac.starlink.fits.FitsTableWriter
writeStarTable
 
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

FitsPlusTableWriter

public FitsPlusTableWriter()
Method Detail

getFormatName

public String getFormatName()
Description copied from class: FitsTableWriter
Returns "FITS".

Specified by:
getFormatName in interface StarTableWriter
Overrides:
getFormatName in class FitsTableWriter
Returns:
format name

getMimeType

public String getMimeType()
Description copied from interface: StarTableWriter
Returns a string suitable for use as the value of a MIME Content-Type header. If no suitable MIME type is available or known, one of "application/octet-stream" (for binary formats) or "text/plain" for ASCII ones) is recommended.

Specified by:
getMimeType in interface StarTableWriter
Overrides:
getMimeType in class FitsTableWriter
Returns:
MIME content type

looksLikeFile

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

Specified by:
looksLikeFile in interface StarTableWriter
Overrides:
looksLikeFile in class FitsTableWriter
Parameters:
location - filename
Returns:
true if it sounds like a fits file

writePrimary

protected void writePrimary(StarTable table,
                            FitsTableSerializer fitser,
                            DataOutputStream strm)
                     throws IOException
Attempts to write a VOTable containing metadata for table into the primary HDU.

Overrides:
writePrimary in class FitsTableWriter
Parameters:
table - the table which will be written into the next HDU
fitser - fits serializer initialised from startab
strm - the stream down which it will be written
IOException

getStarTableWriters

public static StarTableWriter[] getStarTableWriters()
Returns a list of FITS-plus table writers with variant values of attributes. In fact this just returns two functionally identical instances but with different format names: one is "fits" and the other is "fits-plus".

Returns:
table writers

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