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要素清单:24-179

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')

等压面:位势高度/温度/风/垂直速度/比湿

层次

26 层列表(百帕 (hPa)):

  • 1000

  • 975

  • 950

  • 925

  • 900

  • 850

  • 800

  • 750

  • 700

  • 650

  • 600

  • 550

  • 500

  • 450

  • 400

  • 350

  • 300

  • 250

  • 200

  • 150

  • 100

  • 70

  • 50

  • 30

  • 20

  • 10

位势高度

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
位势高度hHGTgh(0, 3, 5)pl26层24-49
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="HGT",
    level_type="pl",
    level=1000,
    lazy=True
)
assert field.attrs["GRIB_count"] == 24
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="gh",
    level_type="pl",
    level=700,
    lazy=True
)
assert field.attrs["GRIB_count"] == 32
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="h",
    level_type="pl",
    level=250,
    lazy=True
)
assert field.attrs["GRIB_count"] == 41
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 3, "parameterNumber": 5},
    level_type="pl",
    level=10,
    lazy=True
)
assert field.attrs["GRIB_count"] == 49

温度

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
温度tTMPt(0, 0, 0)pl26层50-75
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="TMP",
    level_type="pl",
    level=1000,
    lazy=True
)
assert field.attrs["GRIB_count"] == 50
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="t",
    level_type="pl",
    level=700,
    lazy=True
)
assert field.attrs["GRIB_count"] == 58
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 0, "parameterNumber": 0},
    level_type="pl",
    level=250,
    lazy=True
)
assert field.attrs["GRIB_count"] == 67

东西风

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
东西风uUGRDu(0, 2, 2)pl26层76-101
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="UGRD",
    level_type="pl",
    level=1000,
    lazy=True
)
assert field.attrs["GRIB_count"] == 76
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="u",
    level_type="pl",
    level=700,
    lazy=True
)
assert field.attrs["GRIB_count"] == 84
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 2, "parameterNumber": 2},
    level_type="pl",
    level=250,
    lazy=True
)
assert field.attrs["GRIB_count"] == 93

南北风

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
南北风vVGRDv(0, 2, 3)pl26层102-127
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="VGRD",
    level_type="pl",
    level=1000,
    lazy=True
)
assert field.attrs["GRIB_count"] == 102
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="v",
    level_type="pl",
    level=700,
    lazy=True
)
assert field.attrs["GRIB_count"] == 110
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 2, "parameterNumber": 3},
    level_type="pl",
    level=250,
    lazy=True
)
assert field.attrs["GRIB_count"] == 119

垂直速度

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
垂直速度wDZDTwz(0, 2, 9)pl26层128-153
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="wz",
    level_type="pl",
    level=700,
    lazy=True
)
assert field.attrs["GRIB_count"] == 136
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="w",
    level_type="pl",
    level=250,
    lazy=True
)
assert field.attrs["GRIB_count"] == 145
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 2, "parameterNumber": 9},
    level_type="pl",
    level=10,
    lazy=True
)
assert field.attrs["GRIB_count"] == 153

比湿

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
比湿qSPFHq(0, 1, 0)pl26层154-179
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="SPFH",
    level_type="pl",
    level=1000,
    lazy=True
)
assert field.attrs["GRIB_count"] == 154
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter="q",
    level_type="pl",
    level=700,
    lazy=True
)
assert field.attrs["GRIB_count"] == 162
field = load_field_from_file(
    tym_grib2_orig_file_path,
    parameter={"discipline": 0, "parameterCategory": 1, "parameterNumber": 0},
    level_type="pl",
    level=250,
    lazy=True
)
assert field.attrs["GRIB_count"] == 171