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.

MESO要素清单:11-21

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

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/repo/data-notebook-project/data-notebook/data/cma-meso-1km/grib2/orig/Z_NAFP_C_BABJ_20260725000000_P_CEMC-CMA-MESO-1KM-ORIG-02400.grb2')

总云量

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

低云量

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

中云量

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
中云量mccMCDCmcc(0, 6, 4)entireAtmosphere-13
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="MCDC",
    lazy=True
)
assert field.attrs["GRIB_count"] == 13
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="mcc",
    lazy=True
)
assert field.attrs["GRIB_count"] == 13
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(
    meso_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 6,
        "parameterNumber": 4,
    },
    level_type="entireAtmosphere",
    lazy=True
)
assert field.attrs["GRIB_count"] == 13

高云量

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
高云量hccHCDChcc(0, 6, 5)entireAtmosphere-14
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="HCDC",
    lazy=True
)
assert field.attrs["GRIB_count"] == 14
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="hcc",
    lazy=True
)
assert field.attrs["GRIB_count"] == 14
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 6,
        "parameterNumber": 5,
    },
    level_type="entireAtmosphere",
    lazy=True
)
assert field.attrs["GRIB_count"] == 14

大气总柱水汽含量

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
大气总柱水汽含量tvwTCIWV-(0, 1, 64)atmosphere-15
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="TCIWV",
    lazy=True
)
assert field.attrs["GRIB_count"] == 15
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="tvw",
    lazy=True
)
assert field.attrs["GRIB_count"] == 15
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 1,
        "parameterNumber": 64,
    },
    level_type="atmosphere",
    lazy=True
)
assert field.attrs["GRIB_count"] == 15

大气总柱云冰含量

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
大气总柱云冰含量tiwTCOLI-(0, 1, 70)atmosphere-16
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="TCOLI",
    lazy=True
)
assert field.attrs["GRIB_count"] == 16
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="tiw",
    lazy=True
)
assert field.attrs["GRIB_count"] == 16
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 1,
        "parameterNumber": 70,
    },
    level_type="atmosphere",
    lazy=True
)
assert field.attrs["GRIB_count"] == 16

边界层高度

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
边界层高度pblhHPBLblh(0, 3, 18)surface-17
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="HPBL",
    lazy=True
)
assert field.attrs["GRIB_count"] == 17
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="blh",
    lazy=True
)
assert field.attrs["GRIB_count"] == 17
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="pblh",
    lazy=True
)
assert field.attrs["GRIB_count"] == 17
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 3,
        "parameterNumber": 18,
    },
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 17

雷达组合反射率

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

输出间隔内最大垂直速度

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
输出间隔内最大垂直速度w, wmax#1DZDTwz(0, 2, 9)pl100019
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="DZDT",
    level_type="pl",
    level=1000,
    stepType="max",
    lazy=True
)
assert field.attrs["GRIB_count"] == 19
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="wz",
    level_type="pl",
    level=1000,
    stepType="max",
    lazy=True
)
assert field.attrs["GRIB_count"] == 19
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="w",
    level_type="pl",
    level=1000,
    stepType="max",
    lazy=True
)
assert field.attrs["GRIB_count"] == 19
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="wmax#1",
    lazy=True
)
assert field.attrs["GRIB_count"] == 19

输出间隔内最大10mU风

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
输出间隔内最大10mU风u10mmax#1UGRD10u(0, 2, 2)heightAboveGround1020
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="UGRD",
    level_type="heightAboveGround",
    level=10,
    stepType="max",
    lazy=True
)
assert field.attrs["GRIB_count"] == 20
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="10u",
    stepType="max",
    lazy=True
)
assert field.attrs["GRIB_count"] == 20
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="u10mmax#1",
    lazy=True
)
assert field.attrs["GRIB_count"] == 20
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 2,
        "parameterNumber": 2,
    },
    level_type="heightAboveGround",
    level=10,
    stepType="max",
    lazy=True
)
assert field.attrs["GRIB_count"] == 20

输出间隔内最大10mV风

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
输出间隔内最大10mV风v10mmax#1VGRD10v(0, 2, 3)heightAboveGround1021
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="VGRD",
    level_type="heightAboveGround",
    level=10,
    stepType="max",
    lazy=True
)
assert field.attrs["GRIB_count"] == 21
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="10v",
    stepType="max",
    lazy=True
)
assert field.attrs["GRIB_count"] == 21
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter="v10mmax#1",
    lazy=True
)
assert field.attrs["GRIB_count"] == 21
field = load_field_from_file(
    meso_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 2,
        "parameterNumber": 3,
    },
    level_type="heightAboveGround",
    level=10,
    stepType="max",
    lazy=True
)
assert field.attrs["GRIB_count"] == 21