Update README.md
Browse files
README.md
CHANGED
@@ -2,55 +2,58 @@
|
|
2 |
license: mit
|
3 |
---
|
4 |
|
5 |
-
#
|
6 |
|
7 |
-
This is a global data-driven high-resolution weather model implemented and open sourced by [High-Flyer AI](https://www.high-flyer.cn/). It is the first AI weather model, which can compare with the ECMWF Integrated Forecasting System (IFS).
|
8 |
|
9 |
-
|
|
|
|
|
10 |
|
11 |
![](./img/wind_small.gif)
|
12 |
|
13 |
-
Water vapour
|
14 |
|
15 |
![](./img/precipitation_small.gif)
|
16 |
|
17 |
-
|
18 |
|
19 |
-
|
20 |
-
- torch >=1.8
|
21 |
|
|
|
22 |
|
23 |
-
|
24 |
-
|
|
|
|
|
25 |
|
26 |
-
|
|
|
|
|
|
|
27 |
|
28 |
-
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
```
|
33 |
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
-
|
37 |
-
hfai python train/fine_tune.py -- -n 8 -p 30
|
38 |
-
```
|
39 |
|
40 |
-
3. train `precipitation.pt`
|
41 |
|
42 |
-
|
43 |
-
hfai python train/precipitation.py -- -n 8 -p 30
|
44 |
-
```
|
45 |
|
|
|
|
|
46 |
|
47 |
-
|
|
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
title={Fourcastnet: A global data-driven high-resolution weather model using adaptive fourier neural operators},
|
52 |
-
author={Pathak, Jaideep and Subramanian, Shashank and Harrington, Peter and Raja, Sanjeev and Chattopadhyay, Ashesh and Mardani, Morteza and Kurth, Thorsten and Hall, David and Li, Zongyi and Azizzadenesheli, Kamyar and others},
|
53 |
-
journal={arXiv preprint arXiv:2202.11214},
|
54 |
-
year={2022}
|
55 |
-
}
|
56 |
-
```
|
|
|
2 |
license: mit
|
3 |
---
|
4 |
|
5 |
+
# FourCastNet: a global data-driven high-resolution weather model
|
6 |
|
7 |
+
This is a global data-driven high-resolution weather model implemented, trained and open sourced by [High-Flyer AI](https://www.high-flyer.cn/en/). It is the first AI weather model, which can compare with the ECMWF Integrated Forecasting System (IFS).
|
8 |
|
9 |
+
See also: [Github repository](https://github.com/HFAiLab/FourCastNet) and [High-flyer AI's blog](https://www.high-flyer.cn/blog/fourcastnet/)
|
10 |
+
|
11 |
+
Typhoon track prediction:
|
12 |
|
13 |
![](./img/wind_small.gif)
|
14 |
|
15 |
+
Water vapour prediction:
|
16 |
|
17 |
![](./img/precipitation_small.gif)
|
18 |
|
19 |
+
For more cases about FourCastNet prediction, please have a look at [HF-Earth](https://www.high-flyer.cn/hf-earth/), a daily updated demo released by [High-Flyer AI](https://www.high-flyer.cn/en/).
|
20 |
|
21 |
+
## Inference
|
|
|
22 |
|
23 |
+
You can load the weights `backbone.pt` and `precipitation.pt` to generate weather predictions, as shown in the following pseudocode. The complete code is released at `./infer2img.py`.
|
24 |
|
25 |
+
```python
|
26 |
+
import xarray as xr
|
27 |
+
import cartopy.crs as ccrs
|
28 |
+
from afnonet import AFNONet # download the code from https://github.com/HFAiLab/FourCastNet/blob/master/model/afnonet.py
|
29 |
|
30 |
+
backbone_model = AFNONet(img_size=[720, 1440], in_chans=20, out_chans=20, norm_layer=partial(nn.LayerNorm, eps=1e-6))
|
31 |
+
backbone_model.load('./backbone.pt')
|
32 |
+
precip_model = AFNONet(img_size=[720, 1440], in_chans=20, out_chans=1, norm_layer=partial(nn.LayerNorm, eps=1e-6))
|
33 |
+
precip_model.load('./precipitation.pt')
|
34 |
|
35 |
+
input_x = get_data('2023-01-01 00:00:00')
|
36 |
|
37 |
+
pred_x = backbone_model(input_x) # input Xt, output Xt+1
|
38 |
+
pred_p = precip_model(pred_x) # input Xt+1, output Pt+1
|
|
|
39 |
|
40 |
+
plot_data = xr.Dataset([pred_x, pred_p])
|
41 |
+
ax = plt.axes(projection=ccrs.PlateCarree())
|
42 |
+
plot_data.plot(ax=ax, transform=ccrs.PlateCarree(), add_colorbar=False, add_labels=False, rasterized=True)
|
43 |
+
ax.coastlines(resolution='110m')
|
44 |
+
plt.savefig('img.png')
|
45 |
+
```
|
46 |
|
47 |
+
FourCastNet can predict 7 surface variables, plus 5 atmospheric variables at each of 3 or 4 pressure levels, for 21 variables total. The details of these variables follow the [paper](https://arxiv.org/abs/2202.11214).
|
|
|
|
|
48 |
|
|
|
49 |
|
50 |
+
## Description of Files
|
|
|
|
|
51 |
|
52 |
+
`backbone.pt`
|
53 |
+
+ the weights of backbone model, 191MB, which is trained on 20 atmospheric variables from `1979-01` to `2022-12`.
|
54 |
|
55 |
+
`precipitation.pt`
|
56 |
+
+ the weights of precipitation model, 187MB, which is trained on the variable `total_precipitation` from `1979-01` to `2022-12`.
|
57 |
|
58 |
+
`infer2img.py`
|
59 |
+
+ Case code: load the above two weights to generate images of global weather prediction.
|
|
|
|
|
|
|
|
|
|
|
|