Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

TYM要素清单:1-23

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

tym_grib2_orig_file_path = get_data_file("cma-tym")
tym_grib2_orig_file_path
PosixPath('/home/wangdp/project/cedarkit/notebook-project/notebook-devel/repo/data-notebook-project/data-notebook/data/cma-tym/grib2/orig/Z_NAFP_C_BABJ_20260811000000_P_NWPC-GRAPES-TYM-ACWP-02400.grib2')

降水

对流降水

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
对流降水raincACPCPacpcp(0, 1, 10)surface-1
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="ACPCP",
    lazy=True
)
assert field.attrs["GRIB_count"] == 1
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="acpcp",
    lazy=True
)
assert field.attrs["GRIB_count"] == 1
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="rainc",
    lazy=True
)
assert field.attrs["GRIB_count"] == 1
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 1, "parameterNumber": 10},
    lazy=True
)
assert field.attrs["GRIB_count"] == 1

大尺度降水

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
大尺度降水rainncNCPCPncpcp(0, 1, 9)surface-2
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="NCPCP",
    lazy=True
)
assert field.attrs["GRIB_count"] == 2
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="ncpcp",
    lazy=True
)
assert field.attrs["GRIB_count"] == 2
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="rainnc",
    lazy=True
)
assert field.attrs["GRIB_count"] == 2
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 1, "parameterNumber": 9},
    lazy=True
)
assert field.attrs["GRIB_count"] == 2

总降水

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
总降水rainAPCP-(0, 1, 8)surface-3
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="APCP",
    lazy=True
)
assert field.attrs["GRIB_count"] == 3
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="rain",
    lazy=True
)
assert field.attrs["GRIB_count"] == 3
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 1, "parameterNumber": 8},
    lazy=True
)
assert field.attrs["GRIB_count"] == 3

降雪

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
降雪sfASNOW-(0, 1, 29)surface-4
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="ASNOW",
    lazy=True
)
assert field.attrs["GRIB_count"] == 4
The history saving thread hit an unexpected error (OperationalError('disk I/O error')).History will not be written to the database.
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="sf",
    lazy=True
)
assert field.attrs["GRIB_count"] == 4
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 1, "parameterNumber": 29},
    lazy=True
)
assert field.attrs["GRIB_count"] == 4

地表温度与辐射通量

地表温度

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
地表温度tsTMPt(0, 0, 0)surface-5
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="TMP",
    lazy=True
)
assert field.attrs["GRIB_count"] == 5
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="t",
    lazy=True
)
assert field.attrs["GRIB_count"] == 5
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="ts",
    lazy=True
)
assert field.attrs["GRIB_count"] == 5
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 0, "parameterNumber": 0},
    lazy=True
)
assert field.attrs["GRIB_count"] == 5

地表净长波辐射

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
地表净长波辐射glwNLWRFstr(0, 5, 5)surface-6
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="NLWRF",
    lazy=True
)
assert field.attrs["GRIB_count"] == 6
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="str",
    lazy=True
)
assert field.attrs["GRIB_count"] == 6
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="glw",
    lazy=True
)
assert field.attrs["GRIB_count"] == 6
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 5, "parameterNumber": 5},
    lazy=True
)
assert field.attrs["GRIB_count"] == 6

地表净短波辐射

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
地表净短波辐射gswNSWRFssr(0, 4, 9)surface-7
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="NSWRF",
    lazy=True
)
assert field.attrs["GRIB_count"] == 7
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="ssr",
    lazy=True
)
assert field.attrs["GRIB_count"] == 7
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="gsw",
    lazy=True
)
assert field.attrs["GRIB_count"] == 7
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 4, "parameterNumber": 9},
    lazy=True
)
assert field.attrs["GRIB_count"] == 7

地表感热通量

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
地表感热通量sshfHFLUXhflux(2, 0, 24)surface-8
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="HFLUX",
    lazy=True
)
assert field.attrs["GRIB_count"] == 8
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="hflux",
    lazy=True
)
assert field.attrs["GRIB_count"] == 8
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="sshf",
    lazy=True
)
assert field.attrs["GRIB_count"] == 8
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 2, "parameterCategory": 0, "parameterNumber": 24},
    lazy=True
)
assert field.attrs["GRIB_count"] == 8

地表水汽通量

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
地表水汽通量qfxsfc--(0, 1, 229)surface-9
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="qfxsfc",
    lazy=True
)
assert field.attrs["GRIB_count"] == 9
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 1, "parameterNumber": 229},
    lazy=True
)
assert field.attrs["GRIB_count"] == 9

地形与近地面要素

地形高度

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
地形高度zsHGTorog(0, 3, 5)surface-10
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="HGT",
    lazy=True
)
assert field.attrs["GRIB_count"] == 10
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="orog",
    lazy=True
)
assert field.attrs["GRIB_count"] == 10
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="zs",
    lazy=True
)
assert field.attrs["GRIB_count"] == 10
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 3, "parameterNumber": 5},
    lazy=True
)
assert field.attrs["GRIB_count"] == 10

2米比湿

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
2米比湿q2mSPFH2sh(0, 1, 0)heightAboveGround211
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="SPFH",
    lazy=True
)
assert field.attrs["GRIB_count"] == 11
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="2sh",
    lazy=True
)
assert field.attrs["GRIB_count"] == 11
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="q2m",
    lazy=True
)
assert field.attrs["GRIB_count"] == 11
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 1, "parameterNumber": 0},
    lazy=True
)
assert field.attrs["GRIB_count"] == 11

2米温度

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
2米温度t2mTMP2t(0, 0, 0)heightAboveGround212
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="TMP",
    level_type="heightAboveGround",
    level=2,
    lazy=True
)
assert field.attrs["GRIB_count"] == 12
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="2t",
    lazy=True
)
assert field.attrs["GRIB_count"] == 12
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="t2m",
    lazy=True
)
assert field.attrs["GRIB_count"] == 12
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 0, "parameterNumber": 0},
    level_type="heightAboveGround",
    level=2,
    lazy=True
)
assert field.attrs["GRIB_count"] == 12

10米U风

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
10米U风u10mUGRD10u(0, 2, 2)heightAboveGround1013
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="UGRD",
    lazy=True
)
assert field.attrs["GRIB_count"] == 13
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="10u",
    lazy=True
)
assert field.attrs["GRIB_count"] == 13
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="u10m",
    lazy=True
)
assert field.attrs["GRIB_count"] == 13
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 2, "parameterNumber": 2},
    lazy=True
)
assert field.attrs["GRIB_count"] == 13

10米V风

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
10米V风v10mVGRD10v(0, 2, 3)heightAboveGround1014
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="VGRD",
    lazy=True
)
assert field.attrs["GRIB_count"] == 14
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="10v",
    lazy=True
)
assert field.attrs["GRIB_count"] == 14
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="v10m",
    lazy=True
)
assert field.attrs["GRIB_count"] == 14
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 2, "parameterNumber": 3},
    lazy=True
)
assert field.attrs["GRIB_count"] == 14

云量

总云量

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
总云量tccTCDCtcc(0, 6, 1)entireAtmosphere-15
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="TCDC",
    lazy=True
)
assert field.attrs["GRIB_count"] == 15
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="tcc",
    lazy=True
)
assert field.attrs["GRIB_count"] == 15
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 6, "parameterNumber": 1},
    lazy=True
)
assert field.attrs["GRIB_count"] == 15

低云量

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
低云量lccLCDClcc(0, 6, 3)entireAtmosphere-16
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="LCDC",
    lazy=True
)
assert field.attrs["GRIB_count"] == 16
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="lcc",
    lazy=True
)
assert field.attrs["GRIB_count"] == 16
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 6, "parameterNumber": 3},
    lazy=True
)
assert field.attrs["GRIB_count"] == 16

雷达反射率与最大风速

组合雷达反射率

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
组合雷达反射率cdbzCR-(0, 16, 224)surface-17
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="CR",
    lazy=True
)
assert field.attrs["GRIB_count"] == 17
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="cdbz",
    lazy=True
)
assert field.attrs["GRIB_count"] == 17
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 16, "parameterNumber": 224},
    lazy=True
)
assert field.attrs["GRIB_count"] == 17

最大垂直速度

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
最大垂直速度wmax#1DZDTwz(0, 2, 9)pl100018
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="DZDT",
    level_type="pl",
    level=1000,
    lazy=True
)
assert field.attrs["GRIB_count"] == 18
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="wz",
    level_type="pl",
    level=1000,
    lazy=True
)
assert field.attrs["GRIB_count"] == 18
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="wmax#1",
    level_type="pl",
    level=1000,
    lazy=True
)
assert field.attrs["GRIB_count"] == 18
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 2, "parameterNumber": 9},
    level_type="pl",
    level=1000,
    lazy=True
)
assert field.attrs["GRIB_count"] == 18

最大10米U风

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
最大10米U风u10mmax#1UGRD10u(0, 2, 2)heightAboveGround1019
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="u10mmax#1",
    lazy=True
)
assert field.attrs["GRIB_count"] == 19

最大10米V风

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
最大10米V风v10mmax#1VGRD10v(0, 2, 3)heightAboveGround1020
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="v10mmax#1",
    lazy=True
)
assert field.attrs["GRIB_count"] == 20

最大上升螺旋度

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
最大上升螺旋度uhmaxUPHL-(0, 7, 15)heightAboveGroundLayer5000, 200021
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="UPHL",
    lazy=True
)
assert field.attrs["GRIB_count"] == 21
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="uhmax",
    lazy=True
)
assert field.attrs["GRIB_count"] == 21
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 7, "parameterNumber": 15},
    lazy=True
)
assert field.attrs["GRIB_count"] == 21

气压

地面气压

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
地面气压psPRESsp(0, 3, 0)surface-22
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="PRES",
    lazy=True
)
assert field.attrs["GRIB_count"] == 22
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="sp",
    lazy=True
)
assert field.attrs["GRIB_count"] == 22
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="ps",
    lazy=True
)
assert field.attrs["GRIB_count"] == 22
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 3, "parameterNumber": 0},
    lazy=True
)
assert field.attrs["GRIB_count"] == 22

海平面气压

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
海平面气压pslPRMSLprmsl(0, 3, 1)meanSea-23
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="PRMSL",
    lazy=True
)
assert field.attrs["GRIB_count"] == 23
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="prmsl",
    lazy=True
)
assert field.attrs["GRIB_count"] == 23
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="psl",
    lazy=True
)
assert field.attrs["GRIB_count"] == 23
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 3, "parameterNumber": 1},
    lazy=True
)
assert field.attrs["GRIB_count"] == 23