I am trying to use "PyCGNS" python package in conda to extract the list of all the "zones" in a CGNS file. Attached is the snapshot view of the opened file.
Here is what I want:
zone_list = [zone1, zone2, ..., zone51]
Hint:
Here is the print(tree) value:
['CGNSTree', None, [['CGNSLibraryVersion', array([3.21], dtype=float32), [], 'CGNSLibraryVersion_t'], ['Base', array([3, 3]), [['zone41', array([[ 77, 76, 0],
[113, 112, 0],
[ 49, 48, 0]], dtype=int64), [['ZoneType', array([b'S', b't', b'r', b'u', b'c', b't', b'u', b'r', b'e', b'd'],
dtype='|S1'), [], 'ZoneType_t'], ['GridCoordinates', None, [['CoordinateX', array(....

I'm not a PyCGNS guy, but I understand HDF5 data schema, so will give it a try. :)
The docs recommend
(tree,links,paths)=CGNS.MAP.load("your.hdf")Did you try that? It returnstreewhich is a Python list with the CGNS tree info. As I understand, the tree describes the node structure (aka schema). Per the documentation, the node structure looks like this:You could
print(tree), but I think you will be swamped with output. You can interrogate the tree to find nodes named "zone*". Based on your image, I suspect all zone nodes are all children of a Node with named "Base". If so, the code will look something like this (educated guess):If you are familiar with List Comprehension, the last 4 lines can be simplified to:
Give that a try and see if solves your problem. If it's not exactly right, it should get you close.