public abstract class BasicHDU<DataClass extends Data> extends Object implements FitsElement
Modifier and Type | Field and Description |
---|---|
static int |
BITPIX_BYTE |
static int |
BITPIX_DOUBLE |
static int |
BITPIX_FLOAT |
static int |
BITPIX_INT |
static int |
BITPIX_LONG |
static int |
BITPIX_SHORT |
protected boolean |
isPrimary
Is this the first HDU in a FITS file?
|
protected DataClass |
myData
The associated data unit.
|
protected Header |
myHeader
The associated header.
|
Modifier | Constructor and Description |
---|---|
protected |
BasicHDU(Header myHeader,
DataClass myData) |
Modifier and Type | Method and Description |
---|---|
void |
addValue(IFitsHeader key,
boolean val) |
void |
addValue(IFitsHeader key,
double val) |
void |
addValue(IFitsHeader key,
int val) |
void |
addValue(IFitsHeader key,
String val) |
void |
addValue(String key,
boolean val,
String comment)
Add information to the header.
|
void |
addValue(String key,
double val,
String comment) |
void |
addValue(String key,
int val,
String comment) |
void |
addValue(String key,
String val,
String comment) |
HeaderCardBuilder |
card(IFitsHeader key)
get a builder for filling the header cards using the builder pattern.
|
String |
getAuthor()
Return the name of the person who compiled the information in the data
associated with this header.
|
int[] |
getAxes()
In FITS files the index represented by NAXIS1 is the index that changes
most rapidly.
|
int |
getBitPix() |
long |
getBlankValue() |
double |
getBScale() |
String |
getBUnit() |
double |
getBZero() |
Date |
getCreationDate()
Get the FITS file creation date as a
Date object. |
DataClass |
getData() |
static BasicHDU<?> |
getDummyHDU() |
double |
getEpoch()
Deprecated.
use
getEquinox() instead |
double |
getEquinox()
Get the equinox in years for the celestial coordinate system in which
positions given in either the header or data are expressed.
|
long |
getFileOffset()
Get the starting offset of the HDU
|
int |
getGroupCount() |
Header |
getHeader() |
String |
getInstrument()
Get the name of the instrument which was used to acquire the data in this
FITS file.
|
Object |
getKernel() |
double |
getMaximumValue()
Return the minimum valid value in the array.
|
double |
getMinimumValue()
Return the minimum valid value in the array.
|
String |
getObject()
Get the name of the observed object in this FITS file.
|
Date |
getObservationDate()
Get the FITS file observation date as a
Date object. |
String |
getObserver()
Get the name of the person who acquired the data in this FITS file.
|
String |
getOrigin()
Get the name of the organization which created this FITS file.
|
int |
getParameterCount() |
String |
getReference()
Return the citation of a reference where the data associated with this
header are published.
|
long |
getSize() |
String |
getTelescope()
Get the name of the telescope which was used to acquire the data in this
FITS file.
|
String |
getTrimmedString(IFitsHeader keyword)
Get the String value associated with
keyword . |
String |
getTrimmedString(String keyword)
Get the String value associated with
keyword . |
abstract void |
info(PrintStream stream)
Print out some information about this HDU.
|
static boolean |
isData(Object o) |
static boolean |
isHeader(Header header)
Check that this is a valid header for the HDU.
|
void |
read(ArrayDataInput stream)
Read a data array into the current object and if needed position to the
beginning of the next FITS block.
|
boolean |
reset()
Reset the input stream to point to the beginning of this element
|
void |
rewrite()
Rewrite the contents of the element in place.
|
boolean |
rewriteable() |
protected void |
saveReplaceCard(String key,
boolean isString,
String value)
Safely replace a card in the header, knowing that no exception will
occur.
|
void |
write(ArrayDataOutput stream)
Write the contents of the element to a data sink.
|
public static final int BITPIX_BYTE
public static final int BITPIX_SHORT
public static final int BITPIX_INT
public static final int BITPIX_LONG
public static final int BITPIX_FLOAT
public static final int BITPIX_DOUBLE
protected Header myHeader
protected boolean isPrimary
public static BasicHDU<?> getDummyHDU()
public static boolean isHeader(Header header)
isData(Object)
header
- to validate.true
if this is a valid header.public static boolean isData(Object o)
o
- The Object being tested.isHeader(Header)
protected void saveReplaceCard(String key, boolean isString, String value)
key
- the key of the cardisString
- is the value a Stringvalue
- the String representation of the valuepublic void addValue(IFitsHeader key, boolean val) throws HeaderCardException
HeaderCardException
public void addValue(IFitsHeader key, double val) throws HeaderCardException
HeaderCardException
public void addValue(IFitsHeader key, int val) throws HeaderCardException
HeaderCardException
public void addValue(IFitsHeader key, String val) throws HeaderCardException
HeaderCardException
public void addValue(String key, boolean val, String comment) throws HeaderCardException
key
- key to add to the headerval
- value for the key to addcomment
- comment for the key/value pairHeaderCardException
- if the card does not follow the specificationpublic void addValue(String key, double val, String comment) throws HeaderCardException
HeaderCardException
public void addValue(String key, int val, String comment) throws HeaderCardException
HeaderCardException
public void addValue(String key, String val, String comment) throws HeaderCardException
HeaderCardException
public String getAuthor()
null
or a String objectpublic int[] getAxes() throws FitsException
BITPIX=16 NAXIS1=10 NAXIS2=20 NAXIS3=30this will be read into a Java array short[30][20][10] so it makes sense to me at least that the returned dimensions are 30,20,10
FitsException
- if the axis are configured wrong.public int getBitPix() throws FitsException
FitsException
public long getBlankValue() throws FitsException
FitsException
public double getBScale()
public String getBUnit()
public double getBZero()
public Date getCreationDate()
Date
object.null
or a Date objectpublic DataClass getData()
@Deprecated public double getEpoch()
getEquinox()
insteadnull
or a String objectpublic double getEquinox()
null
or a String objectpublic long getFileOffset()
getFileOffset
in interface FitsElement
public int getGroupCount()
public Header getHeader()
public HeaderCardBuilder card(IFitsHeader key)
key
- the key for the first card.public String getInstrument()
null
or a String objectpublic Object getKernel()
public double getMaximumValue()
public double getMinimumValue()
public String getObject()
null
or a String objectpublic Date getObservationDate()
Date
object.null
or a Date objectpublic String getObserver()
null
or a String objectpublic String getOrigin()
null
or a String objectpublic int getParameterCount()
public String getReference()
null
or a String objectpublic long getSize()
getSize
in interface FitsElement
public String getTelescope()
null
or a String objectpublic String getTrimmedString(String keyword)
keyword
.keyword
- the FITS keywordnull
or a String with leading/trailing blanks
stripped.public String getTrimmedString(IFitsHeader keyword)
keyword
.keyword
- the FITS keywordnull
or a String with leading/trailing blanks
stripped.public abstract void info(PrintStream stream)
stream
- the printstream to write the info onpublic void read(ArrayDataInput stream) throws FitsException, IOException
FitsElement
read
in interface FitsElement
stream
- The input data streamFitsException
- if the read was unsuccessful.IOException
- if the read was unsuccessful.public boolean reset()
FitsElement
reset
in interface FitsElement
public void rewrite() throws FitsException, IOException
FitsElement
rewrite
in interface FitsElement
FitsException
- if the rewrite was unsuccessful.IOException
- if the rewrite was unsuccessful.public boolean rewriteable()
rewriteable
in interface FitsElement
true
if this element can be rewritten?public void write(ArrayDataOutput stream) throws FitsException
FitsElement
write
in interface FitsElement
stream
- The data sink.FitsException
- if the write was unsuccessful.Copyright © 1996–2016 nom-tam-fits. All rights reserved.