Package nom.tam.fits

Class UndefinedData

java.lang.Object
nom.tam.fits.Data
nom.tam.fits.UndefinedData
All Implemented Interfaces:
FitsElement

public class UndefinedData extends Data
A container for unknown binary data types. We can still retrieve the data as a byte[] array, we just don't know how to interpret it ourselves. This class makes sure we don't break when we encouter HDUs that we don't (yet) support, such as HDU types defined by future FITS standards.
See Also:
  • Constructor Details

    • UndefinedData

      public UndefinedData(Header h) throws FitsException
      Deprecated.
      (for internal use). Visibility will be reduced to the package level in the future.
      Creates a new empty container for data of unknown type based on the provided FITS header information.
      Parameters:
      h - The FITS header corresponding to the data segment in the HDU
      Throws:
      FitsException - if there wan an error accessing or interpreting the provided header information.
    • UndefinedData

      public UndefinedData(Object x) throws IllegalArgumentException
      Deprecated.
      (for internal use). Users should always construct known data types. Reduce visibility to the package level.
      Parameters:
      x - object to create the hdu from
      Throws:
      IllegalArgumentException - If the object is not an array or contains elements that do not have a known binary size.
  • Method Details

    • getXtension

      public final String getXtension()
      Returns the FITS extension type as stored by the XTENSION keyword in the FITS header.
      Returns:
      The value used for the XTENSION keyword in the FITS header
      Since:
      1.19
    • getBitpix

      public final Bitpix getBitpix()
      Returns the FITS element type as a Bitpux value.
      Returns:
      The FITS Bitpix value for the type of primitive data element used by this data
      Since:
      1.19
    • getParameterCount

      public final int getParameterCount()
      Returns the size of the optional parameter space as stored by the PCOUNT keyword in the FITS header.
      Returns:
      The element count of the optional parameter space accompanying the main data, as stored by the PCOUNT header value.
      Since:
      1.19
    • getGroupCount

      public final int getGroupCount()
      Returns the number of repeated (data + parameter) groups in this data object
      Returns:
      The number of repeated data + parameter blocks, as stored by the GCOUNT header value.
      Since:
      1.19
    • getDimensions

      public final int[] getDimensions()
      Returns the dimensionality of the data (if any), in Java array index order. That is, The value for NAXIS1 is the last value in the returned array
      Returns:
      the regular dimensions of the data in Java index order (that is NAXIS1 is the last entry in the array), or possibly null if no dimensions have been defined.
    • getData

      public byte[] getData() throws FitsException
      Description copied from class: Data
      Returns the underlying Java representation of the data contained in this HDU's data segment. Typically it will return a Java array of some kind.
      Overrides:
      getData in class Data
      Returns:
      the underlying Java representation of the data core object, such as a multi-dimensional Java array.
      Throws:
      FitsException - if the data could not be gathered.
      See Also:
    • write

      public void write(ArrayDataOutput o) throws FitsException
      Description copied from interface: FitsElement
      Writes the contents of the element to a data sink, adding padding as necessary if the element (such as a header or data segment) is expected to complete the FITS block of 2880 bytes.
      Specified by:
      write in interface FitsElement
      Specified by:
      write in class Data
      Parameters:
      o - The data sink.
      Throws:
      FitsException - if the write was unsuccessful.
    • toHDU

      public UndefinedHDU toHDU()
      Description copied from class: Data
      Returns an approprotae HDU object that encapsulates this FITS data, and contains the minimal mandatory header description for that data.
      Specified by:
      toHDU in class Data
      Returns:
      a HDU object ocntaining the data and its minimal required header description