1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
from Xdmf import *
if __name__ == "__main__":
#//initialization begin
newPath = "File path to hdf5 file goes here"
newSetPath = "path to the set goes here"
readType = XdmfArrayType.Int32()
readStarts = UInt32Vector()
#Three dimensions, all starting at index 0
readStarts.push_back(0)
readStarts.push_back(0)
readStarts.push_back(0)
readStrides = UInt32Vector()
#Three dimensions, no skipping between reads
readStrides.push_back(1)
readStrides.push_back(1)
readStrides.push_back(1)
readCounts = UInt32Vector()
#Three dimensions, reading 10 values from each
readCounts.push_back(10)
readCounts.push_back(10)
readCounts.push_back(10)
readDataSize = UInt32Vector()
#Three dimensions, 10 values in each
readDataSize.push_back(10)
readDataSize.push_back(10)
readDataSize.push_back(10)
exampleController = XdmfHDF5Controller.New(
newPath,
newSetPath,
readType,
readStarts,
readStrides,
readCounts,
readDataSize)
#Using an XdmfHDF5Controller since XdmfHeavyDataController is an abstract class
#//initialization end
#//getDimensions begin
exampleDimensions = exampleController.getDimensions()
#//getDimensions end
#//getFilePath begin
examplePath = exampleController.getFilePath()
#//getFilePath end
#//getDescriptor begin
exampleDescriptor = exampleController.getDescriptor()
#//getDescriptor end
#//getName begin
exampleName = exampleController.getName()
#//getName end
#//getSize begin
exampleSize = exampleController.getSize()
#//getSize end
#//getDataspaceSize begin
exampleDataspaceSize = exampleController.getDataspaceSize()
#//getDataspaceSize end
#//getType begin
exampleType = exampleController.getType()
#//getType end
#//read begin
exampleArray = XdmfArray.New()
exampleController.read(exampleArray)
#exampleArray now holds the data that exampleController holds.
#//read end
#//setArrayOffset begin
newArrayOffset = 5#default is 0
exampleController.setArrayOffset(newArrayOffset)
#//setArrayOffset end
#//getArrayOffset begin
exampleOffset = exampleController.getArrayOffset()
#//getArrayOffset end
|