public class FITSSpecDataImpl extends AbstractSpecDataImpl implements FITSHeaderSource
Modifier and Type | Field and Description |
---|---|
protected uk.ac.starlink.ast.FrameSet |
astref
Reference to the AST frameset (also used when cloned).
|
protected boolean |
cloned
The state of the object.
|
protected nom.tam.fits.Header |
clonedHeader
Reference to cloned header cards.
|
protected double[] |
data
Reference to cloned data values.
|
protected double[] |
errors
Reference to cloned data errors.
|
protected nom.tam.fits.Fits |
fitsref
Reference to Fits object.
|
protected String |
fullName
The FITS file name.
|
protected int |
hdunum
Current HDU number.
|
protected nom.tam.fits.BasicHDU[] |
hdurefs
HDU references for the current Fits object.
|
protected nom.tam.fits.Header |
header
Reference to the header cards.
|
protected static int |
MAX_HEADER_VALUE
Maxiumum number of characters in a header string.
|
protected String |
shortName
Default symbolic name.
|
dataLabel, dataUnits, parentImpl
Constructor and Description |
---|
FITSSpecDataImpl(String fileName)
Constructor - open a FITS file by file name.
|
FITSSpecDataImpl(String fileName,
int hdunum)
Constructor - open a FITS file by file name.
|
FITSSpecDataImpl(String fileName,
SpecData source)
Constructor, creating an object by cloning another.
|
FITSSpecDataImpl(String fileName,
SpecData source,
int hdunum)
Constructor, creating an object by cloning another.
|
Modifier and Type | Method and Description |
---|---|
protected uk.ac.starlink.ast.FrameSet |
checkForNonStandardFormat(nom.tam.fits.Header header)
Check for known non-standard formats (far too many of those it
seems).
|
protected uk.ac.starlink.ast.FrameSet |
createAstSet()
Create an AST frameset from the FITS headers.
|
protected uk.ac.starlink.ast.FrameSet |
dummyAstSet()
Create a dummy AST frameset for the current HDU.
|
static void |
dumpHeader(nom.tam.fits.Header header,
PrintStream ps)
Class utility: Print the header to a given stream.
|
protected void |
finalize()
Finalise object.
|
uk.ac.starlink.ast.FrameSet |
getAst()
Return reference to AST frameset describing coordinates of
FITS headers.
|
double[] |
getData()
Return a copy of the spectrum data values.
|
protected double[] |
getDataCopy()
Get a copy of the FITS spectrum data in double precision.
|
protected int[] |
getDataDims()
Return an array of with length the number of dimensions of
the original data and with each element set to the size of that
dimension.
|
double[] |
getDataErrors()
Return a copy of the spectrum data errors.
|
String |
getDataFormat()
Return the data format.
|
int[] |
getDims()
Return the data array dimensionality.
|
nom.tam.fits.Header |
getFitsHeaders()
If available offer the FITs headers as a nom.tam.fits.Header
object.
|
String |
getFullName()
Return the file name.
|
String |
getProperty(String key)
Return a keyed value from the FITS headers.
|
String |
getShortName()
Return a symbolic name.
|
static nom.tam.util.Cursor |
getStandardIterator(nom.tam.fits.Header header)
Get a Cursor iterator that is positioned after the standard
FITS keywords.
|
boolean |
isSDSSFITSHeader()
Check if it's a SDSS FITS format
|
static boolean |
isSDSSFITSHeader(nom.tam.fits.Header header) |
nom.tam.fits.BasicHDU |
makeHDU() |
nom.tam.fits.BasicHDU |
makeHDU(boolean useStandardIterator) |
protected void |
makeMemoryClone(SpecData source)
Set up this object as a clone of another spectrum.
|
protected void |
openForRead(String fileName)
Open a named FITS file for reading.
|
void |
save()
Save spectrum to the associated disk-file.
|
protected void |
saveAst(nom.tam.fits.Header header)
Write an AST frameset that describes the coordinates of the
spectrum into the file.
|
protected void |
saveToFile()
Create a new FITS file using the current configuration to
populate it.
|
getColumnNames, getCoordinateColumnName, getDataColumnName, getDataErrorColumnName, getDataLabel, getDataUnits, getObjectType, getParentImpl, getTime0, getTimeField, getTimeRefpos, getTimeScale, getTimeSystem, isFITSHeaderSource, setCoordinateColumnName, setDataColumnName, setDataErrorColumnName, setDataLabel, setDataUnits, setObjectType, setParentImpl, setTime0, setTimeField, setTimeRefpos, setTimeScale, setTimeSystem
protected nom.tam.fits.Fits fitsref
protected nom.tam.fits.BasicHDU[] hdurefs
protected int hdunum
protected boolean cloned
protected double[] data
protected double[] errors
protected nom.tam.fits.Header header
protected nom.tam.fits.Header clonedHeader
protected String shortName
protected String fullName
protected uk.ac.starlink.ast.FrameSet astref
protected static final int MAX_HEADER_VALUE
public FITSSpecDataImpl(String fileName) throws SplatException
SplatException
public FITSSpecDataImpl(String fileName, int hdunum) throws SplatException
SplatException
public FITSSpecDataImpl(String fileName, SpecData source) throws SplatException
SplatException
public FITSSpecDataImpl(String fileName, SpecData source, int hdunum) throws SplatException
SplatException
public double[] getData()
getData
in interface SpecDataImpl
getData
in class AbstractSpecDataImpl
public double[] getDataErrors()
getDataErrors
in interface SpecDataImpl
getDataErrors
in class AbstractSpecDataImpl
public int[] getDims()
getDims
in interface SpecDataImpl
getDims
in class AbstractSpecDataImpl
public String getShortName()
getShortName
in interface SpecDataImpl
getShortName
in class AbstractSpecDataImpl
public String getFullName()
getFullName
in interface SpecDataImpl
getFullName
in class AbstractSpecDataImpl
public uk.ac.starlink.ast.FrameSet getAst()
getAst
in interface SpecDataImpl
getAst
in class AbstractSpecDataImpl
public String getDataFormat()
getDataFormat
in interface SpecDataImpl
getDataFormat
in class AbstractSpecDataImpl
public void save() throws SplatException
save
in interface SpecDataImpl
save
in class AbstractSpecDataImpl
SplatException
public String getProperty(String key)
getProperty
in interface SpecDataImpl
getProperty
in class AbstractSpecDataImpl
public nom.tam.fits.Header getFitsHeaders()
FITSHeaderSource
getFitsHeaders
in interface FITSHeaderSource
protected void finalize() throws Throwable
protected void openForRead(String fileName) throws SplatException
fileName
- The name of the FITS file, including any HDU
reference (format file.fits[0]).SplatException
public nom.tam.fits.BasicHDU makeHDU() throws nom.tam.fits.FitsException
nom.tam.fits.FitsException
public nom.tam.fits.BasicHDU makeHDU(boolean useStandardIterator) throws nom.tam.fits.FitsException
nom.tam.fits.FitsException
protected void saveToFile() throws SplatException
SplatException
protected void saveAst(nom.tam.fits.Header header)
protected double[] getDataCopy() throws nom.tam.fits.FitsException
nom.tam.fits.FitsException
protected uk.ac.starlink.ast.FrameSet createAstSet()
protected uk.ac.starlink.ast.FrameSet checkForNonStandardFormat(nom.tam.fits.Header header)
public boolean isSDSSFITSHeader()
public static boolean isSDSSFITSHeader(nom.tam.fits.Header header)
protected uk.ac.starlink.ast.FrameSet dummyAstSet()
protected int[] getDataDims()
protected void makeMemoryClone(SpecData source)
public static nom.tam.util.Cursor getStandardIterator(nom.tam.fits.Header header)
header
- Header that you want an iterator for.public static void dumpHeader(nom.tam.fits.Header header, PrintStream ps)
ps
- the stream to which the card images are dumped.Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.