V.1.2 Accessing HDF and XDB results
An example of reading HDF Results with Python library is given in “PYTHON/EX23/testHDF.py”
and corresponds to the ruby example described in section IV.2.9. The part related to HDF access
looks as follows:
Post.loadHdf5Library("C:/NewProgs/HDF5/HDF5-1.8.20-win32/bin/hdf5.dll")
...
db.attachHdf(hdfName)
lcNames=db.getHdfAttachmentLcNames(hdfName)
lcName=lcNames[lcIndex]
scNames=db.getHdfAttachmentScNames(hdfName,lcName)
scName=scNames[scIndex]
resNames=db.getHdfAttachmentResNames(hdfName,lcName)
hdfResNames=list(resNames)
db.readHdfAttachmentResults(hdfName,lcName,scName,resNames)
...
Note that the example also outputs Results read from an XDB file:
...
results=db.getAttachmentResults(xdbName,lcName,scName,hdfResNames)
...
for tpName in hdfResNames:
print lcName,scName,tpName
resKey=tuple((lcName,scName,tpName))
tmpRes=None
if resKey in results.keys():
tmpRes=results[resKey]
if (tmpRes):
os.write("%-20s%-25s%-60s%-10d' n"%(lcName,scName,tpName,tmpRes.Size))
os.write("%10d%10d%14g%14g : %s' n"%(tmpRes.getIntId(0),tmpRes.getIntId(1),tmpRes.getRealId(0),tmpRes.getRealId(1),tmpRes.Name))
Util.printRes(os,tmpRes.Name,tmpRes)
else:
print lcName,scName,tpName
...
(Remark that the access to “results” dictionnary elements is done via “resKey” tuple.)