Commit b87a1c72 authored by saeed's avatar saeed
Browse files

a bit modification

parent 8b673b1b
#!/bin/bash
mkdir baltic
mkdir danish_straits
mkdir swed_west
mkdir northsea
mkdir other
mv taylorarko.png taylorbonan_sjov.png taylordaugavgriva.png taylordegerby.png taylorforsmark.png taylorfuruogrund.png taylorgdansk.png taylorhanko.png taylorhelsinki.png taylorholmsund_sjov.png taylorjuten_sjov.png taylorkalix.png taylorkalix_sjov.png taylorkalmar_sjov.png taylorkarlshamn_sjov.png taylorkaskinen.png taylorkemi.png taylorkolka.png taylorkoserow.png taylorkronstadt.png taylorkungsholmsfort.png taylorlandsort_norra.png baltic/
mv taylorlandsort_sjov.png taylormarviken.png taylornynashamn_sjov.png tayloroskarshamn.png tayloroulu.png taylorparnu.png taylorpori.png taylorporvoo.png taylorratan.png taylorsimpevarp_sjov.png taylorsimrisha
mn.png taylorskagsudde_sjov.png taylorslite_sjov.png taylorspikarna.png taylorspikarna_RH2000.png taylorspikarna_sjov.png taylorstockholm.png taylorstockholm_RH2000.png taylorst_petersburg.png taylortallinn.png taylortravemunde.png taylorturku.png taylorustka.png taylorvaasa.png taylorvisby.png taylorvisby_sjov.png taylorwarnemunde.png taylorystad_sjov.png baltic
mv taylorbrofjorden_sjov.png taylorfalkenberg_sjov.png taylorgoteborg-gotaalvbron.png taylorgoteborg.png taylorkaret-gbg-hamn_sjov.png taylorkungsvik.png taylormarstrand_sjov.png taylormavholmsbadan_sjov.png tayloronsala.png taylorringhals.png taylorsmogen.png taylorstenungsund.png tayloruddevalla.png taylorvarberg_sjov.png taylorviken.png taylorvinga_sjov.png swed_west/
mv taylorhanstholm.png taylorhirtshals.png taylorskagen.png northsea/
mv taylorballen.png taylorbarseback.png taylordrogden.png taylorfredericia.png taylorgedser.png taylorgrena.png taylorhelsingborg_sjov.png taylorhornbaek.png taylorjuelsminde.png taylorklagshamn.png taylorkorsor.png taylormalmo-hamn_sjov.png taylorrodby.png taylorsassnitz.png taylorskanor.png taylorslipshavn.png danish_straits/
mv taylor* other/
......@@ -61,7 +61,8 @@ def fillObs(date_obs,fromt, tot):
#return dmiss
def biasMean(vobs, vmodel):
print "vobsshape",vobs.shape
print "vmodelshape",vmodel.shape
if vobs.shape[0] != vmodel.shape[0] :
print "vobs and vmodel should have the same size"
sys.exit()
......@@ -82,7 +83,10 @@ def readConfig():
sys.exit(1)
with open(config_file, 'r') as fptr_cfg:
print fptr_cfg
print "here"
cfg = json.load(fptr_cfg)
print "here"
server = cfg["server"]
dovalidation = cfg["dovalidation"]
station = cfg["station"]
......@@ -92,6 +96,8 @@ def readConfig():
expname = cfg["experiment"]
oper = cfg["operational"]
tickint = cfg["tickinterval_hour"]
print server
print oper
return server,dovalidation, station, startdate, enddate,obstyle, expname, oper, tickint
......@@ -152,12 +158,18 @@ def readExpr(expname,station,startdate,enddate,vobsm):
def readOper(server,oper,station,startdate,enddate,vobsm):
if server["prod"]:param= {'from': startdate, 'too': enddate}
if server["utv"]: param= {'highfreq':'false','from': startdate, 'too': enddate}
for model in oper:
if server["prod"]:res1= req.get("http://oceandata.smhi.se/ssh/"+station+"/"+model,params = param)
if server["utv"]:res1 = req.get("http://oceandata-utv.smhi.se/ssh/"+station+"/"+model,params = param)
doper = res1.json()
date_obs = doper.keys()
dmiss = fillObs(date_obs,startdate, enddate)
if dmiss.keys():
doper.update(dmiss)
vm = pd.DataFrame.from_dict(doper,orient="index")
voper = vm["raw"].loc[startdate:enddate].values
print "model ", model, len(voper)
voper = voper + biasMean(vobsm,voper)
lcorr = np.ma.corrcoef(voper, vobsm)[0,1]
lrms = np.sqrt(np.mean((voper - vobsm)**2),dtype=np.float64)
......@@ -193,7 +205,7 @@ def main():
for im in range(len(vssh)):
if im == 0:
ax.plot(vssh[im],'o-',color=ccolor[im],ms=3)
ax.plot(vssh[im],'o-',color=ccolor[im],ms=2)
else:
ax.plot(vssh[im],linestyle=cstyle[im],color=ccolor[im],lw=0.75)
......
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