Skip to content

Release v?? -- Glacier summer school#29

Draft
jhkennedy wants to merge 521 commits into
releasefrom
main
Draft

Release v?? -- Glacier summer school#29
jhkennedy wants to merge 521 commits into
releasefrom
main

Conversation

@jhkennedy

Copy link
Copy Markdown
Member

No description provided.

aaschwanden and others added 30 commits June 1, 2026 07:22
and results
  pism_terra/raster.py: introduce local_scale_factor(crs, x, y) that returns
  the dimensionless local scale factor k such that 1 m of true ground
  displacement at (x, y) equals k m of crs map units.

  - Computes sqrt(|det J|) of the true→map Jacobian via a numerical
    finite difference of pyproj's geographic→crs transform.
  - Uses the source ellipsoid's prime-vertical N(φ) and meridional M(φ)
    radii of curvature to convert the geographic step to true metres,
    instead of a hardcoded 6378137 m (correct on non-WGS-84 datums too).
  - Vectorised on numpy arrays; scalar in → float out.

  Motivation: glacier_velocities_from_grid does a finite-difference
  advect-and-roundtrip to rotate vx/vy into the destination CRS axes,
  which silently assumes the source CRS has unit local scale. That holds
  for the ITS_LIVE v2.1 per-region polar-stereographic COGs but fails for
  EPSG:3857 (Web Mercator), where k = 1/cos(φ) ≈ 2 at 60° N and the
  returned vx/vy come out halved. Pre-multiplying vx_pts/vy_pts by k
  ahead of the FD makes the round-trip CRS-agnostic.

  The docstring documents the math (with the M, N, det J formulae),
  explains the conformal-vs-non-conformal behaviour, and ships three
  doctest examples covering Mercator at 60° N, polar-stereo near its
  true-scale latitude, and the array call signature.

  Single-line subject if you prefer the terse style:

  raster: add local_scale_factor for CRS-agnostic vector transforms
impi renamed to iimpi. Uff.
get resolution from config.
aaschwanden and others added 29 commits July 9, 2026 11:56
Split each ISMIP7 product scalar file into per-variable diagnostics
(lim, limnsw, iareagr/fl, tend*) via a packaged NCO script run at the end
of the generated forward job script.

- data/postprocess_ismip7_scalar.sh: NCO script (fix global attrs + time
  units; extract each diagnostic to float with _FillValue; correct flux
  units/time). Uses a per-input scratch file so concurrent sweep jobs
  don't collide on a shared tmp.nc.
- run.py: post_scalar_str runs the script on the product-leg scalar --
  scalar_hist for historical experiments (C001/C002), scalar_proj for the
  projection experiments, both for legacy non-counter runs.
- templates: add {{ post_scalar_str }} to the ISMIP7 forward templates
  (and the missing compliance-checker block to chinook-ismip7.j2).
- pyproject: ship data/*.sh in package-data.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014DGQGDhsstkb1faoVUwh4M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants