How to use the spacepy.dictree function in spacepy

To help you get started, we’ve selected a few spacepy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github drsteve / LANLGeoMag / Examples / MagEphem / ParseHeader.py View on Github external
# isolate header
p = re.compile( r"^#(.*)$", re.M )
h = re.findall( p, Lines )
Header = "".join(h)
#print Header

# isolate JSON field
#s = re.search( r'\s*begin\s+JSON\s*(.*)\s*end\s+JSON', Header )
s = re.search( r'\{\s*(.*)\s*\}', Header )
j = "{" + s.group(1) + "}"
#print j


config_dict = json.loads( j )
spacepy.dictree( config_dict, levels=2, verbose=True )
#print config_dict