Skip to content
Snippets Groups Projects
Commit fdfa469e authored by Peters, Wouter's avatar Peters, Wouter
Browse files

moved the region to map conversion to the statevector object

parent a1b88fac
No related branches found
No related tags found
No related merge requests found
......@@ -22,31 +22,6 @@ class CtDaSystem(DaSystem):
""" Information on the data assimilation system used. This is normally an rc-file with settings.
"""
def Initialize(self):
"""
Initialize the object
"""
import da.tools.io4 as io
import numpy as np
mapfile = os.path.join(self['regionsfile'])
ncf = io.CT_Read(mapfile,'read')
self.regionmap = ncf.GetVariable('budget_region')
dummy = ncf.close()
msg = "Regions map on 1x1 degree was read from file %s"%self['regionsfile'] ; logging.debug(msg)
# dictionary for region <-> map conversions
nregions = self.regionmap.max()
self.regiondict = {}
for r in range(1,nregions+1):
sel = (self.regionmap.flat == r).nonzero()
if len(sel[0])>0:
self.regiondict[r]=sel
msg = "A dictionary to map grids to states and vice versa was created" ; logging.debug(msg)
def Validate(self):
"""
Validate the contents of the rc-file given a dictionary of required keys
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment