Package uk.ac.starlink.fits
Class FitsTableWriter
java.lang.Object
uk.ac.starlink.table.StreamStarTableWriter
uk.ac.starlink.fits.AbstractFitsTableWriter
uk.ac.starlink.fits.FitsTableWriter
- All Implemented Interfaces:
uk.ac.starlink.table.MultiStarTableWriter,uk.ac.starlink.table.StarTableWriter
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:
- Boolean
- Character
- Byte
- Short
- Integer
- Long
- Float
- Double
- Character
- String
- boolean[]
- char[]
- byte[]
- short[]
- int[]
- long[]
- float[]
- double[]
- String[]
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).
- Author:
- Mark Taylor (Starlink)
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.FitsTableWriter(String name, boolean allowSignedByte, WideFits wide) Deprecated.allows some configuration options but not others; use no-arg constructor and configuration methods instead -
Method Summary
Modifier and TypeMethodDescriptionprotected FitsTableSerializercreateSerializer(uk.ac.starlink.table.StarTable table) Provides a suitable serializer for a given table.booleanlooksLikeFile(String location) Returns true if location ends with something like ".fit" or ".fits" or ".fts".Methods inherited from class uk.ac.starlink.fits.AbstractFitsTableWriter
getAllowSignedByte, getAllowZeroLengthString, getConfig, getCurrentDate, getFormatName, getMetadataCards, getMimeType, getPadCharacter, getWide, getWriteDate, setAllowSignedByte, setAllowZeroLengthString, setFormatName, setPadCharacter, setWide, setWriteDate, writePrimaryHDU, writeStarTable, writeStarTables, writeStarTables, writeTableHDUMethods inherited from class uk.ac.starlink.table.StreamStarTableWriter
writeStarTable, writeStarTableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface uk.ac.starlink.table.StarTableWriter
writeStarTable
-
Constructor Details
-
FitsTableWriter
public FitsTableWriter()Default constructor. -
FitsTableWriter
Deprecated.allows some configuration options but not others; use no-arg constructor and configuration methods insteadDeprecated custom constructor.
-
-
Method Details
-
looksLikeFile
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
-
createSerializer
protected FitsTableSerializer createSerializer(uk.ac.starlink.table.StarTable table) throws IOException Description copied from class:AbstractFitsTableWriterProvides 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:
createSerializerin classAbstractFitsTableWriter- Parameters:
table- table to serialize- Returns:
- FITS serializer
- Throws:
IOException- if the table can't be written
-