Download scripts/fake_data.py from OneScience-Group/NNCAM: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/OneScience-Group/NNCAM/resolve/main/scripts/fake_data.py
- Command line
-
hf download hf://OneScience-Group/NNCAM/scripts/fake_data.py
-
curl -L -o fake_data.py https://huggingface.co/OneScience-Group/NNCAM/resolve/main/scripts/fake_data.py
1.02 kB
| #!/usr/bin/env python3 | |
| import argparse | |
| from pathlib import Path | |
| import numpy as np | |
| ROOT = Path(__file__).resolve().parents[1] | |
| import sys | |
| sys.path.insert(0, str(ROOT)) | |
| from model.nncam import generate_fake_data | |
| def main(): | |
| parser = argparse.ArgumentParser(description="Create deterministic synthetic NNCAM columns.") | |
| parser.add_argument("--samples", type=int, default=192) | |
| parser.add_argument("--seed", type=int, default=42) | |
| parser.add_argument("--output", type=Path, default=ROOT / "data/nncam_fake.npz") | |
| args = parser.parse_args() | |
| x, y, lat, time = generate_fake_data(args.samples, args.seed) | |
| assert x.shape == (args.samples, 94) and y.shape == (args.samples, 65) | |
| assert np.isfinite(x).all() and np.isfinite(y).all() and (y[:, 64] >= 0).all() | |
| args.output.parent.mkdir(parents=True, exist_ok=True) | |
| np.savez_compressed(args.output, x=x, y=y, lat=lat, time=time) | |
| print(f"saved {args.output}: x={x.shape}, y={y.shape}, finite=true") | |
| if __name__ == "__main__": | |
| main() | |