Skip to main content

cedarkit-plots

Maturity-Sandbox GitHub Release PyPI - Version GitHub License GitHub Action Workflow Status

A plotting tool for meteorology data.

Install

Install using pip:

pip install cedarkit-plots

Or download the latest source code from GitHub and install manually.

Getting started

The following example uses CMA-GFS data to draw a 2m temperature contour fill plot.

Set some variables:

import pandas as pd

graph_name = "2m Temperature (C)"
system_name = "CMA-GFS"
start_time = pd.to_datetime("2024-11-09")
forecast_time = pd.to_timedelta("24h")

Get local data file path using reki:

from reki.data_finder import find_local_file

data_file_path = find_local_file(
    "cma_gfs_gmf/grib2/orig",
    start_time=start_time,
    forecast_time=forecast_time,
)

Load 2m temperature field from file and convert unit:

from reki.format.grib.eccodes import load_field_from_file

field_t_2m = load_field_from_file(
    data_file_path,
    parameter="2t",
) - 273.15

Create contour style, including levels and colormap. In this example, a NCL colormap embedded in the project is used.

import numpy as np
import matplotlib.colors as mcolors
from cedarkit.plots.colormap import get_ncl_colormap
from cedarkit.plots.style import ContourStyle

t_2m_level = [-24, -20, -16, -12, -8, -4, 0, 4, 8, 12, 16, 20, 24, 28, 32]

color_map = get_ncl_colormap("BlAqGrYeOrReVi200")
color_index = np.array([2, 12, 22, 32, 42, 52, 62, 72, 82, 92, 102, 112, 122, 132, 142, 152]) - 2
t_2m_color_map = mcolors.ListedColormap(color_map(color_index))

t_2m_style = ContourStyle(
    colors=t_2m_color_map,
    levels=t_2m_level,
    fill=True,
)

Create a build-in template EastAsiaMapTemplate. A template is a pre-defined layout to put title, text info, colorbar in some position.

from cedarkit.plots.domains import EastAsiaMapTemplate

domain = EastAsiaMapTemplate()

Create plot panel and plot the field:

from cedarkit.plots.chart import Panel

panel = Panel(domain=domain)
panel.plot(field_t_2m, style=t_2m_style)

Add title and colorbar:

domain.set_title(
    panel=panel,
    graph_name=graph_name,
    system_name=system_name,
    start_time=start_time,
    forecast_time=forecast_time,
)
domain.add_colorbar(panel=panel, style=t_2m_style)

Show the picture:

panel.show()

LICENSE

Copyright © 2021-2026, developers at cemc-oper.

cedarkit-plots is licensed under Apache License V2.0

Third party

cedarkit/plots/resources/map/china-shapefiles is from project dongli/china-shapefiles.

cedarkit/plots/resources/colormap/ncl is from project NCL.

Metadata

Release files for cedarkit-plots 2026.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cedarkit-plots 2026.8.0
File Size Uploaded
cedarkit_plots-2026.8.0.tar.gz 2.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for cedarkit-plots 2026.8.0
File Interpreter ABI Platform
cedarkit_plots-2026.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 4.4 MB

Release files / cedarkit_plots-2026.8.0.tar.gz

Download URL cedarkit_plots-2026.8.0.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
6b7f5f18f2e49445bbe5e7848794671afcf84a8c1357ab0159defb7a8b38d1e7
BLAKE2b-256 checksum
How to use checksums
0ba9c8b36bdc1f049f49bdff8d04f38441974c7cd9d519c731ba72a73300df8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / cedarkit_plots-2026.8.0-py3-none-any.whl

Download URL cedarkit_plots-2026.8.0-py3-none-any.whl
Size 2.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
12c4e860d92dbea6297a500fc5c675ea55a80366914842cd6914a1a4f524fae8
BLAKE2b-256 checksum
How to use checksums
f0da2bdd7a5ff5caaedeaae1aa8821600cfd0ce9d087a13d71bc1c17c68c38e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

2026.8.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page