Class UnifiedFitsTableWriter

java.lang.Object
uk.ac.starlink.table.StreamStarTableWriter
uk.ac.starlink.fits.AbstractFitsTableWriter
uk.ac.starlink.fits.FitsTableWriter
uk.ac.starlink.votable.UnifiedFitsTableWriter
All Implemented Interfaces:
uk.ac.starlink.table.Documented, uk.ac.starlink.table.formats.DocumentedIOHandler, uk.ac.starlink.table.MultiStarTableWriter, uk.ac.starlink.table.StarTableWriter
Direct Known Subclasses:
UnifiedFitsTableWriter.Col

public class UnifiedFitsTableWriter extends uk.ac.starlink.fits.FitsTableWriter implements uk.ac.starlink.table.formats.DocumentedIOHandler
FITS output handler that supports multiple different options.
Since:
12 Mar 2024
Author:
Mark Taylor
See Also:
  • BeanConfig
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Subclass with default configuration but colfits set true.

    Nested classes/interfaces inherited from class uk.ac.starlink.fits.FitsTableWriter

    uk.ac.starlink.fits.FitsTableWriter.PrimaryType, uk.ac.starlink.fits.FitsTableWriter.VarArrayMode
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final uk.ac.starlink.fits.FitsTableWriter.PrimaryType
    Primary HDU type containing a minimal primary HDU.
    static final uk.ac.starlink.fits.FitsTableWriter.PrimaryType
    Primary HDU type that does not write a primary HDU.
    static final uk.ac.starlink.fits.FitsTableWriter.PrimaryType
    Primary HDU type containing full metadata for the output table in VOTable format.
  • Constructor Summary

    Constructors
    Constructor
    Description
    No-arg constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    static uk.ac.starlink.fits.FitsTableWriter.PrimaryType
    Returns a PrimaryType that writes a FITS-plus-style VOTable primary HDU, with a specified version of the VOTable standard.
    boolean
     
     
     
    boolean
     
    void
    setColfits(boolean colfits)
     
    void
    setPrimaryType(uk.ac.starlink.fits.FitsTableWriter.PrimaryType primaryType)
     
    void
    setVarArray(uk.ac.starlink.fits.FitsTableWriter.VarArrayMode varArray)
     
    static uk.ac.starlink.fits.FitsTableWriter.PrimaryType
    Decodes a string as a PrimaryType.

    Methods inherited from class uk.ac.starlink.fits.FitsTableWriter

    createSerializer, getAllowSignedByte, getPrimaryType, getStoragePolicy, getVarArray, isColfits, setStoragePolicy, writeStarTables

    Methods inherited from class uk.ac.starlink.fits.AbstractFitsTableWriter

    getAllowZeroLengthString, getConfig, getCurrentDate, getFormatName, getMetadataCards, getMimeType, getPadCharacter, getWide, getWriteDate, setAllowSignedByte, setAllowZeroLengthString, setFormatName, setPadCharacter, setWide, setWriteDate, writePrimaryHDU, writeStarTable, 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.formats.DocumentedIOHandler

    readText

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

    writeStarTable
  • Field Details

    • VOTABLE_PRIMARY_TYPE

      public static final uk.ac.starlink.fits.FitsTableWriter.PrimaryType VOTABLE_PRIMARY_TYPE
      Primary HDU type containing full metadata for the output table in VOTable format. This corresponds to "fits-plus" format. The default version of VOTable is used.
    • BASIC_PRIMARY_TYPE

      public static final uk.ac.starlink.fits.FitsTableWriter.PrimaryType BASIC_PRIMARY_TYPE
      Primary HDU type containing a minimal primary HDU. This corresponds to basic FITS format.
    • NONE_PRIMARY_TYPE

      public static final uk.ac.starlink.fits.FitsTableWriter.PrimaryType NONE_PRIMARY_TYPE
      Primary HDU type that does not write a primary HDU.
  • Constructor Details

    • UnifiedFitsTableWriter

      public UnifiedFitsTableWriter()
      No-arg constructor.
  • Method Details

    • getExtensions

      public String[] getExtensions()
      Specified by:
      getExtensions in interface uk.ac.starlink.table.formats.DocumentedIOHandler
    • looksLikeFile

      public boolean looksLikeFile(String location)
      Specified by:
      looksLikeFile in interface uk.ac.starlink.table.StarTableWriter
      Overrides:
      looksLikeFile in class uk.ac.starlink.fits.FitsTableWriter
    • docIncludesExample

      public boolean docIncludesExample()
      Specified by:
      docIncludesExample in interface uk.ac.starlink.table.formats.DocumentedIOHandler
    • getXmlDescription

      public String getXmlDescription()
      Specified by:
      getXmlDescription in interface uk.ac.starlink.table.Documented
    • setPrimaryType

      @ConfigMethod(property="primary", usage="basic|votable[n.n]|none", example="basic", sequence=110, doc="<p>Determines what is written into the Primary HDU.\nThe Primary HDU (PHDU) of a FITS file cannot contain a table;\nthe following options are available.\n<dl>\n<dt><code>basic</code></dt>\n<dd><p>A minimal PHDU is written with no interesting content\n </p></dd><dt><code>votable[n.n]</code></dt>\n<dd><p>The PHDU contains the full table metadata as the text\n of a VOTable document, along with headers to indicate\n that this has been done.\n This corresponds to the \"<strong>fits-plus</strong>\"\n format.\n The \"<code>[n.n]</code>\" part\n is optional, but if included\n (e.g. \"<code>votable1.5</code>\")\n indicates the version of the VOTable format to use.\n </p></dd>\n<dt><code>none</code></dt>\n<dd><p>No PHDU is written.\n The output is therefore not a legal FITS file,\n but it can be appended to an existing FITS file that\n already has a PHDU and perhaps other extension HDUs.\n </p></dd>\n</dl>\n</p>") public void setPrimaryType(uk.ac.starlink.fits.FitsTableWriter.PrimaryType primaryType)
      Overrides:
      setPrimaryType in class uk.ac.starlink.fits.FitsTableWriter
    • setColfits

      @ConfigMethod(property="col", sequence=120, doc="<p>If true, writes data in column-oriented format.\nIn this case, the output is a single-row table in which\neach cell is an array value holding the data\nfor an entire column.\nAll the arrays in the row have the same length,\nwhich is the row count of the table being represented.\nThis corresponds to the \"<strong>colfits</strong>\" format.\n</p>") public void setColfits(boolean colfits)
      Overrides:
      setColfits in class uk.ac.starlink.fits.FitsTableWriter
    • setVarArray

      @ConfigMethod(property="var", sequence=130, example="true", doc="<p>Determines how variable-length array-valued columns\nwill be stored.\n<code>True</code> stores variable-length array values\nafter the main part of the table in the heap,\nwhile <code>false</code> stores all arrays as fixed-length\n(with a length equal to that of the longest array\nin the column) in the body of the table.The options <code>P</code> or <code>Q</code> can be used\nto force 32-bit or 64-bit pointers for indexing into the heap,\nbut it\'s not usually necessary since a suitable choice\nis otherwise made from the data.\n</p>") public void setVarArray(uk.ac.starlink.fits.FitsTableWriter.VarArrayMode varArray)
      Overrides:
      setVarArray in class uk.ac.starlink.fits.FitsTableWriter
    • createVOTablePrimaryType

      public static uk.ac.starlink.fits.FitsTableWriter.PrimaryType createVOTablePrimaryType(VOTableVersion vers)
      Returns a PrimaryType that writes a FITS-plus-style VOTable primary HDU, with a specified version of the VOTable standard.
      Parameters:
      vers - VOTable version
      Returns:
      new PHDU type
    • toPrimaryTypeInstance

      public static uk.ac.starlink.fits.FitsTableWriter.PrimaryType toPrimaryTypeInstance(String txt)
      Decodes a string as a PrimaryType.

      This public static method is used by BeanConfig.

      Parameters:
      txt - string representation of a PrimaryType
      Returns:
      primary type instance, or null if txt doesn't look like one