source: CMIP6dreq/trunk/srcMisc/dreq_cfg.py @ 323

Subversion URL: http://proj.badc.rl.ac.uk/svn/exarch/CMIP6dreq/trunk/srcMisc/dreq_cfg.py@323
Revision 323, 878 bytes checked in by mjuckes, 5 years ago (diff)

dreq misc

Line 
1import os, string, collections
2
3diagMips = ['DynVar','SIMIP','CORDEX','AgMIP']
4
5class rqcfg(object):
6  base = '/home/martin/2014/wip/dreq/'
7  dir0 = '/home/martin/2014/wip/dreq/input/'
8  cfgf='cfg2.txt'
9  tmpl = base + 'misc/consolidated_new_variables.xls'
10
11  def __init__(self):
12    ii = open( self.dir0 + self.cfgf ).readlines()
13
14    mip = None
15    ee = {}
16    ff = collections.defaultdict( list )
17    for l in ii:
18      if l[:2] == './':
19        mip = string.strip( l[2:] )[:-1]
20      elif l[:2] == '++':
21        fn = string.strip( l[3:] )
22        assert os.path.isfile( '%s%s/%s' % (self.dir0,mip,fn) ), '%s %s not found' % (mip, fn)
23        ee[mip] = fn
24      elif l[:2] == '--':
25        fn = string.strip( l[3:] )
26        assert os.path.isfile( '%s%s/%s' % (self.dir0,mip,fn) ), '%s %s not found' % (mip, fn)
27        ff[mip].append( fn )
28    self.ee = ee
29    self.ff = ff
Note: See TracBrowser for help on using the repository browser.