Package nom.tam.fits

Class AsciiTableHDU

    • Field Detail

      • LOG

        private static final java.util.logging.Logger LOG
      • KEY_STEMS

        private static final IFitsHeader[] KEY_STEMS
        The standard column stems for an ASCII table. Note that TBCOL is not included here -- it needs to be handled specially since it does not simply shift.
    • Constructor Detail

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

      • encapsulate

        public static AsciiTable encapsulate​(java.lang.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​(java.lang.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​(java.lang.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​(java.io.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,
                                  java.lang.String newNull)
        Set the null string for a column.
        Parameters:
        col - the column index
        newNull - the String representing null