Climate2Weather / scripts /fake_data.py
zhangrenchao's picture
Publish Climate2Weather reproduction
21b9cf1 verified
Raw
History Blame Contribute Delete
463 Bytes
from pathlib import Path
import sys,numpy as np
R=Path(__file__).resolve().parents[1];sys.path.insert(0,str(R));from model.climate2weather import *
c=cfg(R);f=np.stack([truth(i).numpy() for i in range(6)]);co=np.stack([observe(torch.tensor(x)).numpy() for x in f]);p=R/c['data']['path'];p.parent.mkdir(parents=True,exist_ok=True);np.savez_compressed(p,fine=f,coarse=co,variables=['uas','vas','tas','psl'],fine_shape=[3,4,128,128],coarse_shape=[3,4,8,8]);print(p)