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/repo/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_pathPosixPath('/home/wangdp/project/cedarkit/notebook-project/notebook-devel/repo/data-notebook-project/data-notebook/data/cma-gfs/grib2/orig/Z_NAFP_C_BABJ_20260811000000_P_NWPC-GRAPES-GFS-GLB-02400.grib2')light/VIS/fogh/fogod/GUST/¶
雷电概率¶
| 要素名 | cemc | wgrib2 | eccodes | GRIB Key | 层次类型 | 层次 | 编号 |
|---|---|---|---|---|---|---|---|
| 雷电概率 | light | - | - | (0, 1, 238) | surface | - | 851 |
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="light",
lazy=True
)
assert field.attrs["GRIB_count"] == 851field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter={
"discipline": 0,
"parameterCategory": 1,
"parameterNumber": 238,
},
level_type="surface",
lazy=True
)
assert field.attrs["GRIB_count"] == 851能见度¶
| 要素名 | cemc | wgrib2 | eccodes | GRIB Key | 层次类型 | 层次 | 编号 |
|---|---|---|---|---|---|---|---|
| 能见度 | vis | VIS | vis | (0, 19, 0) | surface | - | 852 |
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="VIS",
lazy=True
)
assert field.attrs["GRIB_count"] == 852field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="vis",
lazy=True
)
assert field.attrs["GRIB_count"] == 852field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter={
"discipline": 0,
"parameterCategory": 19,
"parameterNumber": 0,
},
level_type="surface",
lazy=True
)
assert field.attrs["GRIB_count"] == 852雾顶高度 / 光学厚度¶
| 要素名 | cemc | wgrib2 | eccodes | GRIB Key | 层次类型 | 层次 | 编号 |
|---|---|---|---|---|---|---|---|
| 雾顶高度 | fogh | - | - | (0, 19, 224) | surface | - | 853 |
| 光学厚度 | fogod | - | - | (0, 19, 225) | surface | - | 854 |
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="fogh",
lazy=True
)
assert field.attrs["GRIB_count"] == 853field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter={
"discipline": 0,
"parameterCategory": 19,
"parameterNumber": 224,
},
lazy=True
)
assert field.attrs["GRIB_count"] == 853field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="fogod",
lazy=True
)
assert field.attrs["GRIB_count"] == 854field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter={
"discipline": 0,
"parameterCategory": 19,
"parameterNumber": 225,
},
lazy=True
)
assert field.attrs["GRIB_count"] == 854阵风风速¶
| 要素名 | cemc | wgrib2 | eccodes | GRIB Key | 层次类型 | 层次 | 编号 |
|---|---|---|---|---|---|---|---|
| 10米阵风风速 | gust | GUST | i10fg | (0, 2, 22) | heightAboveGround | 10 | 855 |
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="GUST",
level_type="heightAboveGround",
level=10,
lazy=True
)
assert field.attrs["GRIB_count"] == 855field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="i10fg",
lazy=True
)
assert field.attrs["GRIB_count"] == 855field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="gust",
level_type="heightAboveGround",
level=10,
lazy=True
)
assert field.attrs["GRIB_count"] == 855field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter={
"discipline": 0,
"parameterCategory": 2,
"parameterNumber": 22,
},
level_type="heightAboveGround",
level=10,
lazy=True
)
assert field.attrs["GRIB_count"] == 855降水类型¶
| 要素名 | cemc | wgrib2 | eccodes | GRIB Key | 层次类型 | 层次 | 编号 |
|---|---|---|---|---|---|---|---|
| 降水类型 | precitype | PTYPE | ptype | (0, 1, 19) | surface | - | 856 |
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="PTYPE",
lazy=True
)
assert field.attrs["GRIB_count"] == 856field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="ptype",
lazy=True
)
assert field.attrs["GRIB_count"] == 856field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="precitype",
lazy=True
)
assert field.attrs["GRIB_count"] == 856field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter={
"discipline": 0,
"parameterCategory": 1,
"parameterNumber": 19,
},
lazy=True
)
assert field.attrs["GRIB_count"] == 856CDCTOP/CDCB/CEIL¶
云顶高度¶
| 要素名 | cemc | wgrib2 | eccodes | GRIB Key | 层次类型 | 层次 | 编号 |
|---|---|---|---|---|---|---|---|
| 云顶高度 | cldt | CDCTOP | cdct | (0, 6, 12) | surface | - | 857 |
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="CDCTOP",
lazy=True
)
assert field.attrs["GRIB_count"] == 857field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="cdct",
lazy=True
)
assert field.attrs["GRIB_count"] == 857field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="cldt",
lazy=True
)
assert field.attrs["GRIB_count"] == 857field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter={
"discipline": 0,
"parameterCategory": 6,
"parameterNumber": 12,
},
level_type="surface",
lazy=True
)
assert field.attrs["GRIB_count"] == 857云底高度¶
| 要素名 | cemc | wgrib2 | eccodes | GRIB Key | 层次类型 | 层次 | 编号 |
|---|---|---|---|---|---|---|---|
| 云底高度 | cldb | CDCB | - | (0, 6, 11) | surface | - | 858 |
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="CDCB",
lazy=True
)
assert field.attrs["GRIB_count"] == 858field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="cldb",
lazy=True
)
assert field.attrs["GRIB_count"] == 858field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter={
"discipline": 0,
"parameterCategory": 6,
"parameterNumber": 11,
},
level_type="surface",
lazy=True
)
assert field.attrs["GRIB_count"] == 858云幂高度¶
| 要素名 | cemc | wgrib2 | eccodes | GRIB Key | 层次类型 | 层次 | 编号 |
|---|---|---|---|---|---|---|---|
| 云幂高度 | ceiling | CEIL | ceil | (0, 6, 13) | surface | - | 859 |
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="CEIL",
lazy=True
)
assert field.attrs["GRIB_count"] == 859field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="ceil",
lazy=True
)
assert field.attrs["GRIB_count"] == 859field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="ceiling",
lazy=True
)
assert field.attrs["GRIB_count"] == 859field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter={
"discipline": 0,
"parameterCategory": 6,
"parameterNumber": 13,
},
lazy=True
)
assert field.attrs["GRIB_count"] == 859bti/btv¶
卫星红外通道模拟亮温¶
| 要素名 | cemc | wgrib2 | eccodes | GRIB Key | 层次类型 | 层次 | 编号 |
|---|---|---|---|---|---|---|---|
| 卫星红外通道模拟亮温 | bti | - | - | (0, 4, 228) | surface | - | 860 |
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="bti",
lazy=True
)
assert field.attrs["GRIB_count"] == 860field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter={
"discipline": 0,
"parameterCategory": 4,
"parameterNumber": 228,
},
lazy=True
)
assert field.attrs["GRIB_count"] == 860卫星水汽通道模拟亮温¶
| 要素名 | cemc | wgrib2 | eccodes | GRIB Key | 层次类型 | 层次 | 编号 |
|---|---|---|---|---|---|---|---|
| 卫星水汽通道模拟亮温 | btv | - | - | (0, 4, 227) | surface | - | 861 |
field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter="btv",
lazy=True
)
assert field.attrs["GRIB_count"] == 861field = load_field_from_file(
gfs_grib2_orig_file_path,
parameter={
"discipline": 0,
"parameterCategory": 4,
"parameterNumber": 227,
},
lazy=True
)
assert field.attrs["GRIB_count"] == 861