|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.ac.starlink.table.StreamStarTableWriter | +--uk.ac.starlink.fits.FitsTableWriter
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:
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).
Null cell values are written using some zero-like value, not a proper blank value. Doing this right would require some changes to the tables infrastructure.
Constructor Summary | |
FitsTableWriter()
|
Method Summary | |
String |
getFormatName()
Returns "FITS". |
boolean |
looksLikeFile(String location)
Returns true if location ends with something like ".fit" or ".fits" or ".fts". |
protected void |
writePrimary(StarTable startab,
DataOutputStream strm)
Called from writeStarTable(uk.ac.starlink.table.StarTable, java.io.OutputStream) to write headers prior to the
BINTABLE header which contains the table proper. |
void |
writeStarTable(StarTable startab,
OutputStream out)
Writes a table in FITS binary format. |
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 |
public FitsTableWriter()
Method Detail |
public String getFormatName()
public boolean looksLikeFile(String location)
location
- filename
public void writeStarTable(StarTable startab, OutputStream out) throws IOException
startab
- the table to writeout
- the output stream to which startab should be
written
IOException
- if there is some I/O errorprotected void writePrimary(StarTable startab, DataOutputStream strm) throws IOException
writeStarTable(uk.ac.starlink.table.StarTable, java.io.OutputStream)
to write headers prior to the
BINTABLE header which contains the table proper.
The default implementation writes an empty primary HDU;
subclasses may write one or more headers, though the first one
should be a legal primary FITS HDU.
startab
- the table which will be written into the next HDUstrm
- the stream down which it will be written
IOException
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |