Package uk.ac.starlink.fits
Class HealpixFitsTableWriter
- java.lang.Object
-
- uk.ac.starlink.table.StreamStarTableWriter
-
- uk.ac.starlink.fits.AbstractFitsTableWriter
-
- uk.ac.starlink.fits.HealpixFitsTableWriter
-
- All Implemented Interfaces:
uk.ac.starlink.table.MultiStarTableWriter
,uk.ac.starlink.table.StarTableWriter
public class HealpixFitsTableWriter extends AbstractFitsTableWriter
TableWriter implementation that writes FITS files using the HEALPix-FITS convention. This convention is somewhat standard for encoding HEALPix maps in FITS files.It is not always necessary to use this output handler, since the normal FitsTableWriter also inserts the relevant HEALPix-FITS headers if it encounters a table that looks like a HEALPix map. However, this implementation differs in a couple of ways: if it is presented with a table that does not look like a HEALPix map, it will throw a TableFormatException rather than just performing non-HEALPix output, and it will rearrange the columns so that the healpix index is in the first column and named "PIXEL" if required.
- Since:
- 6 Dec 2018
- Author:
- Mark Taylor
- See Also:
- HEALPix-FITS convention
-
-
Constructor Summary
Constructors Constructor Description HealpixFitsTableWriter()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FitsTableSerializer
createSerializer(uk.ac.starlink.table.StarTable table)
Returns a StandardFitsTableSerializer only if the table looks like a HEALpix map.boolean
looksLikeFile(java.lang.String location)
Returns false.-
Methods inherited from class uk.ac.starlink.fits.AbstractFitsTableWriter
addMetadata, getCurrentDate, getFormatName, getMimeType, setFormatName, writePrimaryHDU, writeStarTable, writeStarTables, writeStarTables, writeTableHDU
-
-
-
-
Method Detail
-
looksLikeFile
public boolean looksLikeFile(java.lang.String location)
Returns false.
-
createSerializer
protected FitsTableSerializer createSerializer(uk.ac.starlink.table.StarTable table) throws uk.ac.starlink.table.TableFormatException, java.io.IOException
Returns a StandardFitsTableSerializer only if the table looks like a HEALpix map. The serializer may rearrange the columns so that the pixel index column comes first. If the table doesn't look like HEALpix, a TableFormatException will be thrown.- Specified by:
createSerializer
in classAbstractFitsTableWriter
- Parameters:
table
- table to serialize- Returns:
- FITS serializer
- Throws:
java.io.IOException
- if the table can't be writtenuk.ac.starlink.table.TableFormatException
-
-