Class 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 Detail

      • HealpixFitsTableWriter

        public HealpixFitsTableWriter()
        Constructor.
    • 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 class AbstractFitsTableWriter
        Parameters:
        table - table to serialize
        Returns:
        FITS serializer
        Throws:
        java.io.IOException - if the table can't be written
        uk.ac.starlink.table.TableFormatException