| rmse=np.sqrt(np.mean((d["predicted_fields"]-d["target_fields"])**2,axis=(0,2,3)));write_json(ROOT/c["paths"]["evaluation"],{"pc_r2":r2,"spatial_rmse":{"GPP":float(rmse[0]),"LHF":float(rmse[1])},"estimated_parameters":d["best_parameters"].tolist(),"calibration_cost":float(d["cost"]),"synthetic":True});fig,ax=plt.subplots(1,2,figsize=(9,3.5));ax[0].scatter(t[:,0,0],p[:,0,0]);ax[0].set(xlabel="CLM PC1",ylabel="Emulated PC1",title="GPP emulator");im=ax[1].imshow((d["predicted_fields"][0,1]-d["target_fields"][0,1]),cmap="coolwarm");ax[1].set_title("LHF spatial error");fig.colorbar(im,ax=ax[1]);fig.tight_layout();path=ROOT/c["paths"]["figure"];path.parent.mkdir(parents=True,exist_ok=True);fig.savefig(path,dpi=150);print(path) |