Package nom.tam.fits

Class RandomGroupsHDU

All Implemented Interfaces:
FitsElement

public class RandomGroupsHDU extends BasicHDU<RandomGroupsData>
Random groups HDUs. Note that the internal storage of random groups is a Object[ngroup][2] array. The first element of each group is the parameter data from that group. The second element is the data. The parameters should be a one dimensional array of the primitive types byte, short, int, long, float or double. The second element is a n-dimensional array of the same type. When analyzing group data structure only the first group is examined, but for a valid FITS file all groups must have the same structure.
  • Field Details

    • LOG

      private static final Logger LOG
  • Constructor Details

    • RandomGroupsHDU

      public RandomGroupsHDU(Header header, RandomGroupsData data)
      Create an HDU from the given header and data .
      Parameters:
      header - header to use
      data - data to use
  • Method Details

    • encapsulate

      public static RandomGroupsData encapsulate(Object o) throws FitsException
      Throws:
      FitsException
    • generateSampleRow

      static Object[] generateSampleRow(Header h) throws FitsException
      Throws:
      FitsException
    • isData

      public static boolean isData(Object potentialData)
      Check if this data is compatible with Random Groups structure. Must be an Object[ngr][2] structure with both elements of each group having the same base type and the first element being a simple primitive array. We do not check anything but the first row.
      Parameters:
      potentialData - data to check
      Returns:
      is this data compatible with Random Groups structure
    • isHeader

      public static boolean isHeader(Header hdr)
      Parameters:
      hdr - The header to be tested.
      Returns:
      Is this a random groups header?
    • manufactureData

      public static RandomGroupsData manufactureData(Header header) throws FitsException
      Parameters:
      header - header for the data creation
      Returns:
      Create FITS data object corresponding to a given header.
      Throws:
      FitsException - if the operation failed
    • manufactureHeader

      static Header manufactureHeader(Data d) throws FitsException
      Parameters:
      d - The random groups data the header should describe.
      Returns:
      Make a header point to the given object.
      Throws:
      FitsException - if the operation failed
    • canBePrimary

      protected boolean canBePrimary()
      Overrides:
      canBePrimary in class BasicHDU<RandomGroupsData>
      Returns:
      Indicate whether HDU can be primary HDU. This method must be overriden in HDU types which can appear at the beginning of a FITS file.
    • info

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

      public boolean isHeader()
      Check that this HDU has a valid header.
      Returns:
      true if this HDU has a valid header.
    • setPrimaryHDU

      protected void setPrimaryHDU(boolean status) throws FitsException
      Move a RandomGroupsHDU to or from the beginning of a FITS file. Note that the FITS standard only supports Random Groups data at the beginning of the file, but we allow it within Image extensions.
      Overrides:
      setPrimaryHDU in class BasicHDU<RandomGroupsData>
      Parameters:
      status - true if the header should be primary
      Throws:
      FitsException - if the operation failed