GFS要素清单:1-5#
import numpy as np
import pandas as pd
import xarray as xr
from reki.format.grib.eccodes import load_field_from_file
/home/wangdp/project/cedarkit/notebook-project/notebook-devel/ref/data-notebook-project/data-notebook/.venv/lib/python3.14/site-packages/gribapi/__init__.py:23: UserWarning: ecCodes 2.42.0 or higher is recommended. You are running version 2.34.1
warnings.warn(
from data_notebook.data import get_data_file
gfs_grib2_orig_file_path = get_data_file("cma-gfs")
gfs_grib2_orig_file_path
PosixPath('/home/wangdp/project/cedarkit/notebook-project/notebook-devel/ref/data-notebook-project/data-notebook/data/cma-gfs/grib2/orig/Z_NAFP_C_BABJ_20260725000000_P_NWPC-GRAPES-GFS-GLB-02400.grib2')
ACPCP/NCPCP/APCP/ASNOW#
对流降水#
要素名 |
wgrib2 |
eccodes |
cemc |
GRIB key |
层次类型 |
层次 |
编号 |
|---|---|---|---|---|---|---|---|
对流降水 |
ACPCP |
acpcp |
rainc |
(0, 1, 10) |
- |
- |
1 |
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="ACPCP",
lazy=True
)
assert field.attrs["GRIB_count"] == 1
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="acpcp",
lazy=True
)
assert field.attrs["GRIB_count"] == 1
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="rainc",
lazy=True
)
assert field.attrs["GRIB_count"] == 1
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter={
"discipline": 0,
"parameterCategory": 1,
"parameterNumber": 10,
},
lazy=True
)
assert field.attrs["GRIB_count"] == 1
大尺度降水#
要素名 |
wgrib2 |
eccodes |
cemc |
GRIB Key |
层次类型 |
层次 |
编号 |
|---|---|---|---|---|---|---|---|
大尺度降水 |
NCPCP |
ncpcp |
rainnc |
(0, 1, 9) |
- |
- |
2 |
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="NCPCP",
lazy=True
)
assert field.attrs["GRIB_count"] == 2
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="ncpcp",
lazy=True
)
assert field.attrs["GRIB_count"] == 2
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="rainnc",
lazy=True
)
assert field.attrs["GRIB_count"] == 2
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter={
"discipline": 0,
"parameterCategory": 1,
"parameterNumber": 9,
},
lazy=True
)
assert field.attrs["GRIB_count"] == 2
总降水#
要素名 |
wgrib2 |
eccodes |
cemc |
GRIB Key |
层次类型 |
层次 |
编号 |
|---|---|---|---|---|---|---|---|
总降水 |
APCP |
- |
rain |
(0, 1, 8) |
- |
- |
3 |
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="APCP",
lazy=True
)
assert field.attrs["GRIB_count"] == 3
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="rain",
lazy=True
)
assert field.attrs["GRIB_count"] == 3
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter={
"discipline": 0,
"parameterCategory": 1,
"parameterNumber": 8,
},
lazy=True
)
assert field.attrs["GRIB_count"] == 3
降雪量#
要素名 |
wgrib2 |
eccodes |
cemc |
GRIB Key |
层次类型 |
层次 |
编号 |
|---|---|---|---|---|---|---|---|
降雪量 |
ASNOW |
- |
snow |
(0, 1, 29) |
- |
- |
4 |
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="ASNOW",
lazy=True
)
assert field.attrs["GRIB_count"] == 4
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter={
"discipline": 0,
"parameterCategory": 1,
"parameterNumber": 29,
},
lazy=True
)
assert field.attrs["GRIB_count"] == 4
TMP#
地表温度#
要素名 |
wgrib2 |
eccodes |
cemc |
GRIB Key |
层次类型 |
层次 |
编号 |
|---|---|---|---|---|---|---|---|
地表温度 |
TMP |
t |
ts |
(0, 0, 0) |
surface |
- |
5 |
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="TMP",
level_type="sfc",
lazy=True
)
assert field.attrs["GRIB_count"] == 5
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="t",
level_type="surface",
lazy=True
)
assert field.attrs["GRIB_count"] == 5
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="ts",
lazy=True
)
assert field.attrs["GRIB_count"] == 5
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter={
"discipline": 0,
"parameterCategory": 0,
"parameterNumber": 0,
},
level_type="sfc",
lazy=True
)
assert field.attrs["GRIB_count"] == 5