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.

欧亚大陆

欧亚大陆底图布局 (cedarkit.plots.domains.EuropeAsiaMapTemplate) 绘制欧亚大陆区域图形,使用兰勃特等角圆锥投影 (cartopy.crs.LambertConformal),中心经度东经 95 度。

准备

导入需要的包

import numpy as np
import pandas as pd

from cedarkit.plots.chart import Panel
from cedarkit.plots.domains import EuropeAsiaMapTemplate
from cedarkit.plots.map import set_default_map_loader_package
from cedarkit.plots.colormap import get_ncl_colormap
from cedarkit.plots.style import ContourStyle
start_time = pd.Timestamp.now().normalize() - pd.Timedelta(days=2)
forecast_time = pd.to_timedelta("24h")

设置使用 CEMC 地图包

set_default_map_loader_package("cedarkit.plots.map.cemc")
'cedarkit.plots.map.cemc'

定义绘图样式

prmsl_color_map = get_ncl_colormap(
    "rainbow+white+gray",
    index=np.array([-1, 80, 100, 120, 140, 160, 180, 200, 205])
)
prmsl_contour_lev = np.arange(1000, 1036, 5)
prmsl_style = ContourStyle(
    colors=prmsl_color_map,
    levels=prmsl_contour_lev,
    fill=True,
)

绘制

绘制底图布局

domain = EuropeAsiaMapTemplate()
panel = Panel(domain=domain)

domain.set_title(
    panel=panel,
    graph_name="500 hPa HGT (10gpm) line + MSLP (hPa) shadow",
    system_name="CMA-GFS",
    start_time=start_time,
    forecast_time=pd.to_timedelta("24h"),
)
domain.add_colorbar(panel=panel, style=prmsl_style)

panel.show()
<Figure size 3200x3200 with 1 Axes>