Commit c6fa34ee authored by karolina's avatar karolina
Browse files

further cleanup of names: object names to lowercase

parent 5bb5096d
This diff is collapsed.
......@@ -23,7 +23,7 @@ File created on 11 May 2012.
"""
def write_mixing_ratios(DaCycle):
def write_mixing_ratios(dacycle):
"""
Write Sample information to NetCDF files. These files are organized by site and
......@@ -40,23 +40,23 @@ def write_mixing_ratios(DaCycle):
"""
dirname = create_dirs(os.path.join(DaCycle['dir.analysis'], 'data_molefractions'))
dirname = create_dirs(os.path.join(dacycle['dir.analysis'], 'data_molefractions'))
#
# Some help variables
#
dectime0 = date2num(datetime(2000, 1, 1))
dt = DaCycle['cyclelength']
startdate = DaCycle['time.start']
enddate = DaCycle['time.end']
dt = dacycle['cyclelength']
startdate = dacycle['time.start']
enddate = dacycle['time.end']
logging.debug("DA Cycle start date is %s" % startdate.strftime('%Y-%m-%d %H:%M'))
logging.debug("DA Cycle end date is %s" % enddate.strftime('%Y-%m-%d %H:%M'))
DaCycle['time.sample.stamp'] = "%s_%s" % (startdate.strftime("%Y%m%d%H"), enddate.strftime("%Y%m%d%H"),)
dacycle['time.sample.stamp'] = "%s_%s" % (startdate.strftime("%Y%m%d%H"), enddate.strftime("%Y%m%d%H"),)
# Step (1): Get the posterior sample output data file for this cycle
infile = os.path.join(DaCycle['dir.output'], 'sampleinfo_%s__newstyle.nc' % DaCycle['time.sample.stamp'])
infile = os.path.join(dacycle['dir.output'], 'sampleinfo_%s__newstyle.nc' % dacycle['time.sample.stamp'])
ncf_in = io.CT_Read(infile, 'read')
......@@ -72,7 +72,7 @@ def write_mixing_ratios(DaCycle):
# Step (2): Get the prior sample output data file for this cycle
infile = os.path.join(DaCycle['dir.output'], 'optimizer.%s.nc' % startdate.strftime('%Y%m%d'))
infile = os.path.join(dacycle['dir.output'], 'optimizer.%s.nc' % startdate.strftime('%Y%m%d'))
if os.path.exists(infile):
optimized_present = True
......@@ -88,13 +88,13 @@ def write_mixing_ratios(DaCycle):
fc_simulated = ncf_fc_in.get_variable('modelsamplesmean_prior')
fc_simulated_ens = ncf_fc_in.get_variable('modelsamplesdeviations_prior')
fc_flag = ncf_fc_in.get_variable('flag')
if not DaCycle.DaSystem.has_key('opt.algorithm'):
if not dacycle.dasystem.has_key('opt.algorithm'):
fc_r = ncf_fc_in.get_variable('modeldatamismatchvariance')
fc_hphtr = ncf_fc_in.get_variable('totalmolefractionvariance')
elif DaCycle.DaSystem['opt.algorithm'] == 'serial':
elif dacycle.dasystem['opt.algorithm'] == 'serial':
fc_r = ncf_fc_in.get_variable('modeldatamismatchvariance')
fc_hphtr = ncf_fc_in.get_variable('totalmolefractionvariance')
elif DaCycle.DaSystem['opt.algorithm'] == 'bulk':
elif dacycle.dasystem['opt.algorithm'] == 'bulk':
fc_r = ncf_fc_in.get_variable('modeldatamismatchvariance').diagonal()
fc_hphtr = ncf_fc_in.get_variable('totalmolefractionvariance').diagonal()
filesitecode = ncf_fc_in.get_variable('sitecode')
......@@ -136,11 +136,11 @@ def write_mixing_ratios(DaCycle):
ncf_out.History = '\nOriginal observation file modified by user %s on %s\n' % (os.environ['USER'], datetime.today().strftime('%F'),)
ncf_out.CTDAS_info = 'Simulated values added from a CTDAS run by %s on %s\n' % (os.environ['USER'], datetime.today().strftime('%F'),)\
+ '\nCTDAS was run on platform %s' % (os.environ['HOST'],)\
+ '\nCTDAS job directory was %s' % (DaCycle['dir.da_run'],)\
+ '\nCTDAS Da System was %s' % (DaCycle['da.system'],)\
+ '\nCTDAS Da ObsOperator was %s' % (DaCycle['da.obsoperator'],)
ncf_out.CTDAS_startdate = DaCycle['time.start'].strftime('%F')
ncf_out.CTDAS_enddate = DaCycle['time.finish'].strftime("%F")
+ '\nCTDAS job directory was %s' % (dacycle['dir.da_run'],)\
+ '\nCTDAS Da System was %s' % (dacycle['da.system'],)\
+ '\nCTDAS Da ObsOperator was %s' % (dacycle['da.obsoperator'],)
ncf_out.CTDAS_startdate = dacycle['time.start'].strftime('%F')
ncf_out.CTDAS_enddate = dacycle['time.finish'].strftime("%F")
ncf_out.original_file = orig_file
......@@ -323,20 +323,20 @@ if __name__ == "__main__":
logging.root.setLevel(logging.DEBUG)
DaCycle = CycleControl(args={'rc':'../../ctdas-od-gfed2-glb6x4-obspack-full.rc'})
DaCycle.initialize()
DaCycle.parse_times()
dacycle = CycleControl(args={'rc':'../../ctdas-od-gfed2-glb6x4-obspack-full.rc'})
dacycle.initialize()
dacycle.parse_times()
DaSystem = CO2DaSystem('../rc/carbontracker_ct09_opf.rc')
DaSystem.initialize()
dasystem = CO2DaSystem('../rc/carbontracker_ct09_opf.rc')
dasystem.initialize()
DaCycle.DaSystem = DaSystem
dacycle.dasystem = dasystem
while DaCycle['time.start'] < DaCycle['time.finish']:
while dacycle['time.start'] < dacycle['time.finish']:
outfile = write_mixing_ratios(DaCycle)
outfile = write_mixing_ratios(dacycle)
DaCycle.advance_cycle_times()
dacycle.advance_cycle_times()
sys.exit(0)
......@@ -22,7 +22,6 @@ import numpy as np
import datetime as dt
import da.tools.io4 as io
import logging
import copy
from da.analysis.summarize_obs import nice_lon, nice_lat, nice_alt
import Image
import urllib2
......@@ -48,7 +47,7 @@ fontsize = 9
figures that were created are stamped and saved properly
"""
def site_timeseries(DaCycle):
def site_timeseries(dacycle):
"""***************************************************************************************
Call example:
......@@ -59,13 +58,13 @@ def site_timeseries(DaCycle):
#
# Create directories if needed
#
mrdir = os.path.join(DaCycle['dir.analysis'], 'timeseries_molefractions')
mrdir = os.path.join(dacycle['dir.analysis'], 'timeseries_molefractions')
if not os.path.exists(mrdir):
create_dirs(mrdir)
#
# Make a dictionary of available sites and the NetCDF file names associated with them
#
sitelist = os.listdir(os.path.join(DaCycle['dir.analysis'], 'data_molefractions'))
sitelist = os.listdir(os.path.join(dacycle['dir.analysis'], 'data_molefractions'))
sitelist = [f for f in sitelist if f.endswith('.nc')]
#
# Loop over site and sitefiles
......@@ -76,7 +75,7 @@ def site_timeseries(DaCycle):
#
# Create filename and extract site codes for the sites that had day/night data separated
#
filename = os.path.join(DaCycle['dir.analysis'], 'data_molefractions', sitefile)
filename = os.path.join(dacycle['dir.analysis'], 'data_molefractions', sitefile)
#
# Create a figure instance to hold plot
#
......@@ -752,17 +751,17 @@ if __name__ == '__main__': # started as script
logging.root.setLevel(logging.DEBUG)
DaCycle = CycleControl(args={'rc':'../../ctdas-od-gfed2-glb6x4-obspack-full.rc'})
DaCycle.initialize()
DaCycle.parse_times()
dacycle = CycleControl(args={'rc':'../../ctdas-od-gfed2-glb6x4-obspack-full.rc'})
dacycle.initialize()
dacycle.parse_times()
DaSystem = CO2DaSystem('../rc/carbontracker_ct09_opf.rc')
DaSystem.initialize()
dasystem = CO2DaSystem('../rc/carbontracker_ct09_opf.rc')
dasystem.initialize()
DaCycle.DaSystem = DaSystem
dacycle.dasystem = dasystem
q = site_timeseries(DaCycle)
#q=site_residuals(DaCycle)
q = site_timeseries(dacycle)
#q=site_residuals(dacycle)
#q=site_statistics(rundat)
#q=site_histograms(rundat)
......
......@@ -44,7 +44,7 @@ def nice_alt(cls):
return string.strip('%10.1f masl' % round(cls, -1))
def summarize_obs(DaCycle, printfmt='html'):
def summarize_obs(dacycle, printfmt='html'):
"""***************************************************************************************
Call example:
......@@ -52,22 +52,22 @@ def summarize_obs(DaCycle, printfmt='html'):
Option printfmt : [tex,scr,html] print summary table in latex, terminal, or html format
Other options are all those needed to create a DaCycle object
Other options are all those needed to create a dacycle object
OR:
call directly from a python script as:
q=summarize_obs(DaCycle,printfmt='html')
q=summarize_obs(dacycle,printfmt='html')
***************************************************************************************"""
sumdir = os.path.join(DaCycle['dir.analysis'], 'summary')
sumdir = os.path.join(dacycle['dir.analysis'], 'summary')
if not os.path.exists(sumdir):
logging.info("Creating new directory " + sumdir)
os.makedirs(sumdir)
mrdir = os.path.join(DaCycle['dir.analysis'], 'data_molefractions')
mrdir = os.path.join(dacycle['dir.analysis'], 'data_molefractions')
if not os.path.exists(mrdir):
logging.error("Input directory does not exist (%s), exiting... " % mrdir)
return None
......@@ -185,7 +185,7 @@ def summarize_obs(DaCycle, printfmt='html'):
logging.info("File written with summary: %s" % saveas)
def summarize_stats(DaCycle):
def summarize_stats(dacycle):
"""
Summarize the statistics of the observations for this cycle
This includes X2 statistics, RMSD, and others for both forecast and
......@@ -193,16 +193,16 @@ def summarize_stats(DaCycle):
"""
sumdir = os.path.join(DaCycle['dir.analysis'], 'summary')
sumdir = os.path.join(dacycle['dir.analysis'], 'summary')
if not os.path.exists(sumdir):
logging.info("Creating new directory " + sumdir)
os.makedirs(sumdir)
# get forecast data from optimizer.ddddd.nc
startdate = DaCycle['time.start']
DaCycle['time.sample.stamp'] = "%s" % (startdate.strftime("%Y%m%d"),)
infile = os.path.join(DaCycle['dir.output'], 'optimizer.%s.nc' % DaCycle['time.sample.stamp'])
startdate = dacycle['time.start']
dacycle['time.sample.stamp'] = "%s" % (startdate.strftime("%Y%m%d"),)
infile = os.path.join(dacycle['dir.output'], 'optimizer.%s.nc' % dacycle['time.sample.stamp'])
if not os.path.exists(infile):
logging.error("File not found: %s" % infile)
......@@ -234,7 +234,7 @@ def summarize_stats(DaCycle):
x2 = np.ma.masked_where(HPHTR == 0.0, x2)
# calculate X2 per site
saveas = os.path.join(sumdir, 'x2_table_%s.html' % DaCycle['time.sample.stamp'])
saveas = os.path.join(sumdir, 'x2_table_%s.html' % dacycle['time.sample.stamp'])
logging.info("Writing HTML tables for this cycle (%s)" % saveas)
f = open(saveas, 'w')
txt = "<meta http-equiv='content-type' content='text/html;charset=utf-8' />\n"
......@@ -281,7 +281,7 @@ def summarize_stats(DaCycle):
# Now summarize for each site across time steps
if not DaCycle['time.start'] >= dt.datetime(2008, 12, 29):
if not dacycle['time.start'] >= dt.datetime(2008, 12, 29):
return
logging.info("Writing HTML tables for each site")
......@@ -338,20 +338,20 @@ if __name__ == '__main__': # started as script
logging.root.setLevel(logging.DEBUG)
DaCycle = CycleControl(args={'rc':'../../ctdas-od-gfed2-glb6x4-obspack-full.rc'})
DaCycle.initialize()
DaCycle.parse_times()
dacycle = CycleControl(args={'rc':'../../ctdas-od-gfed2-glb6x4-obspack-full.rc'})
dacycle.initialize()
dacycle.parse_times()
DaSystem = CO2DaSystem('../rc/carbontracker_ct09_opf.rc')
DaSystem.initialize()
dasystem = CO2DaSystem('../rc/carbontracker_ct09_opf.rc')
dasystem.initialize()
DaCycle.DaSystem = DaSystem
dacycle.dasystem = dasystem
q = summarize_obs(DaCycle)
q = summarize_obs(dacycle)
while DaCycle['time.start'] < DaCycle['time.finish']:
q = summarize_stats(DaCycle)
DaCycle.advance_cycle_times()
while dacycle['time.start'] < dacycle['time.finish']:
q = summarize_stats(dacycle)
dacycle.advance_cycle_times()
sys.exit(0)
......
......@@ -52,13 +52,12 @@ class DaSystem(dict):
self.ID = 'CarbonTracker CO2' # the identifier gives the platform name
self.load_rc(rcfilename)
logging.debug("Data Assimilation System initialized: %s" % self.Identifier)
logging.debug("Data Assimilation System initialized: %s" % self.ID)
def load_rc(self, rcfilename):
"""
This method loads a DA System Info rc-file with settings for this simulation
"""
for k, v in rc.read(rcfilename).iteritems():
self[k] = v
......
......@@ -53,7 +53,7 @@ class Observations(object):
self.version = version
self.datalist = [] # initialize with an empty list of obs
# The following code allows the object to be initialized with a DaCycle object already present. Otherwise, it can
# The following code allows the object to be initialized with a dacycle object already present. Otherwise, it can
# be added at a later moment.
logging.info('Observations object initialized: %s' % self.ID)
......
......@@ -28,25 +28,25 @@ class ObservationOperator(object):
"""
def __init__(self, rcfilename, DaCycle=None):
def __init__(self, rcfilename, dacycle=None):
""" The instance of an ObservationOperator is application dependent """
self.Identifier = identifier
self.Version = version
self.RestartFileList = []
self.ID = identifier
self.version = version
self.restart_filelist = []
self.outputdir = None # Needed for opening the samples.nc files created
self.load_rc(rcfilename) # load the specified rc-file
self.validate_rc() # validate the contents
logging.info('Observation Operator object initialized: %s' % self.Identifier)
logging.info('Observation Operator object initialized: %s' % self.ID)
# The following code allows the object to be initialized with a DaCycle object already present. Otherwise, it can
# The following code allows the object to be initialized with a dacycle object already present. Otherwise, it can
# be added at a later moment.
if DaCycle != None:
self.DaCycle = DaCycle
if dacycle != None:
self.dacycle = dacycle
else:
self.DaCycle = {}
self.dacycle = {}
def get_initial_data(self):
......
......@@ -13,7 +13,6 @@ File created on 28 Jul 2010.
import logging
import numpy as np
import numpy.linalg as la
import da.tools.io4 as io
identifier = 'Optimizer baseclass'
......@@ -82,7 +81,7 @@ class Optimizer(object):
# Kalman Gain matrix
self.KG = np.zeros((self.nlag * self.nparams, self.nobs,), float)
def state_to_matrix(self, StateVector):
def state_to_matrix(self, statevector):
allsites = [] # collect all obs for n=1,..,nlag
allobs = [] # collect all obs for n=1,..,nlag
allmdm = [] # collect all mdm for n=1,..,nlag
......@@ -94,10 +93,10 @@ class Optimizer(object):
allsimulated = None # collect all members model samples for n=1,..,nlag
for n in range(self.nlag):
samples = StateVector.ObsToAssimmilate[n]
members = StateVector.EnsembleMembers[n]
self.x[n * self.nparams:(n + 1) * self.nparams] = members[0].ParameterValues
self.X_prime[n * self.nparams:(n + 1) * self.nparams, :] = np.transpose(np.array([m.ParameterValues for m in members]))
samples = statevector.obs_to_assimmilate[n]
members = statevector.ensemble_members[n]
self.x[n * self.nparams:(n + 1) * self.nparams] = members[0].param_values
self.X_prime[n * self.nparams:(n + 1) * self.nparams, :] = np.transpose(np.array([m.param_values for m in members]))
if samples != None:
self.rejection_threshold = samples.rejection_threshold
......@@ -139,11 +138,11 @@ class Optimizer(object):
for i, mdm in enumerate(allmdm):
self.R[i, i] = mdm ** 2
def matrix_to_state(self, StateVector):
def matrix_to_state(self, statevector):
for n in range(self.nlag):
members = StateVector.EnsembleMembers[n]
members = statevector.ensemble_members[n]
for m, mem in enumerate(members):
members[m].ParameterValues[:] = self.X_prime[n * self.nparams:(n + 1) * self.nparams, m] + self.x[n * self.nparams:(n + 1) * self.nparams]
members[m].param_values[:] = self.X_prime[n * self.nparams:(n + 1) * self.nparams, m] + self.x[n * self.nparams:(n + 1) * self.nparams]
logging.debug('Returning optimized data to the StateVector, setting "StateVector.isOptimized = True" ')
......
......@@ -138,7 +138,8 @@ class Platform(object):
def job_stat(self, jobid):
""" This method gets the status of a running job """
output = subprocess.Popen(['qstat', jobid], stdout=subprocess.PIPE).communicate()[0] ; logging.info(output)
output = subprocess.Popen(['qstat', jobid], stdout=subprocess.PIPE).communicate()[0]
logging.info(output)
return output
......
......@@ -56,12 +56,12 @@ class EnsembleMember(object):
An EnsembleMember object is initialized with only a number, and holds two attributes as containter for later
data:
* ParameterValues, will hold the actual values of the parameters for this data
* param_values, will hold the actual values of the parameters for this data
* ModelSample, will hold an :class:`~da.baseclasses.obs.Observation` object and the model samples resulting from this members' data
"""
self.membernumber = membernumber # the member number
self.ParameterValues = None # Parameter values of this member
self.param_values = None # Parameter values of this member
################### End Class EnsembleMember ###################
......@@ -118,12 +118,12 @@ class StateVector(object):
self.ID = identifier
self.version = version
# The following code allows the object to be initialized with a DaCycle object already present. Otherwise, it can
# The following code allows the object to be initialized with a dacycle object already present. Otherwise, it can
# be added at a later moment.
logging.info('Statevector object initialized: %s' % self.ID)
def initialize(self, DaCycle):
def initialize(self, dacycle):
"""
initialize the object by specifying the dimensions.
There are two major requirements for each statvector that you want to build:
......@@ -134,33 +134,33 @@ class StateVector(object):
An example is given below.
"""
self.nlag = int(DaCycle['time.nlag'])
self.nmembers = int(DaCycle['da.optimizer.nmembers'])
self.nparams = int(DaCycle.DaSystem['nparameters'])
self.nlag = int(dacycle['time.nlag'])
self.nmembers = int(dacycle['da.optimizer.nmembers'])
self.nparams = int(dacycle.dasystem['nparameters'])
self.nobs = 0
self.ObsToAssimmilate = () # empty containter to hold observations to assimilate later on
self.obs_to_assimmilate = () # empty containter to hold observations to assimilate later on
# These list objects hold the data for each time step of lag in the system. Note that the ensembles for each time step consist
# of lists of EnsembleMember objects, we define member 0 as the mean of the distribution and n=1,...,nmembers as the spread.
self.EnsembleMembers = range(self.nlag)
self.ensemble_members = range(self.nlag)
for n in range(self.nlag):
self.EnsembleMembers[n] = []
self.ensemble_members[n] = []
# This specifies the file to read with the gridded mask at 1x1 degrees. Each gridbox holds a number that specifies the parametermember
# that maps onto it. From this map, a dictionary is created that allows a reverse look-up so that we can map parameters to a grid.
mapfile = os.path.join(DaCycle.DaSystem['regionsfile'])
mapfile = os.path.join(dacycle.dasystem['regionsfile'])
ncf = io.CT_Read(mapfile, 'read')
self.gridmap = ncf.get_variable('regions')
self.tcmap = ncf.get_variable('transcom_regions')
ncf.close()
logging.debug("A TransCom map on 1x1 degree was read from file %s" % DaCycle.DaSystem['regionsfile'])
logging.debug("A parameter map on 1x1 degree was read from file %s" % DaCycle.DaSystem['regionsfile'])
logging.debug("A TransCom map on 1x1 degree was read from file %s" % dacycle.dasystem['regionsfile'])
logging.debug("A parameter map on 1x1 degree was read from file %s" % dacycle.dasystem['regionsfile'])
# Create a dictionary for state <-> gridded map conversions
......@@ -255,29 +255,29 @@ class StateVector(object):
# If this is not the start of the filter, average previous two optimized steps into the mix
if lag == self.nlag - 1 and self.nlag >= 3:
newmean += self.EnsembleMembers[lag - 1][0].ParameterValues + \
self.EnsembleMembers[lag - 2][0].ParameterValues
newmean += self.ensemble_members[lag - 1][0].param_values + \
self.ensemble_members[lag - 2][0].param_values
newmean = newmean / 3.0
# Create the first ensemble member with a deviation of 0.0 and add to list
newmember = EnsembleMember(0)
newmember.ParameterValues = newmean.flatten() # no deviations
self.EnsembleMembers[lag].append(newmember)
newmember.param_values = newmean.flatten() # no deviations
self.ensemble_members[lag].append(newmember)
# Create members 1:nmembers and add to EnsembleMembers list
# Create members 1:nmembers and add to ensemble_members list
for member in range(1, self.nmembers):
rands = np.random.randn(self.nparams)
newmember = EnsembleMember(member)
newmember.ParameterValues = np.dot(C, rands) + newmean
self.EnsembleMembers[lag].append(newmember)
newmember.param_values = np.dot(C, rands) + newmean
self.ensemble_members[lag].append(newmember)
logging.debug('%d new ensemble members were added to the state vector # %d' % (self.nmembers, (lag + 1)))
def propagate(self, DaCycle):
def propagate(self, dacycle):
"""
:rtype: None
......@@ -292,12 +292,12 @@ class StateVector(object):
# Remove State Vector n=1 by simply "popping" it from the list and appending a new empty list at the front. This empty list will
# hold the new ensemble for the new cycle
self.EnsembleMembers.pop(0)
self.EnsembleMembers.append([])
self.ensemble_members.pop(0)
self.ensemble_members.append([])
# And now create a new time step of mean + members for n=nlag
date = DaCycle['time.start'] + timedelta(days=(self.nlag - 0.5) * int(DaCycle['time.cycle']))
cov = self.get_covariance(date, DaCycle)
date = dacycle['time.start'] + timedelta(days=(self.nlag - 0.5) * int(dacycle['time.cycle']))
cov = self.get_covariance(date, dacycle)
self.make_new_ensemble(self.nlag - 1, cov)
logging.info('The state vector has been propagated by one cycle')
......@@ -335,19 +335,19 @@ class StateVector(object):
dimlag = f.add_lag_dim(self.nlag, unlimited=True)
for n in range(self.nlag):
members = self.EnsembleMembers[n]
MeanState = members[0].ParameterValues
members = self.ensemble_members[n]
mean_state = members[0].param_values
savedict = f.standard_var(varname='meanstate_%s' % qual)
savedict['dims'] = dimlag + dimparams
savedict['values'] = MeanState
savedict['values'] = mean_state
savedict['count'] = n
savedict['comment'] = 'this represents the mean of the ensemble'
f.add_data(savedict)
members = self.EnsembleMembers[n]
devs = np.asarray([m.ParameterValues.flatten() for m in members])
data = devs - np.asarray(MeanState)
members = self.ensemble_members[n]
devs = np.asarray([m.param_values.flatten() for m in members])
data = devs - np.asarray(mean_state)
savedict = f.standard_var(varname='ensemblestate_%s' % qual)
savedict['dims'] = dimlag + dimmembers + dimparams
......@@ -381,18 +381,18 @@ class StateVector(object):
#import da.tools.io as io
f = io.CT_Read(filename, 'read')
meanstate = f.get_variable('statevectormean_' + qual)
EnsembleMembers = f.get_variable('statevectorensemble_' + qual)
ensmembers = f.get_variable('statevectorensemble_' + qual)
f.close()
for n in range(self.nlag):
if not self.EnsembleMembers[n] == []:
self.EnsembleMembers[n] = []
if not self.ensemble_members[n] == []:
self.ensemble_members[n] = []
logging.warning('Existing ensemble for lag=%d was removed to make place for newly read data' % (n + 1))
for m in range(self.nmembers):
newmember = EnsembleMember(m)
newmember.ParameterValues = EnsembleMembers[n, m, :].flatten() + meanstate[n] # add the mean to the deviations to hold the full parameter values
self.EnsembleMembers[n].append(newmember)
newmember.param_values = ensmembers[n, m, :].flatten() + meanstate[n] # add the mean to the deviations to hold the full parameter values
self.ensemble_members[n].append(newmember)
logging.info('Successfully read the State Vector from file (%s) ' % filename)
......@@ -403,7 +403,7 @@ class StateVector(object):
Write ensemble member information to a NetCDF file for later use. The standard output filename is
*parameters.DDD.nc* where *DDD* is the number of the ensemble member. Standard output file location
is the `dir.input` of the DaCycle object. In principle the output file will have only two datasets inside
is the `dir.input` of the dacycle object. In principle the output file will have only two datasets inside
called `parametervalues` which is of dimensions `nparameters` and `parametermap` which is of dimensions (180,360).
This dataset can be read and used by a :class:`~da.baseclasses.observationoperator.ObservationOperator` object.
......@@ -418,7 +418,7 @@ class StateVector(object):
#import da.tools.io as io