Skip to content

Instantly share code, notes, and snippets.

@betatim
Created September 25, 2014 12:50
Show Gist options
  • Save betatim/fcbaa6dcb6cfb23be204 to your computer and use it in GitHub Desktop.
Save betatim/fcbaa6dcb6cfb23be204 to your computer and use it in GitHub Desktop.
def nodes(evt, node=None):
nodenames = []
if node is None:
root = evt.retrieveObject('')
node = root.registry()
if node.object():
nodenames.append(node.identifier())
for l in evt.leaves(node):
# skip a location that takes forever to load
# XXX How to detect these automatically??
if "Swum" in l.identifier():
continue
temp = evt[l.identifier()]
nodenames += nodes(evt, l)
else:
nodenames.append(node.identifier())
return nodenames
# Get a small print out of what is there in the event
evt.dump()
# print out "all" TES locations
# prints out packed locations, so you need to know
# what the unpacked location is called to actually access it
print "-"*80
for node in nodes(evt):
print node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment