Merge branch 'colorbarUpdates' into chasesBranch
[wrfxweb.git] / src / distribute_catalog.py
blob1190cb6974600934ee4f179a450d8cbf224f6df1
1 from __future__ import absolute_import
2 from __future__ import print_function
3 import json,os
4 import os.path as osp
6 # a simple script to distribute pieces of catalog to simulation directories
8 simulations_path = osp.abspath('fdds/simulations')
9 catalog_path = osp.join(simulations_path,'catalog.json')
10 print('reading %s' % catalog_path)
11 catalog = json.load(open(catalog_path,'r'))
13 for sim in catalog:
14 local_catalog_path = osp.join(simulations_path,sim,'catalog.json')
15 print('writing %s' % local_catalog_path)
16 json.dump({sim: catalog[sim]},open(local_catalog_path,'w'),indent=4, separators=(',', ': '))