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.

GFS要素清单:774-784

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_path
The history saving thread hit an unexpected error (OperationalError('attempt to write a readonly database')).History will not be written to the database.
PosixPath('/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')

KX/SX/CAPE/CIN/PLI/pc/dcape

K指数

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
K指数kKXkx(0, 7, 2)meanSea-774
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="KX",
    level_type="meanSea",
    lazy=True
)
assert field.attrs["GRIB_count"] == 774
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="kx",
    lazy=True
)
assert field.attrs["GRIB_count"] == 774
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="k",
    lazy=True
)
assert field.attrs["GRIB_count"] == 774
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 7,
        "parameterNumber": 2,
    },
    level_type="meanSea",
    lazy=True
)
assert field.attrs["GRIB_count"] == 774

强天气胁迫指数

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
强天气胁迫指数sweatidxSXsx(0, 7, 5)surface-775
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="SX",
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 775
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="sx",
    level_type="sfc",
    lazy=True
)
assert field.attrs["GRIB_count"] == 775
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="sweatidx",
    lazy=True
)
assert field.attrs["GRIB_count"] == 775
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 7,
        "parameterNumber": 5,
    },
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 775

对流有效位能

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
对流有效位能capeCAPE-(0, 7, 6)surface-776
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="CAPE",
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 776
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="cape",
    lazy=True
)
assert field.attrs["GRIB_count"] == 776
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 7,
        "parameterNumber": 6,
    },
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 776

对流抑制能量

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
对流抑制能量cinCIN-(0, 7, 7)surface-777
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="CIN",
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 777
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="cin",
    lazy=True
)
assert field.attrs["GRIB_count"] == 777
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 7,
        "parameterNumber": 7,
    },
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 777

抬升指数

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
抬升指数pliPLIpli(0, 7, 0)surface-778
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="PLI",
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 778
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="pli",
    lazy=True
)
assert field.attrs["GRIB_count"] == 778
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 7,
        "parameterNumber": 0,
    },
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 778

抬升凝结高度处气压

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
抬升凝结高度处气压pc--(0, 1, 228)surface-779
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="pc",
    lazy=True
)
assert field.attrs["GRIB_count"] == 779
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 1,
        "parameterNumber": 228, 
    },
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 779

下沉对流有效位能

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
下沉对流有效位能dcape--(0, 7, 224)surface-780
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="dcape",
    lazy=True
)
assert field.attrs["GRIB_count"] == 780
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 7,
        "parameterNumber": 224,
    },
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 780

垂直风切变

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
0-1000m垂直风切变shr(0-1000)VWSHvwsh(0, 2, 25)heightAboveGroundLayer1000, 0781
0-3000m垂直风切变shr(0-3000)VWSHvwsh(0, 2, 25)heightAboveGroundLayer3000, 0782
0-6000m垂直风切变shr(0-6000)VWSHvwsh(0, 2, 25)heightAboveGroundLayer6000, 0783
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="VWSH",
    level_type="heightAboveGroundLayer",
    level=1000,
    lazy=True
)
assert field.attrs["GRIB_count"] == 781
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="vwsh",
    level_type="heightAboveGroundLayer",
    level={
        "first_level": 3000,
        "second_level": 0,
    },
    lazy=True
)
assert field.attrs["GRIB_count"] == 782
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="shr(0-6000)",
    lazy=True
)
assert field.attrs["GRIB_count"] == 783
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 2,
        "parameterNumber": 25,
    },
    level_type="heightAboveGroundLayer",
    level={
        "first_level": 6000,
        "second_level": 0,
    },
    lazy=True
)
assert field.attrs["GRIB_count"] == 783

最优抬升指数

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
最优抬升指数bliBLIbli(0, 7, 1)surface-784
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="BLI",
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 784
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="bli",
    lazy=True
)
assert field.attrs["GRIB_count"] == 784
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 7,
        "parameterNumber": 1,
    },
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 784