File size: 775 Bytes
bec9cbb
 
 
 
1
2
3
4
5
from pathlib import Path
import sys,numpy as np;import matplotlib;matplotlib.use('Agg');import matplotlib.pyplot as plt
R=Path(__file__).resolve().parents[1];sys.path.insert(0,str(R));from model.dlesym import cfg,write
c=cfg(R);d=np.load(R/c['paths']['predictions']);a=d['atmosphere'];s=d['sst'];drift=np.sqrt(np.mean((a-a[:1])**2,axis=(1,2,3)));sst=s.mean((1,2,3));prec=d['precipitation'].mean((1,2,3));write(R/c['paths']['evaluation'],{'atmosphere_drift_rmse':drift.tolist(),'sst_mean':sst.tolist(),'precipitation_mean':prec.tolist(),'is_complete_global':False,'synthetic':True});plt.plot(d['lead_days'],drift);plt.xlabel('Lead (days)');plt.ylabel('Atmosphere drift RMSE');p=R/c['paths']['figure'];p.parent.mkdir(parents=True,exist_ok=True);plt.savefig(p,dpi=150);print(p)