@@ -69,7 +57,7 @@ class CO2GriddedStateVector(StateVector):
covariancematrixlist=[]
forfileincov_files:
ifnotos.path.exists(file):
msg="Cannot find the specified file %s"%file
msg="Cannot find the specified file %s"%file
logging.error(msg)
raiseIOError,msg
else:
...
...
@@ -77,26 +65,25 @@ class CO2GriddedStateVector(StateVector):
f=io.ct_read(file,'read')
if'pco2'infile:
if'pco2'infile:
cov_ocn=f.get_variable('CORMAT')
cov=cov_ocn
else:
else:
cov=f.get_variable('covariance')
#cov_sf = 10.0/np.sqrt(cov.diagonal().sum()) # this scaling factor makes the total variance close to the value of a single ecoregion
cov_sf=20.0/np.sqrt(cov.diagonal().sum())# this scaling factor makes the total variance close to the value of a single ecoregion
cov=cov*cov_sf
cov_sf=360./np.sqrt(cov.diagonal().sum())# this scaling factor makes the total variance close to the value of a single ecoregion #I use 360 to boost up the P matrix uncertainty
cov1=cov*cov_sf*(1.e-6)**2# here you assume that your P matrix has units of mol m-2 s-1 squared.
f.close()
covariancematrixlist.append(cov)
covariancematrixlist.append(cov1)
# Boundary conditions covariance
cov=np.array([[2]])#np.ones((1,1),)
cov=np.array([[2*2]])
covariancematrixlist.append(cov)
covariancematrixlist.append(cov)
covariancematrixlist.append(cov)
covariancematrixlist.append(cov)
logging.debug("Succesfully closed files after retrieving prior covariance matrices")
...
...
@@ -105,12 +92,12 @@ class CO2GriddedStateVector(StateVector):