Package nom.tam.fits

Class AsciiTableHDU

All Implemented Interfaces:
FitsElement

public class AsciiTableHDU extends TableHDU<AsciiTable>
FITS ASCII table header/data unit
  • Constructor Details

    • AsciiTableHDU

      public AsciiTableHDU(Header h, AsciiTable d)
      Create an ASCII table header/data unit.
      Parameters:
      h - the template specifying the ASCII table.
      d - the FITS data structure containing the table data.
  • Method Details

    • encapsulate

      public static AsciiTable encapsulate(Object o) throws FitsException
      Parameters:
      o - the array of object to create the ASCII table
      Returns:
      a ASCII table data structure from an array of objects representing the columns.
      Throws:
      FitsException - if the table could not be created.
    • isData

      public static boolean isData(Object o)
      Parameters:
      o - object representing the data
      Returns:
      true if this data is usable as an ASCII table.
    • isHeader

      public static boolean isHeader(Header header)
      Check that this is a valid ascii table header.
      Parameters:
      header - to validate.
      Returns:
      true if this is an ascii table header.
    • manufactureData

      public static Data manufactureData(Header hdr) throws FitsException
      Create a Data object to correspond to the header description.
      Parameters:
      hdr - the header to create the data for
      Returns:
      An unfilled Data object which can be used to read in the data for this HDU.
      Throws:
      FitsException - if the Data object could not be created from this HDU's Header
    • manufactureHeader

      public static Header manufactureHeader(Data d) throws FitsException
      Parameters:
      d - data to create a header for
      Returns:
      a created header to match the input data.
      Throws:
      FitsException - if the header could not b e created
    • addColumn

      public int addColumn(Object newCol) throws FitsException
      Description copied from class: TableHDU
      Add a column to the table without any associated header information.
      Overrides:
      addColumn in class TableHDU<AsciiTable>
      Parameters:
      newCol - the new column information. the newCol should be an Object[] where type of all of the constituents is identical. The length of data should match the other columns. Note: It is valid for data to be a 2 or higher dimensionality primitive array. In this case the column index is the first (in Java speak) index of the array. E.g., if called with int[30][20][10], the number of rows in the table should be 30 and this column will have elements which are 2-d integer arrays with TDIM = (10,20).
      Returns:
      the number of columns in the adapted table
      Throws:
      FitsException - if the operation failed
    • columnKeyStems

      protected IFitsHeader[] columnKeyStems()
      Specified by:
      columnKeyStems in class TableHDU<AsciiTable>
      Returns:
      the stems of the keywords that are associated with table columns. Users can supplement this with their own and call the appropriate deleteColumns fields.
    • info

      public void info(PrintStream stream)
      Description copied from class: BasicHDU
      Print out some information about this HDU.
      Specified by:
      info in class BasicHDU<AsciiTable>
      Parameters:
      stream - the printstream to write the info on
    • isNull

      public boolean isNull(int row, int col)
      Parameters:
      row - row index of the element
      col - column index of the element
      Returns:
      true if an element is null
    • setNull

      public void setNull(int row, int col, boolean flag)
      Mark an entry as null.
      Parameters:
      row - row index of the element
      col - column index of the element
      flag - set to null or not
    • setNullString

      public void setNullString(int col, String newNull)
      Set the null string for a column.
      Parameters:
      col - the column index
      newNull - the String representing null