Package nom.tam.fits
Class RandomGroupsHDU
- java.lang.Object
-
- nom.tam.fits.BasicHDU<RandomGroupsData>
-
- nom.tam.fits.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 Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
LOG
-
Fields inherited from class nom.tam.fits.BasicHDU
BITPIX_BYTE, BITPIX_DOUBLE, BITPIX_FLOAT, BITPIX_INT, BITPIX_LONG, BITPIX_SHORT, isPrimary, myData, myHeader
-
-
Constructor Summary
Constructors Constructor Description RandomGroupsHDU(Header header, RandomGroupsData data)
Create an HDU from the given header and data .
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canBePrimary()
static RandomGroupsData
encapsulate(java.lang.Object o)
(package private) static java.lang.Object[]
generateSampleRow(Header h)
void
info(java.io.PrintStream stream)
Print out some information about this HDU.static boolean
isData(java.lang.Object potentialData)
Check if this data is compatible with Random Groups structure.boolean
isHeader()
Check that this HDU has a valid header.static boolean
isHeader(Header hdr)
static RandomGroupsData
manufactureData(Header header)
(package private) static Header
manufactureHeader(Data d)
protected void
setPrimaryHDU(boolean status)
Move a RandomGroupsHDU to or from the beginning of a FITS file.-
Methods inherited from class nom.tam.fits.BasicHDU
addValue, addValue, addValue, addValue, addValue, addValue, addValue, addValue, card, getAuthor, getAxes, getBitPix, getBlankValue, getBScale, getBUnit, getBZero, getCreationDate, getData, getDummyHDU, getEpoch, getEquinox, getFileOffset, getGroupCount, getHeader, getInstrument, getKernel, getMaximumValue, getMinimumValue, getObject, getObservationDate, getObserver, getOrigin, getParameterCount, getReference, getSize, getTelescope, getTrimmedString, getTrimmedString, read, reset, rewrite, rewriteable, saveReplaceCard, write
-
-
-
-
Constructor Detail
-
RandomGroupsHDU
public RandomGroupsHDU(Header header, RandomGroupsData data)
Create an HDU from the given header and data .- Parameters:
header
- header to usedata
- data to use
-
-
Method Detail
-
encapsulate
public static RandomGroupsData encapsulate(java.lang.Object o) throws FitsException
- Throws:
FitsException
-
generateSampleRow
static java.lang.Object[] generateSampleRow(Header h) throws FitsException
- Throws:
FitsException
-
isData
public static boolean isData(java.lang.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 classBasicHDU<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(java.io.PrintStream stream)
Description copied from class:BasicHDU
Print out some information about this HDU.- Specified by:
info
in classBasicHDU<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 classBasicHDU<RandomGroupsData>
- Parameters:
status
-true
if the header should be primary- Throws:
FitsException
- if the operation failed
-
-