本文整理汇总了Java中nom.tam.fits.BinaryTable类的典型用法代码示例。如果您正苦于以下问题:Java BinaryTable类的具体用法?Java BinaryTable怎么用?Java BinaryTable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BinaryTable类属于nom.tam.fits包,在下文中一共展示了BinaryTable类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populateData
import nom.tam.fits.BinaryTable; //导入依赖的package包/类
private void populateData(Object kern, int bitpix, TileLooper tl, CompressionScheme cs)
throws FitsException, IOException {
// Get rid of the dummy rows we initialized with.
BinaryTable bt = (BinaryTable) this.getData();
this.deleteRows(0, 2);
int tileCount = 0;
Iterator<TileDescriptor> ti = tl.iterator();
kernelClass = kern.getClass().getName();
BinaryTable table = (BinaryTable) getData();
while (ti.hasNext()) {
TileDescriptor td = ti.next();
int sz = 1;
for (int i = 0; i < td.size.length; i += 1) {
sz *= td.size[i];
}
byte[] data;
if (quant == null) {
data = getTileData(td, kern, bitpix);
} else {
data = quant.quantize(kern, td, tileCount);
}
data = cs.compress(data);
this.addRow(new Object[]{data});
}
}
示例2: addDataToTable
import nom.tam.fits.BinaryTable; //导入依赖的package包/类
/**
* Add columns data to a binary table.
*/
private void addDataToTable (BinaryTable binaryTable) throws SedWritingException
{
if ((this.numFields == 0) || (this.numPoints == 0))
return;
int iCol[][] = new int[1][this.numPoints];
double dCol[][] = new double[1][this.numPoints];
String sCol[][] = new String[1][this.numPoints];
Column column;
String colId;
// go through the columns and add the respective
// keywords to the header
for (int col=0; col<this.numFields; col++)
{
colId = this.columnOrder.get (col);
column = this.dataTable.get (colId);
try
{
if (column.dataClass == Double.class)
{
for (int ii=0; ii<this.numPoints; ii++)
dCol[0][ii] = (Double)(column.data.get(ii));
binaryTable.addColumn (dCol);
}
else if (column.dataClass == Integer.class)
{
for (int ii=0; ii<this.numPoints; ii++)
iCol[0][ii] = (Integer)(column.data.get(ii));
binaryTable.addColumn (iCol);
}
else if (column.dataClass == String.class)
{
for (int ii=0; ii<this.numPoints; ii++)
sCol[0][ii] = (String)(column.data.get(ii));
binaryTable.addColumn (sCol);
}
}
catch (Exception exp)
{
throw new SedWritingException (exp.getMessage(), exp);
}
}
}