Package uk.ac.starlink.votable
Class VOTableFitsTableWriter
- java.lang.Object
-
- uk.ac.starlink.table.StreamStarTableWriter
-
- uk.ac.starlink.fits.AbstractFitsTableWriter
-
- uk.ac.starlink.votable.VOTableFitsTableWriter
-
- All Implemented Interfaces:
uk.ac.starlink.table.MultiStarTableWriter,uk.ac.starlink.table.StarTableWriter
- Direct Known Subclasses:
ColFitsPlusTableWriter,FitsPlusTableWriter
public abstract class VOTableFitsTableWriter extends uk.ac.starlink.fits.AbstractFitsTableWriterTableWriter which writes table data into the first extension of a FITS file, UnlikeFitsTableWriterhowever, 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. Tables stored using this (non-standard) mechanism have all the rich metadata associated with VOTables, and benefit from the compactness of FITS tables, withouth the considerable disadvantage of being split into two files.- Since:
- 26 Aug 2004
- Author:
- Mark Taylor (Starlink)
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedVOTableFitsTableWriter(java.lang.String formatName)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidcustomisePrimaryHeader(nom.tam.fits.Header hdr)Hook for adding custom entries to the FITS header which is written to the primary HDU.booleanisMagic(byte[] buffer)Determines whether a given byte buffer looks like it contains the start of a primary header written by this writer.protected booleanisMagic(int icard, java.lang.String key, java.lang.String value)Tests a header card to see if it looks like part of the magic number for the format written by this handler.voidsetVotableVersion(VOTableVersion votVersion)Sets the version of the VOTable standard to use for encoding metadata in the primary HDU.voidwriteStarTables(uk.ac.starlink.table.TableSequence tableSeq, java.io.OutputStream out)-
Methods inherited from class uk.ac.starlink.fits.AbstractFitsTableWriter
addMetadata, createSerializer, getCurrentDate, getFormatName, getMimeType, setFormatName, writePrimaryHDU, writeStarTable, writeStarTables, writeTableHDU
-
-
-
-
Method Detail
-
writeStarTables
public void writeStarTables(uk.ac.starlink.table.TableSequence tableSeq, java.io.OutputStream out) throws java.io.IOException- Specified by:
writeStarTablesin interfaceuk.ac.starlink.table.MultiStarTableWriter- Overrides:
writeStarTablesin classuk.ac.starlink.fits.AbstractFitsTableWriter- Throws:
java.io.IOException
-
setVotableVersion
public void setVotableVersion(VOTableVersion votVersion)
Sets the version of the VOTable standard to use for encoding metadata in the primary HDU.- Parameters:
votVersion- VOTable version to use
-
customisePrimaryHeader
protected abstract void customisePrimaryHeader(nom.tam.fits.Header hdr) throws nom.tam.fits.HeaderCardExceptionHook 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.- Parameters:
hdr- header- Throws:
nom.tam.fits.HeaderCardException
-
isMagic
public boolean isMagic(byte[] buffer)
Determines whether a given byte buffer looks like it contains the start of a primary header written by this writer. Calls the protectedisMagic(int,java.lang.String,java.lang.String)method.- Parameters:
buffer- start of a file- Returns:
- true iff
bufferlooks like it contains a file written by this handler
-
isMagic
protected boolean isMagic(int icard, java.lang.String key, java.lang.String value)Tests a header card to see if it looks like part of the magic number for the format written by this handler. TheVOTableFitsTableWriterimplementation 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 incustomisePrimaryHeader(nom.tam.fits.Header)).- Parameters:
icard- 0-based card indexkey- card namevalue- card value- Returns:
- true iff the presented card is one that could have been written by this writer
-
-