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

gfs_grib2_orig_file_path = get_data_file("cma-gfs")
gfs_grib2_orig_file_path
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')

NLWRF/NSWRF/....

地表净长波辐射

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

地表净短波辐射

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
地表净短波辐射ssrNSWRFssr(0, 4, 9)surface-7
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="NSWRF",
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 7
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="ssr",
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 7
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 4,
        "parameterNumber": 9,
    },
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 7
The history saving thread hit an unexpected error (OperationalError('attempt to write a readonly database')).History will not be written to the database.

地表感热通量

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

地表潜热通量

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
地表潜热通量slhfLHTFLslhf(0, 0, 10)surface-9
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="LHTFL",
    lazy=True
)
assert field.attrs["GRIB_count"] == 9
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="slhf",
    lazy=True
)
assert field.attrs["GRIB_count"] == 9
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 0,
        "parameterNumber": 10,
    },
    lazy=True
)
assert field.attrs["GRIB_count"] == 9

地面向上长波辐射

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
地面向上长波辐射gulwULWRFulwrf(0, 5, 4)surface-10
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="ULWRF",
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 10
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="ulwrf",
    level_type="sfc",
    lazy=True
)
assert field.attrs["GRIB_count"] == 10
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="gulw",
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 10
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 5,
        "parameterNumber": 4,
    },
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 10

大气顶向上长波辐射

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
大气顶向上长波辐射tulwULWRF-(0, 5, 4)nominalTop-11
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="ULWRF",
    level_type="nominalTop",
    lazy=True
)
assert field.attrs["GRIB_count"] == 11
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="tulw",
    level_type="nominalTop",
    lazy=True
)
assert field.attrs["GRIB_count"] == 11
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 5,
        "parameterNumber": 4,
    },
    level_type="nominalTop",
    # stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 11

地表晴空向下长波辐射

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
地表晴空向下长波辐射gdlwcDLWRFCSstrdc(0, 5, 8)surface-12
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="DLWRFCS",
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 12
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="strdc",
    level_type="surface",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 12
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="gdlwc",
    level_type="surface",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 12
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 5,
        "parameterNumber": 8,
    },
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 12

地表晴空向上长波辐射

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
地表晴空向上长波辐射gulwc--(0, 5, 224)surface-13
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="gulwc",
    level_type="surface",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 13
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 5,
        "parameterNumber": 224,
    },
    level_type="surface",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 13

大气顶晴空向上长波辐射

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
大气顶晴空向上长波辐射tulwc--(0, 5, 224)nominalTop-14
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="tulwc",
    level_type="nominalTop",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 14
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 5,
        "parameterNumber": 224,
    },
    level_type="nominalTop",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 14

地表向上短波辐射

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
地表向上短波辐射guswUSWRFuswrf(0, 4, 8)surface-15
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="USWRF",
    level_type="surface",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 15
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="uswrf",
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 15
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="gusw",
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 15
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 4,
        "parameterNumber": 8,
    },
    level_type="surface",
    lazy=True
)
assert field.attrs["GRIB_count"] == 15

大气顶净短波辐射

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
大气顶净短波辐射tswNSWRFtsr(0, 4, 9)nominalTop-16
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="NSWRF",
    level_type="nominalTop",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 16
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="tsr",
    level_type="nominalTop",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 16
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="tsw",
    lazy=True
)
assert field.attrs["GRIB_count"] == 16
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 4,
        "parameterNumber": 9,
    },
    level_type="nominalTop",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 16

大气顶向上短波辐射

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
大气顶向上短波辐射tuswUSWRF-(0, 4, 8)nominalTop-17
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="USWRF",
    level_type="nominalTop",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 17
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="tusw",
    # stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 17
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 4,
        "parameterNumber": 8,
    },
    level_type="nominalTop",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 17

地表晴空净短波辐射

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
地表晴空净短波辐射gswcNSWRFCSssrc(0, 4, 11)surface-18
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="NSWRFCS",
    level_type="sfc",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 18
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="ssrc",
    lazy=True
)
assert field.attrs["GRIB_count"] == 18
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="gswc",
    lazy=True
)
assert field.attrs["GRIB_count"] == 18
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 4,
        "parameterNumber": 11,
    },
    level_type="sfc",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 18

地表晴空向上短波辐射

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
地表晴空向上短波辐射guswcUSWRFCSauswrf_cs(0, 4, 53)surface-19
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="USWRFCS",
    level_type="sfc",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 19
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="auswrf_cs",
    lazy=True
)
assert field.attrs["GRIB_count"] == 19
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="guswc",
    lazy=True
)
assert field.attrs["GRIB_count"] == 19
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 4,
        "parameterNumber": 53,
    },
    level_type="sfc",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 19

大气顶晴空净短波辐射

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
大气顶晴空净短波辐射tswcNSWRFCStsrc(0, 4, 11)nominalTop-20
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="NSWRFCS",
    level_type="nominalTop",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 20
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="tsrc",
    lazy=True
)
assert field.attrs["GRIB_count"] == 20
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="tswc",
    lazy=True
)
assert field.attrs["GRIB_count"] == 20
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 4,
        "parameterNumber": 11,
    },
    level_type="nominalTop",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 20

大气顶晴空向上短波辐射

要素名cemcwgrib2eccodesGRIB Key层次类型层次编号
大气顶晴空向上短波辐射tuswcUSWRFCS-(0, 4, 53)nominalTop-21
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="USWRFCS",
    level_type="nominalTop",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 21
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter="tuswc",
    lazy=True
)
assert field.attrs["GRIB_count"] == 21
field = load_field_from_file(
    gfs_grib2_orig_file_path,
    parameter={
        "discipline": 0,
        "parameterCategory": 4,
        "parameterNumber": 53,
    },
    level_type="nominalTop",
    stepType="accum",
    lazy=True
)
assert field.attrs["GRIB_count"] == 21