Skip to content
elenafilloPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

windview

The wind from a UM met store, drawn as air that moves: parcels with comet tails drifting through the real field, one model level at a time, in a local browser page.

Grown out of the wind layer in interactive_GHG_plots. See PROVENANCE.md for what came from where, and PLAN.md for what is built and what is not.

Status: MVP, held time. Pick a domain, a height and a moment; the air drifts through that moment's wind. Playback is next (PLAN.md, 3b).

Layout

windview.toml          which domains, where their data is, which levels
data/<DOMAIN>/<store>  the met stores (untracked): data/EUROPE, data/EASTASIA
src/windview/          Python: config, reading the store, encoding, server
web/                   the page: map, parcels, slider, level buttons
cache/                 per-domain exports, regenerated from data/ (untracked)
reference/             whole source files the package was mined from
tests/                 python -m unittest discover -s tests

Run it

Double-click serve.cmd. It exports anything stale into cache/, starts a local server and opens the page.

Or from a terminal in this folder, with src on the path (the package is not installed into the env):

PYTHONPATH=src python -m windview serve     # reads ./windview.toml
PYTHONPATH=src python -m windview export    # just the cache; --force to rebuild
PYTHONPATH=src python -m windview serve --lan   # also on the local network, for a phone

With --lan it prints a second address, http://<this machine's IP>:8790/, to open on a phone on the same Wi-Fi. If the phone cannot reach it, Windows Firewall is usually blocking Python's inbound traffic, which it does by default on a network marked Public.

Python here is the gates_basic2 conda env, called by full path: C:\Users\ef17148\AppData\Local\miniconda3\envs\gates_basic2\python.exe.

The page keeps its state in the URL, ?domain=EUROPE&level=2&t=40, so a link opens on the same picture. Keys: Space plays and pauses, ← → one step, Shift for a day, ↑ ↓ a level.

Publish it

Double-click publish.cmd. It exports anything stale, copies web/ and cache/ into site/ (python -m windview site), and force-pushes that as the one commit on gh-pages, which GitHub Pages serves at https://elenafillo.github.io/windview/. Pages cannot build the site itself: the cache comes from data/, which never leaves this machine. main carries no cache; gh-pages carries nothing but the site.

Check it

python -m unittest discover -s tests       # config, and the export vs the store
node tests/selftest.mjs                     # the page's code, against cache/

Both need cache/; run the export first.

Things that will bite

  • The height on a level button comes from the store, never from the config. A store extracted with wind_vertical_regrid = "snap" carries level_height labels that overstate the wind's height by about a factor of two; the true heights are in wind_level_height_rho. met.wind_heights handles both and the tests pin it for both stores.
  • Put the env's DLL folders on PATH before calling its Python. Called by full path without conda activate, the interpreter cannot find the BLAS DLLs, and the first library that needs them dies with exit 0xC06D007E (shown as -1066598273) and no traceback. matplotlib does on its first savefig. serve.cmd sets it; from a shell, prepend <env>, <env>\Library\mingw-w64\bin, <env>\Library\usr\bin, <env>\Library\bin and <env>\Scripts, which is what activation does.
  • The server starts on port 8790, and steps up if that is busy. It used to start on 8766. The decks' server steps from 8765 to 8766 when 8765 is busy, and then the two servers ended up on the same port, one on IPv4 and one on IPv6. --port picks another port.
  • The first export downloads Natural Earth's shaded relief (11 MB) into cartopy's data directory. Offline, the export still finishes, without relief, and the page does not offer it; export --force tries again.
  • zarr stays 2.x, since the met stores were written for it.
  • No page opens over file://. Browsers block ES modules there; the page's classic script says so on screen.
  • PYTHONIOENCODING=utf-8 whenever output is piped or redirected, or a — in a domain title raises UnicodeEncodeError.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages