Package nom.tam.fits
Class UndefinedData
java.lang.Object
nom.tam.fits.Data
nom.tam.fits.UndefinedData
- All Implemented Interfaces:
FitsElement
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 Summary
ConstructorDescriptionDeprecated.(for internal use).Deprecated.(for internal use). -
Method Summary
Modifier and TypeMethodDescriptionfinal Bitpix
Returns the FITS element type as a Bitpux value.byte[]
getData()
Returns the underlying Java representation of the data contained in this HDU's data segment.final int[]
Returns the dimensionality of the data (if any), in Java array index order.final int
Returns the number of repeated (data + parameter) groups in this data objectfinal int
Returns the size of the optional parameter space as stored by the PCOUNT keyword in the FITS header.final String
Returns the FITS extension type as stored by the XTENSION keyword in the FITS header.toHDU()
Returns an approprotae HDU object that encapsulates this FITS data, and contains the minimal mandatory header description for that data.void
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.Methods inherited from class nom.tam.fits.Data
calcChecksum, detach, getFileOffset, getKernel, getSize, isDeferred, isEmpty, read, reset, rewrite, rewriteable
-
Constructor Details
-
UndefinedData
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
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
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
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
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 classData
- 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:
-
Data.isDeferred()
Data.ensureData()
-
write
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 interfaceFitsElement
- Specified by:
write
in classData
- Parameters:
o
- The data sink.- Throws:
FitsException
- if the write was unsuccessful.
-
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.
-