TiledColumnStMan allows the user to create a tiled hypercube for an entire data column and extend it in an automatic way. It is meant to be used for fixed shaped data which have to be accessed in various directions.
The TiledColumnStMan has the following (extra) properties:
// Define the table description and the columns in it.
TableDesc td ("", "1", TableDesc::Scratch);
td.addColumn (ArrayColumnDesc<float> ("RA", 1));
td.addColumn (ArrayColumnDesc<float> ("Dec", 1));
td.addColumn (ScalarColumnDesc<float> ("Velocity"));
td.addColumn (ArrayColumnDesc<float> ("Image", 2));
// Define the 3-dim hypercolumn with its data and coordinate columns.
// Note that its dimensionality must be one higher than the dimensionality
// of the data cells.
td.defineHypercolumn ("TSMExample",
3,
stringToVector ("Image"),
stringToVector ("RA,Dec,Velocity"));
// Now create a new table from the description.
SetupNewTable newtab("tTiledColumnStMan_tmp.data", td, Table::New);
// Create a TiledColumnStMan storage manager for the hypercolumn
// and bind the columns to it.
// The tile shape has to be specified for the storage manager.
TiledColumnStMan sm1 ("TSMExample", IPosition(3,16,32,32));
newtab.bindAll (sm1);
// Create the table.
Table table(newtab);
// Define the values for the coordinates of the hypercube.
Vector<float> raValues(512);
Vector<float> DecValues(512);
indgen (raValues);
indgen (decValues, float(100));
ArrayColumn<float> ra (table, "RA");
ArrayColumn<float> dec (table, "Dec");
ScalarColumn<float> velocity (table, "Velocity");
ArrayColumn<float> image (table, "Image");
Cube<float> imageValues(IPosition(2,512,512));
indgen (imageValues);
// Write some data into the data columns.
uInt i;
for (i=0; i<64; i++) {
table.addRow();
image.put (i, imageValues);
// The RA and Dec have to be put only once, because they
// are the same for each row.
if (i == 0) {
ra.put (i, raValues);
dec.put (i, decValues);
}
velocity.put (i, float(i));
}
Clone this object. It does not clone TSMColumn objects possibly used.
TiledColumnStMan can always access a column.
Get the type name of the data manager (i.e. TiledColumnStMan).
Record a record containing data manager specifications.
Make the object from the type name string. This function gets registered in the DataManager "constructor" map.
Add rows to the storage manager. This will extend the hypercube.
Get the hypercube in which the given row is stored.
Get the hypercube in which the given row is stored. It also returns the position of the row in that hypercube.
Check if the hypercolumn definition fits this storage manager.
Flush and optionally fsync the data. It returns a True status if it had to flush (i.e. if data have changed).
Let the storage manager create files as needed for a new table. This allows a column with an indirect array to create its file.
Read the header info.