File size: 1,366 Bytes
f637d77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Normalization files

This folder provides the normalization (standardization) parameters used for FuXi-CFD inference.

## Overview
- Inputs are standardized before being fed to the ONNX model.
- Model outputs are de-standardized back to physical scale after inference.

## Files
- `scaler_input.npy`  : dict of input normalization stats (mean/std) for static/dynamic input variables
- `scaler_output.npy` : dict of output normalization stats (mean/std) for model outputs
Both are stored as Python dicts inside `.npy` (load with `allow_pickle=True`).

## Input normalization (`scaler_input.npy`)
Keys:
- `low_mean`, `low_std` for low-res dynamic inputs: `["u_100m", "v_100m"]`
- `high_mean`, `high_std` for high-res static inputs: `["dem", "roughness"]`

Final ONNX input channel order **must** be:
`[u_100m, v_100m, dem, roughness]`  (C=4)

## Output de-normalization (`scaler_output.npy`)
Keys:
- `mean`, `std`: arrays of shape `(27, 4)` (levels=27, vars=4)

Output variable order:
`[u, v, w, k]`

The ONNX model output tensor is expected as:
`(1, 27, 4, 300, 300)` and de-normalization applies:
`pred = pred * std + mean` (broadcast on `(300,300)`)

## Example loading
```python
import numpy as np
in_stats = np.load("normalization/scaler_input.npy", allow_pickle=True).item()
out_stats = np.load("normalization/scaler_output.npy", allow_pickle=True).item()
```