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:
    MultiStarTableWriter, 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
  See Also:
    HEALPix-FITS convention

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HealpixFitsTableWriter()` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected FitsTableSerializer` | `createSerializer(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, getAllowSignedByte, getAllowZeroLengthString, getConfig, getCurrentDate, getFormatName, getMimeType, getPadCharacter, getWide, getWriteDate, setAllowSignedByte, setAllowZeroLengthString, setFormatName, setPadCharacter, setWide, setWriteDate, writePrimaryHDU, writeStarTable, writeStarTables, writeStarTables, writeTableHDU`

    - ### Methods inherited from class uk.ac.starlink.table.StreamStarTableWriter

      `writeStarTable, writeStarTable`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface uk.ac.starlink.table.StarTableWriter

      `writeStarTable`

- - ### Constructor Detail

    - #### HealpixFitsTableWriter

          public HealpixFitsTableWriter()

      Constructor.

  - ### Method Detail

    - #### looksLikeFile

          public boolean looksLikeFile(java.lang.String location)

      Returns false.
      Parameters:
        `location` - the location name (probably filename)
      Returns:
        `true` iff it looks like a file this writer would normally write

    - #### createSerializer

          protected FitsTableSerializer createSerializer(StarTable table)
                                                  throws 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
        `TableFormatException`