Skip to content

feat(styling): expand the weather/atmospheric preset library with CAMS composition and operational fields #289

Description

@MAfarrag

Context

weather_presets.json holds shortName-keyed atmospheric presets (Magics-derived, Apache-2.0) that map ECMWF-style
meteorological variables onto banded colour scales. PR #275 grows this library from 84 to 112 presets — the
+28 genuinely new on this branch vs main — covering CAMS atmospheric-composition levels and a long tail of
operational meteorology/hydrology fields.

Problem / Current Behaviour

The weather preset set covered common surface fields but was missing:

  • CAMS atmospheric-composition presets at pressure levels (carbon monoxide / methane at 500/700/850 hPa, etc.),
  • operational long-tail fields: cloud base/ceiling, sea-ice, snow/soil hydrology, vorticity/divergence at levels,
    upper-air temperature and wind-speed at standard pressure levels, visibility, river discharge, and more.

Affected locations

File Symbol Notes
src/cleopatra/styling/data/weather_presets.json presets (84 -> 112) +28 shortName presets
src/cleopatra/styling/colors.py _load_presets, resolve_style_norm consumes the added banded/levelled presets
tools/build_weather_presets.py maintainer-only build tool (local, untracked) fetch + bake

Motivation Example

from cleopatra.glyphs.gridded.array_glyph import ArrayGlyph
from cleopatra.styling.params import DataStyle

ArrayGlyph(co_700).plot(data_style=DataStyle(style="carbon_monoxide_700hpa"))
ArrayGlyph(u250).plot(data_style=DataStyle(style="wind_speed_250hpa"))
ArrayGlyph(sic).plot(data_style=DataStyle(style="sea_ice_cover"))

Delivered presets (+28 vs main)

cloud_base_height, cloud_ceiling, divergence_1000hpa, freezing_rain, potential_vorticity_315k,
relative_humidity_1000hpa, relative_vorticity_700hpa, relative_vorticity_850hpa, river_discharge, sea_ice_cover,
snow_water_equivalent, soil_wetness_index, surface_net_solar_radiation, temperature_250hpa, temperature_3hpa,
temperature_500hpa, temperature_925hpa, total_precipitation_rate, total_runoff_water_equivalent,
vertical_velocity_700hpa, visibility, wet_bulb_potential_temperature_850hpa, wind_speed_200hpa, wind_speed_250hpa,
wind_speed_300hpa, wind_speed_500hpa, wind_speed_800hpa, wind_speed_925hpa

Out of Scope

  • Colour-map palettes (scientific / terrain / radar) — tracked separately.
  • Any new runtime dependency — presets are vendored JSON.

Effort Estimate

Size: M
Rationale: sourcing, schema-fitting, and validating 28 additional banded/levelled presets plus gallery coverage.

Definition of Done

  • 28 CAMS-composition + operational presets added to weather_presets.json (84 -> 112) under the v2 schema
  • each resolves through resolve_style_norm (banded / levelled scales render with a correct colorbar)
  • gallery notebooks: cams_* (4), operational_weather_gallery
  • neutral source naming - no ecmwf / earthkit in filenames, docstrings, identifiers, or data
  • all existing tests continue to pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions