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
ConstructorsConstructorDescriptionDeprecated.(for internal use).Deprecated.(for internal use). -
Method Summary
Modifier and TypeMethodDescriptionfinal BitpixReturns 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 intReturns the number of repeated (data + parameter) groups in this data objectfinal intReturns the size of the optional parameter space as stored by the PCOUNT keyword in the FITS header.final StringReturns 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.voidWrites 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 Data
calcChecksum, detach, getFileOffset, getKernel, getSize, isDeferred, isEmpty, read, reset, rewrite, rewriteableModifier and TypeMethodDescriptionlongComputes and returns the FITS checksum for this data, for example to compare against the storedDATASUMin the FITS header (e.g. viaBasicHDU.getStoredDatasum()).voiddetach()Detaches this data object from the input (if any), such as a file or stream, but not before loading data from the previously assigned input into memory.longReturns the byte offset at which this element starts ina file.final ObjectSame asData.getData().longgetSize()Returns the size of this elements in the FITS representation.booleanChecks if the data should be assumed to be in deferred read mode.booleanisEmpty()Checks if the data content is currently empty, i.e. no actual data is currently stored in memory.voidread(ArrayDataInput in) Reads the data or skips over it for reading later, depending on whether reading from a stream or a random acessible input, respectively.booleanreset()Reset the input stream to point to the beginning of this elementvoidrewrite()Rewrite the contents of the element in place.booleanChecks if we can write this element back to its source.
-
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
nullif no dimensions have been defined.
-
getData
Description copied from class:DataReturns 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:
getDatain 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:
-
write
Description copied from interface:FitsElementWrites 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:
writein interfaceFitsElement- Specified by:
writein classData- Parameters:
o- The data sink.- Throws:
FitsException- if the write was unsuccessful.
-
toHDU
Description copied from class:DataReturns an approprotae HDU object that encapsulates this FITS data, and contains the minimal mandatory header description for that data.
-