Commit f40b4c89 authored by Luijkx, Ingrid's avatar Luijkx, Ingrid
Browse files

Fixed 2 small errors, connected to the preprocess observations pipeline and...

Fixed 2 small errors, connected to the preprocess observations pipeline and the ocean optimization key (follow up from previous update).
parent 248bc596
......@@ -378,12 +378,12 @@ def sample_step(dacycle, samples, statevector, obsoperator, lag, advance=False):
# Read observations + perform observation selection
obspickle_filename = os.path.join(dacycle['dir.restart'], sample.get_samples_type()+'samples_%s.pickle' % dacycle['time.sample.stamp'])
if os.path.isfile(obspickle_filename):
if dacycle['da.preprocessobs'] == True: continue
if 'da.preprocessobs' in dacycle.dasystem and dacycle['da.preprocessobs'] == True: continue
sample = pickle.load(open(obspickle_filename, 'rb'))
logging.info("Loaded the samples object from file: %s"%obspickle_filename)
else:
sample.add_observations()
if dacycle['da.preprocessobs'] == True:
if 'da.preprocessobs' in dacycle.dasystem and dacycle['da.preprocessobs'] == True:
pickle.dump(sample, open(obspickle_filename, 'wb'), -1)
logging.info("Saved the samples object to file: %s"%obspickle_filename)
continue
......@@ -401,7 +401,7 @@ def sample_step(dacycle, samples, statevector, obsoperator, lag, advance=False):
del sample
if dacycle['da.preprocessobs'] == True: return
if 'da.preprocessobs' in dacycle.dasystem and dacycle['da.preprocessobs'] == True: return
# Run the observation operator
obsoperator.run_forecast_model(samples)
......
......@@ -90,10 +90,10 @@ class CO2GriddedStateVector(StateVector):
if 'pco2' in file or 'cov_ocean' in file:
parnr = list(range(9805,9835))
if 'ocn.optimize' in dacycle.dasystem and dacycle.dasystem['ocn.optimize'] == False:
cov = np.identity(30)*1E-20 | cov = np.identity(30)*1E-20
cov = np.identity(30)*1E-20
logging.debug('Prior ocean covariance matrix = Identity matrix')
else:
cov = f.get_variable('CORMAT')
cov = f.get_variable('CORMAT')
elif 'tropic' in file:
cov = f.get_variable('covariance')
parnr = f.get_variable('parameternumber')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment