MESO要素清单:22-30#

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

meso_grib2_orig_file_path = get_data_file("cma-meso-1km")
meso_grib2_orig_file_path
PosixPath('/home/wangdp/project/cedarkit/notebook-project/notebook-devel/ref/data-notebook-project/data-notebook/data/cma-meso-1km/grib2/orig/Z_NAFP_C_BABJ_20260725000000_P_CEMC-CMA-MESO-1KM-ORIG-02400.grb2')

输出间隔内最大雷达组合反射率#

要素名

wgrib2

eccodes

cemc

GRIB Key

层次类型

层次

编号

输出间隔内雷达组合反射率

-

-

cdbzmax#1

(0, 16, 224)

surface

-

22

field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="cdbzmax#1",
    lazy=True
)
assert field.attrs["GRIB_count"] == 22
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 16,
        "parameterNumber": 224,
    },
    stepType="max",
    lazy=True
)
assert field.attrs["GRIB_count"] == 22

雷达回波顶高度#

要素名

wgrib2

eccodes

cemc

GRIB Key

层次类型

层次

编号

雷达回波顶高度

RETOP

-

echotop

(0, 16, 3)

-

-

23

field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="RETOP",
    lazy=True
)
assert field.attrs["GRIB_count"] == 23
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="echotop",
    lazy=True
)
assert field.attrs["GRIB_count"] == 23
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 16,
        "parameterNumber": 3,
    },
    lazy=True
)
assert field.attrs["GRIB_count"] == 23

最大上升螺旋度#

要素名

wgrib2

eccodes

cemc

GRIB Key

层次类型

层次

编号

最大上升螺旋度

UPHL

-

uhmax(2000-5000)

(0, 7, 15)

heightAboveGroundLayer

5000, 2000

24

field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="UPHL",
    level_type="heightAboveGroundLayer",
    level={
        "first_level": 5000,
        "second_level": 2000,
    },
    lazy=True
)
assert field.attrs["GRIB_count"] == 24
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="uhmax(2000-5000)",
    lazy=True
)
assert field.attrs["GRIB_count"] == 24
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 7,
        "parameterNumber": 15,
    },
    level_type="heightAboveGroundLayer",
    level={
        "first_level": 5000,
        "second_level": 2000,
    },
    lazy=True
)
assert field.attrs["GRIB_count"] == 24

输出间隔内5分钟最大降水#

要素名

wgrib2

eccodes

cemc

GRIB Key

层次类型

层次

编号

输出间隔内5分钟最大降水

-

-

rain5max

(0, 1, 241)

surface

-

25

field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="rain5max",
    lazy=True
)
assert field.attrs["GRIB_count"] == 25
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 1,
        "parameterNumber": 241,
    },
    stepType="max",
    lazy=True
)
assert field.attrs["GRIB_count"] == 25

最大垂直风切速度#

要素名

wgrib2

eccodes

cemc

GRIB Key

层次类型

层次

编号

最大垂直风切速度

-

-

shrmax(0-600)

(0, 2, 237)

heightAboveGroundLayer

600, 0

26

field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="shrmax(0-600)",
    lazy=True
)
assert field.attrs["GRIB_count"] == 26
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 2,
        "parameterNumber": 237,
    },
    level_type="heightAboveGroundLayer",
    level={
        "first_level": 600,
        "second_level": 0,
    },
    lazy=True
)
assert field.attrs["GRIB_count"] == 26

最大垂直风切角度#

要素名

wgrib2

eccodes

cemc

GRIB Key

层次类型

层次

编号

最大垂直风切角度

-

-

shrmaxdir(0-600)

(0, 2, 238)

heightAboveGroundLayer

600, 0

27

field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="shrmaxdir(0-600)",
    lazy=True
)
assert field.attrs["GRIB_count"] == 27
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 2,
        "parameterNumber": 238,
    },
    level_type="heightAboveGroundLayer",
    level={
        "first_level": 600,
        "second_level": 0,
    },
    lazy=True
)
assert field.attrs["GRIB_count"] == 27

最大雷达回波高度#

要素名

wgrib2

eccodes

cemc

GRIB Key

层次类型

层次

编号

最大雷达回波高度

-

-

dbzmaxh

(0, 16, 226)

surface

-

28

field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="dbzmaxh",
    lazy=True
)
assert field.attrs["GRIB_count"] == 28
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 16,
        "parameterNumber": 226,
    },
    lazy=True
)
assert field.attrs["GRIB_count"] == 28

地面气压#

要素名

wgrib2

eccodes

cemc

GRIB Key

层次类型

层次

编号

地面气压

PRES

sp

ps

(0, 3, 0)

surface

-

29

field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="PRES",
    lazy=True
)
assert field.attrs["GRIB_count"] == 29
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="sp",
    lazy=True
)
assert field.attrs["GRIB_count"] == 29
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="ps",
    lazy=True
)
assert field.attrs["GRIB_count"] == 29
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 3,
        "parameterNumber": 0,
    },
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 29

海平面气压#

要素名

wgrib2

eccodes

cemc

GRIB Key

层次类型

层次

编号

海平面气压

PRMSL

prmsl

psl

(0, 3, 1)

meanSea

-

30

field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="PRMSL",
    lazy=True
)
assert field.attrs["GRIB_count"] == 30
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="prmsl",
    lazy=True
)
assert field.attrs["GRIB_count"] == 30
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="psl",
    lazy=True
)
assert field.attrs["GRIB_count"] == 30
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 3,
        "parameterNumber": 1,
    },
    level_type="meanSea",
    lazy=True
)
assert field.attrs["GRIB_count"] == 30