Commit 2d16b28c authored by Ralf Mueller's avatar Ralf Mueller 🎣
Browse files

fix python access pattern to cxx maps/vectors

parent 785941bb
...@@ -7,25 +7,22 @@ cdi = CdiObj.Cdi(ifile) ...@@ -7,25 +7,22 @@ cdi = CdiObj.Cdi(ifile)
print('Stream: ',cdi.streamID,' vlistID:',cdi.vlistID,' nvars:{d}', cdi.nvars) print('Stream: ',cdi.streamID,' vlistID:',cdi.vlistID,' nvars:{d}', cdi.nvars)
print('#========== TAXES ====================================#') print('#========== TAXES ====================================#')
for k in range(cdi.taxes.size()): for k, tax in cdi.taxes.items():
print(k,": ", cdi.taxes[k].unitname) print(k,": ", tax.unitname)
print(k,": ", tax.ntsteps)
print('#========== GRIDS ====================================#') print('#========== GRIDS ====================================#')
for k in range(cdi.grids.size()): for k, grid in cdi.grids.items():
print(k,": ", cdi.grids[k].size,' ', cdi.grids[k].xname,' ', cdi.grids[k].yname,' ', cdi.grids[k].ylongname) print(k,": ", grid.size,' ', grid.xname,' ', grid.yname,' ', grid.ylongname)
print("#========== ZAXES ====================================#") print("#========== ZAXES ====================================#")
for k in range(cdi.zaxes.size()): for k, zax in cdi.zaxes.items():
print(k,": ", cdi.zaxes[k].size,' ', cdi.zaxes[k].name,' ', cdi.zaxes[k].units) print(k,": ", zax.size,' ', zax.name,' ', zax.units)
print("#========== VARIABLES ================================#") print("#========== VARIABLES ================================#")
for k in range(cdi.variables.size()): for var in cdi.variables:
v = cdi.variables[k] print(k,var.name," ",var.size, " ", var.missval)
print(v.name," ",v.size, " ", v.missval) print(var.longname,' ',var.units)
print("#========== VARIABLEcdi.NAMES =================================#")
for k in range(cdi.variables.size()):
print(cdi.variables[k].longname,' ',cdi.variables[k].units)
print("#========== VAR by index ======================================#") print("#========== VAR by index ======================================#")
var = cdi.variables[1] var = cdi.variables[1]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment