Download scripts/fake_data.py from OneScience-Group/Climate2Weather: direct link, hf CLI and curl.
- Browser
- Download file 463 Bytes
-
https://huggingface.co/OneScience-Group/Climate2Weather/resolve/main/scripts/fake_data.py
- Command line
-
hf download hf://OneScience-Group/Climate2Weather/scripts/fake_data.py
-
curl -L -o fake_data.py https://huggingface.co/OneScience-Group/Climate2Weather/resolve/main/scripts/fake_data.py
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) | |