Commit 299a801c authored by brunner's avatar brunner
Browse files

No commit message

No commit message
parent 7de15514
......@@ -374,7 +374,8 @@ class Obs(Observations):
name = name.strip().lower()
# print 'PAVLE NAME ',name,error, may_localize, may_reject
error = float(error)
may_reject = ("TRUE" in may_reject.upper())
may_reject = ("FALSE" in may_reject.upper())
# may_reject = ("TRUE" in may_reject.upper())
may_localize = ("TRUE" in may_localize.upper())
site_categories[name] = {'category': name, 'error': error, 'may_localize': may_localize, 'may_reject': may_reject}
......
......@@ -119,19 +119,16 @@ class ObservationOperator(object):
# for ncfile in ncfilelist:
# infile = os.path.join(ncfile + '.nc')
for dt in rrule.rrule(rrule.HOURLY, dtstart=dacycle['time.start'], until=dacycle['time.start']+timedelta(hours=168)):
for ens in range(0,self.forecast_nmembers):
ens = str(ens).zfill(3)
cdo.expr("CO2_GPP_"+ens+"_F=parametermap*CO2_GPP_F -merge /scratch/snx3000/parsenov/projname/input/parameters."+ens+".nc", input = os.path.join(dacycle['da.bio.input'], 'gpp_%s.nc' % dt.strftime('%Y%m%d%H')), output = os.path.join(dacycle['da.bio.input'], 'ensemble', "gpp_"+ens+"_%s.nc" % dt.strftime('%Y%m%d%H')))
cdo.expr("CO2_RESP_"+ens+"_F=parametermap*CO2_RESP_F -merge /scratch/snx3000/parsenov/projname/input/parameters."+ens+".nc", input = os.path.join(dacycle['da.bio.input'], 'ra_%s.nc' % dt.strftime('%Y%m%d%H')), output = os.path.join(dacycle['da.bio.input'], 'ensemble', "ra_"+ens+"_%s.nc" % dt.strftime('%Y%m%d%H')))
cdo.merge(input = os.path.join(dacycle['da.bio.input'], 'ensemble', "gpp_???_%s.nc" % dt.strftime('%Y%m%d%H')), output = os.path.join(dacycle['da.bio.input'], 'ensemble', "gpp_%s.nc" % dt.strftime('%Y%m%d%H')))
cdo.merge(input = os.path.join(dacycle['da.bio.input'], 'ensemble', "ra_???_%s.nc" % dt.strftime('%Y%m%d%H')), output = os.path.join(dacycle['da.bio.input'], 'ensemble', "ra_%s.nc" % dt.strftime('%Y%m%d%H')))
os.system('python '+dacycle['da.obsoperator.home']+' ctdas '+dacycle['time.start'].strftime('%Y-%m-%d')+' 0 168 -j meteo icbc emissions biofluxes int2lm post_int2lm')
# here comes COSMO
# os.system('python '+cosmo+' ctdas '+self['time.start'].strftime('%Y-%m-%d')+' 0 672 -j cosmo')
# extract_model_data(self.forecast_nmembers)
sys.exit()
#for dt in rrule.rrule(rrule.HOURLY, dtstart=dacycle['time.start'], until=dacycle['time.start']+timedelta(hours=168)):
# for ens in range(0,self.forecast_nmembers):
# ens = str(ens).zfill(3)
# cdo.setunit("'kg m-2 s-1' -expr,GPP_"+ens+"_F=CO2_GPP_F*parametermap -merge "+os.path.join(dacycle['da.bio.input'], 'gpp_%s.nc' % dt.strftime('%Y%m%d%H')), input = "/scratch/snx3000/parsenov/projname/input/parameters."+ens+".nc", output = os.path.join(dacycle['da.bio.input'], 'ensemble', "gpp_"+ens+"_%s.nc" % dt.strftime('%Y%m%d%H')))
# cdo.setunit("'kg m-2 s-1' -expr,RESP_"+ens+"_F=CO2_RESP_F*parametermap -merge "+os.path.join(dacycle['da.bio.input'], 'ra_%s.nc' % dt.strftime('%Y%m%d%H')), input = "/scratch/snx3000/parsenov/projname/input/parameters."+ens+".nc", output = os.path.join(dacycle['da.bio.input'], 'ensemble', "ra_"+ens+"_%s.nc" % dt.strftime('%Y%m%d%H')))
# cdo.merge(input = os.path.join(dacycle['da.bio.input'], 'ensemble', "gpp_???_%s.nc" % dt.strftime('%Y%m%d%H')), output = os.path.join(dacycle['da.bio.input'], 'ensemble', "gpp_%s.nc" % dt.strftime('%Y%m%d%H')))
# cdo.merge(input = os.path.join(dacycle['da.bio.input'], 'ensemble', "ra_???_%s.nc" % dt.strftime('%Y%m%d%H')), output = os.path.join(dacycle['da.bio.input'], 'ensemble', "ra_%s.nc" % dt.strftime('%Y%m%d%H')))
# os.chdir(dacycle['da.obsoperator.home'])
# os.system('python run_chain.py ctdas '+dacycle['time.start'].strftime('%Y-%m-%d')+' 0 168 -j meteo icbc emissions biofluxes int2lm post_int2lm cosmo')
self.extract_model_data(dacycle,self.forecast_nmembers)
for i in range(0,self.forecast_nmembers):
idx=str(i+1)
......@@ -168,12 +165,15 @@ class ObservationOperator(object):
self.prepare_run()
self.run(dacycle)
def extract_model_data(ens):
def extract_model_data(self,dacycle,ens):
files2cat=[]
time_stamp = self['time.sample.stamp']
cosmo_out = self['da.cosmo_path']+'/'+ens+'/'+time_stamp+'cosmo/output'
self.dacycle = dacycle
# time_stamp = dacycle['time.sample.stamp']
cosmo_time_stamp = dacycle['time.start']+timedelta(hours=168)
print(cosmo_time_stamp)
sys.exit()
cosmo_out = "/scratch/snx3000/parsenov/ctdas/2013040100_0_168/cosmo"
os.chdir(cosmo_out)
for time in tools.iter_hours(starttime, hstart, hstop):
......
......@@ -289,6 +289,7 @@ class StateVector(object):
for member in range(1, self.nmembers):
rands = np.random.randn(self.nparams)
rands = np.clip(rands,-1,1)
newmember = EnsembleMember(member)
newmember.param_values = np.dot(C, rands) + newmean
......
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