Skip to main content

cemc-plots-kit

cemc-plots-kit is a command-line orchestration tool for producing graphics from CEMC numerical weather prediction (NWP) data. It owns task configuration, data-source selection, scheduling, and output management. Rendering is provided by cedar-graph, using either packaged YAML recipes or Python plot modules.

plot_type maps directly to a cedar-graph recipe or module; no per-plot wrapper code is required.

Requirements and installation

Python 3.11 or later is required. Install the package from PyPI:

uv tool install cemc-plots-kit

For development, install the repository and its test dependencies:

uv sync --extra test

Quick start: draw one plot

The following command renders a 2 m temperature plot from CMA-GFS data on CMA-HPC:

cemc-plots draw \
  --system-name cma_gfs \
  --plot-type cn.t2m \
  --start-time 2024111300 \
  --forecast-time 24h \
  --work-dir .

It creates cn_t2m_2024111300_024.png in the working directory.

--plot-type accepts:

  • A packaged cedar-graph recipe, such as cn.t2m, cn.h_500_psl, or cn.rain_24h.
  • A cedar-graph Python plot module for more complex diagnostic products, such as cn.shr.default or cn.t_dew_t.default.
  • A path to an external .yaml or .yml recipe.

Packaged recipes

The following recipes use the cn. namespace:

plot_type Product
cn.t2m 2 m temperature
cn.rh2m 2 m relative humidity
cn.h_500_psl 500 hPa geopotential height and mean sea-level pressure
cn.h_500_wind_850 500 hPa geopotential height and 850 hPa wind
cn.kidx_wind K index and wind; requires wind_level
cn.bli_wind, cn.cape_wind, cn.cin_wind Convective index and wind; require wind_level
cn.cdbz Composite reflectivity
cn.wind_10m 10 m wind
cn.rain_24h 24-hour accumulated precipitation
cn.rain_wind_10m Interval precipitation and 10 m wind; requires interval
cn.prep_24h 24-hour precipitation type (rain, sleet, and snow)

Run a task

A task file defines a time range, data source, plots, and runtime behavior. Create task.yaml:

runtime:
  base_work_dir: .

# Use catalog defaults. CMA-GFS resolves to its canonical local dataset.
source: {}

system_name: CMA-GFS

time:
  start_time: 2024111300
  forecast_time: 48h
  forecast_interval: 6h

plots:
  cn.h_500_psl: on
  cn.rain_24h: on

Run it with:

cemc-plots task --task-file ./task.yaml

This example produces height-and-pressure plots for forecast hours 0 through 48, and precipitation plots for forecast hours 24 through 48. The default availability check excludes cn.rain_24h at forecast hour 0 because a 24-hour accumulation is not available then.

Plot configuration

Each key in plots is a plot type or an external recipe path. Its value can be one of the following forms:

plots:
  # Enable a plot without parameters.
  cn.t2m: on

  # Pass one parameter mapping to a recipe.
  cn.rain_wind_10m:
    interval: 3h

  # Render the same plot with several parameter mappings.
  cn.rain_wind_10m:
    - { interval: 1h }
    - { interval: 3h }

Parameterized output names include a parameter suffix, for example cn_rain_wind_10m_interval_3h_2024111300_024.png.

Data-source selection

For current tasks, use source.dataset to select a local mounted CMADaaS catalog entry. A v2 task keeps only stable parameter IDs, FieldQuery values, and time semantics in its Recipe or PlotPlan. It never stores service endpoints or credentials.

The deployment template is examples/task-v2-cmadaas-mount.yaml. Its storage_base is task-local, while the packaged catalog contains no machine-specific mount paths:

cemc-plots validate examples/task-v2-cmadaas-mount.yaml
cemc-plots plan examples/task-v2-cmadaas-mount.yaml
cemc-plots explain examples/task-v2-cmadaas-mount.yaml \
  --plot cn.t2m --forecast-time 24h
cemc-plots run examples/task-v2-cmadaas-mount.yaml

validate, plan, and explain are offline operations: they do not create a reader, decode data, make a CMADaaS request, render a figure, or write output. run writes figures and task-manifest.json atomically to the configured output directory. The manifest records task-plan identity, each job result, source identity, and task-local sharing counters; it intentionally excludes credentials and complete environment-variable values.

Legacy v1 task bindings remain supported. system_name or an explicit source selects the dataset at the task layer. Explicit legacy directories and file-name templates take precedence over catalog defaults:

source:
  data_dir: /g3/COMMONDATA/OPER/CEMC/GFS_GMF/Prod-grib/{start_time_label}/ORIG
  data_file_name_template: gmf.gra.{start_time_label}{forecast_hour_label}.grb2

A relative data_dir is resolved from the directory containing the task file. At runtime, these v1 fields are converted to a constrained file-pattern source. Existing system_name values continue to determine titles and output file names.

Runtime behavior

runtime.workers: 1 is the deterministic reference executor. With runtime.shared_reads: true, it keeps a task-local shared provider. Values greater than one use isolated processes, so each worker recreates its provider and file handles. Manifest entries remain in TaskPlan order even when work completes in a different order. Set shared_reads: false to compare against independent per-job reads.

External recipes

Use a .yaml or .yml path as a plots key to load an external recipe. This lets you add a product without waiting for a cedar-graph release. Relative paths are resolved from the task-file directory, and the output filename uses the recipe filename stem:

plots:
  cn.t2m: on
  recipes/t2m_custom.yaml: on        # Relative to the task-file directory.
  /data/opr/recipes/my_plot.yaml: on # Absolute path.

draw --plot-type also accepts a recipe path:

cemc-plots draw \
  --system-name cma_gfs \
  --plot-type ./recipes/t2m_custom.yaml \
  --start-time 2024111300 \
  --forecast-time 24h \
  --work-dir .

Refer to the cedar-graph recipe authoring documentation and its packaged cedar_graph/recipes/cn/ recipes for syntax and examples. More complete task examples are available in examples/.

License

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

cemc-plots-kit is licensed under the Apache License 2.0.

Metadata

Release files for cemc-plots-kit 2026.9.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 cemc-plots-kit 2026.9.0
File Size Uploaded
cemc_plots_kit-2026.9.0.tar.gz 46.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cemc-plots-kit 2026.9.0
File Interpreter ABI Platform
cemc_plots_kit-2026.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 78.9 kB

Release files / cemc_plots_kit-2026.9.0.tar.gz

Download URL cemc_plots_kit-2026.9.0.tar.gz
Size 46.0 kB
Tags Source
SHA-256 checksum
How to use checksums
664e8a2e91dfb1876e25ca25fea42bdd8984c2b6abbad6e16831774f379c2d5c
BLAKE2b-256 checksum
How to use checksums
4757e22253f43f065d0b9c780f698a409131ea0cbdc562959cb2885c8b4731d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Release files / cemc_plots_kit-2026.9.0-py3-none-any.whl

Download URL cemc_plots_kit-2026.9.0-py3-none-any.whl
Size 32.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd1d873cdaa61027bd49d17e92748fb97dfbf4c91e57e45ad200a9da7725845a
BLAKE2b-256 checksum
How to use checksums
7d2e57c3a2609282a3488e5bf5a11eb7af7cc44d7f725c3657b3bb563cdf3e5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2026.9.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