public abstract class BintableStarTable extends AbstractStarTable
The implementation varies according to whether random or sequential-only access is provided by the underlying data access. A factory method is provided to create an appropriate instance.
Some instances of this class hang on to file descriptors.
If you are in danger of running out of that resource before
instances are garbage collected, you can call the AbstractStarTable.close()
method to release them. Attempting to read data following
such a call may result in an exception.
Limited support is provided for the
HEALPix-FITS convention;
the relevant HealpixTableInfo
table parameters
are added, but any BAD_DATA keyword value is ignored,
and the 1024-element array-valued column variant of the format is not
understood.
Modifier and Type | Field and Description |
---|---|
static ValueInfo |
LONGOFF_INFO
Column aux metadata key for stringified longs offset.
|
static ValueInfo |
TBCOL_INFO
Column aux metadata key for TBCOLn cards.
|
static ValueInfo |
TDISP_INFO
Column aux metadata key for TDISPn cards.
|
static ValueInfo |
TFORM_INFO
Column aux metadata key for TFORMn cards.
|
static ValueInfo |
TNULL_INFO
Column aux metadata key for TNULLn cards.
|
static ValueInfo |
TSCAL_INFO
Column aux metadata key for TSCALn cards.
|
static ValueInfo |
TZERO_INFO
Column aux metadata key for TZEROn cards.
|
Modifier | Constructor and Description |
---|---|
protected |
BintableStarTable(FitsHeader hdr,
boolean isRandom,
WideFits wide)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static BintableStarTable |
createTable(FitsHeader hdr,
InputFactory inputFact,
WideFits wide)
Returns an instance of this class given a data access instance.
|
List<ValueInfo> |
getColumnAuxDataInfos()
Goes through the table columns (
ColumnInfo objects)
and picks out all the AuxData items which exist, generalising
where necessary and returning a union of them in
alphabetical order by name. |
int |
getColumnCount()
Returns the number of columns in this table.
|
ColumnInfo |
getColumnInfo(int icol)
Returns the object describing the data in a given column.
|
protected long[] |
getColumnOffsets()
Returns the array of byte offsets from the start of the row at
which each column starts.
|
long |
getRowCount()
Returns the number of rows in this table, if known.
|
protected long |
getRowLength()
Returns the number of bytes occupied in the data stream by a single
row of the table.
|
protected Object |
readCell(BasicInput stream,
int icol)
Reads a cell from a given column from the current position in
a stream.
|
protected Object[] |
readRow(BasicInput stream)
Reads a whole row of the table from the current position in a stream,
returning a new Object[] array.
|
static void |
streamStarTable(FitsHeader hdr,
BasicInput input,
WideFits wide,
TableSink sink)
Reads a BINTABLE extension from a stream and writes the result to
a table sink.
|
checkedLongToInt, close, getCell, getName, getParameters, getRow, getRowAccess, getRowSequence, getRowSplittable, getURL, isRandom, setName, setParameters, setURL
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParameterByName, setParameter
public static final ValueInfo TNULL_INFO
public static final ValueInfo TSCAL_INFO
public static final ValueInfo TZERO_INFO
public static final ValueInfo TDISP_INFO
public static final ValueInfo TBCOL_INFO
public static final ValueInfo TFORM_INFO
public static final ValueInfo LONGOFF_INFO
protected BintableStarTable(FitsHeader hdr, boolean isRandom, WideFits wide) throws IOException
hdr
- FITS header cardsisRandom
- true if the data access will be random-access,
false for sequential-onlywide
- convention for representing extended columns;
use null to avoid use of extended columnsIOException
public long getRowCount()
StarTable
getRowCount
in interface StarTable
getRowCount
in class AbstractStarTable
public int getColumnCount()
StarTable
getColumnCount
in interface StarTable
getColumnCount
in class AbstractStarTable
public ColumnInfo getColumnInfo(int icol)
StarTable
getColumnInfo
in interface StarTable
getColumnInfo
in class AbstractStarTable
icol
- the column for which header information is requiredicol
public List<ValueInfo> getColumnAuxDataInfos()
AbstractStarTable
ColumnInfo
objects)
and picks out all the AuxData items which exist, generalising
where necessary and returning a union of them in
alphabetical order by name.
Subclasses should override this if they can do better, for instance
providing an order for the keys.getColumnAuxDataInfos
in interface StarTable
getColumnAuxDataInfos
in class AbstractStarTable
ValueInfo
items which in fact crop up in column metadataDefaultValueInfo.getAuxData()
protected Object readCell(BasicInput stream, int icol) throws IOException
icol
- the column index corresponding to the cell to be readstream
- a stream containing the byte data, positioned to
the right placeIOException
protected Object[] readRow(BasicInput stream) throws IOException
stream
- a stream containing the byte data, positioned to
the right placencol
-element array of cells for this rowIOException
protected long getRowLength()
protected long[] getColumnOffsets()
ncol
-element array of byte offsetspublic static BintableStarTable createTable(FitsHeader hdr, InputFactory inputFact, WideFits wide) throws IOException
hdr
- FITS header cardsinputFact
- factory for access to the data part of the
HDU representing a FITS BINTABLE extensionwide
- convention for representing extended columns;
use null to avoid use of extended columnsIOException
public static void streamStarTable(FitsHeader hdr, BasicInput input, WideFits wide, TableSink sink) throws IOException
hdr
- FITS header object describing the BINTABLE extensioninput
- input stream positioned at the start of the
data part of the BINTABLE extensionwide
- convention for representing extended columns;
use null to avoid use of extended columnssink
- destination for the tableIOException
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.