Palaeoclimate cluster (T40–T45): tidy pass, rim/coastline fixes, PLASIM-GENIE naming#1
Open
amer7632 wants to merge 11 commits into
Open
Palaeoclimate cluster (T40–T45): tidy pass, rim/coastline fixes, PLASIM-GENIE naming#1amer7632 wants to merge 11 commits into
amer7632 wants to merge 11 commits into
Conversation
…rtifacts - Code hygiene: drop duplicate/unused imports and stale out-of-order "# Cell N" comments; fix the mis-indented plot_engine argument. - Align prose with code: modern clamp is -30..30 (not 0..60); anomaly clamp is ±37 (not ±30); rewrite the stale modern-palette rationale. - Rename the deep-time model cGENIE-PLASIM → GENIE-PLASIM (it is a PLASIM-GENIE run). Kept the accurate T41 cGENIE cross-reference and the on-disk data filename. - References: fix the doubled pySCION parenthetical, correct the Lunt DeepMIP citation to Lunt et al. 2017 (GMD), add Valdes 2021 and a dataset provenance line. - Anomaly palette jet → vik (perceptually uniform, CVD-safe). - Fix map edge artifacts: add close_lon_seam (fill the ±180 seam), clamp_lat_poles, and refine_for_plot (resample to 0.5° so the coarse cells don't staircase along the high-latitude Mollweide rim). The final transpose in refine_for_plot is required — pygmt infers the plot region from dim order, and the Gaussian-lat deep grid was silently transposing and collapsing to a central blob. - Re-executed in a clean kernel; outputs refreshed (pygmt 0.19.0). Note: the bundled hadcm3_modern_mat.nc is nearly zonal / not a faithful HadCM3 SAT field (pre-existing data issue, unrelated to these changes). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New Notebooks/paleoclimate_helpers.py holds close_lon_seam / clamp_lat_poles / refine_for_plot (the Mollweide seam/rim display helpers). T40 now imports them instead of defining them inline; T41 imports refine_for_plot too. T41: - Fix Data availability filename (cgenie_eocene_sst_50Ma.nc -> the actual bundled cgenie_eocene_sst_example.nc). - Remove cgeniepy: it was imported and advertised but never used. Prose, learning objectives, and prereqs updated to say the bundled netCDF is loaded directly with xarray. Also fix a palette mismatch (prose said viridis; code uses thermal). - Drop duplicate imports and out-of-order "# Cell N" comments. - Strip the inline "cGENIE (https://...)" / "bayfox (https://...)" URL clutter repeated after nearly every mention; keep the URL once in prereqs/references. - Apply refine_for_plot to the model SST map (fixes the ±180 seam wedges and high-latitude staircase, same artifact fixed in T40). - Overlay reconstructed 50 Ma coastlines (anchor 701701) on both the model-SST panel and the residual panel, replacing modern coastlines, so the proxy points sit on their paleo-geography. PlotTopologies built once and reused. - Re-executed in a clean kernel; outputs refreshed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…T40 naming The end-Permian climate model is PLASIM-GENIE (cGENIE module off for these runs), not SCION. T43 (renamed T43_SCION_SAT_On_Permian_Reconstruction -> T43_PLASIM_GENIE_SAT_On_Permian_Reconstruction): - Replace every "SCION" reference with PLASIM-GENIE (title, prose, comments, figure stamps, SCION_NC -> CLIMATE_NC). On-disk data path data/scion_permian/scion_252Ma_equilibrium.nc kept as-is. - Swap the Mills 2021 SCION reference for Holden et al. 2016 (PLASIM-GENIE). - Fix wrong plate-model labels: coastlines are Merdith2021 (config), but the prose named Mueller2022 (cell 9) and Zahirovic 2022 (cell 12); also "Merdith 2022" -> 2021 in Extend this. - Apply refine_for_plot to the SAT and landsea-mask panels for a clean Mollweide rim (rename netCDF longitude/latitude coords to lon/lat first). - Hygiene: import shared helpers, drop "# Cell N" comments, the dead get_subduction_direction() line, and the unused Path import. T40: - Align the deep-time model name GENIE-PLASIM -> PLASIM-GENIE (config, prose, figure stamp) to match T43 and the canonical model name. Both re-executed in a clean kernel; outputs refreshed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ata dir; drop SCION from T40 The end-Permian ensemble is PLASIM-GENIE (PLASIM + GOLDSTEIN; cGENIE module off), not SCION. Data: - Rename data/scion_permian/ -> data/plasim_genie_permian/ and the three nc files scion_252Ma_* -> plasim_genie_252Ma_*. Rewrite the bundle README (PLASIM-GENIE, Holden 2016 citation, correct T43/T44 cross-refs, drop the personal path). T44 (renamed T44_SCION_CO2_Sensitivity_252Ma -> T44_PLASIM_GENIE_CO2_Sensitivity_252Ma): - Replace every SCION reference with PLASIM-GENIE (title, prose, comments, figure titles, MODEL_NAME, SCION_NC -> CLIMATE_NC); swap Mills 2021 + pySCION refs for Holden et al. 2016. - Fix the SAT-panel coastlines: it drew MODERN GSHHG coastlines on a 252 Ma map; now draws the model's own 252 Ma coastline as the 0.5 contour of the PLASIM-GENIE landsea_mask. - Fix the mangled "CO2" figure title (Unicode subscript did not render in GMT). - Apply refine_for_plot to the SAT panels for a clean Mollweide rim. - Hygiene: fix the broken version probe (pygmt.version -> __version__), import the shared helper, drop "# Cell N" comments, strip the inline cGENIE URL. - Update data path to the renamed bundle. T43: update data path to the renamed bundle. T40: remove the remaining SCION framing (data-availability + references) now that the run is confirmed PLASIM-GENIE; cite Holden 2016 instead of Mills 2021 / pySCION. T43 + T44 re-executed in a clean kernel (T40 change is prose-only). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ization - Move the model spin-up / equilibrium-check section from the end (was section 5) to section 2, right after loading — validate the runs reached equilibrium before analysing the last-year snapshot. Renumber the following sections. - Fix the spin-up panel units: the bundled spin-up scalars (GAST, top_thermal_abs) were area-weighted but never divided by the number of longitudes, so they were a factor n_lon (=64) too large. Divide by n_lon so GAST is in degC (and matches the equilibrium GAST computed in the sensitivity section exactly: 280 ppm -> ~12 C, 1120 -> ~19 C, 17920 -> ~34 C) and |TOA thermal| is a genuine ~210-240 W/m2 flux. - Hoist the matplotlib import and the shared plot styling (base, norm_levels) into the imports/load cells so every panel (now including the moved spin-up) can use them. Re-executed in a clean kernel. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…T44) Re-running these in my local conda env leaked machine-specific noise into the committed outputs: kernelspec display_name "pyTUTORIALS" and stderr blocks containing "/opt/miniconda3/envs/pyTUTORIALS/..." paths (Qt objc duplicate-class warnings, tqdm IProgress, xarray/pygmt FutureWarnings). - Reset kernelspec display_name to "Python 3 (ipykernel)" (T41, T44). - Strip the noise stderr outputs from all four notebooks (figures, stdout, and execute_results are untouched; all still validate with the same image counts). nbformat also normalised two T40 markdown cells' source from a single string to the canonical list-of-lines form (identical text). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…er7632/pySCION - Critical fix: age = np.abs(state.time.flatten()) is in YEARS, not Ma. Divide by 1e6. This was mislabelling every time-series x-axis (they read 0-6e8 "Ma") and, worse, breaking SET 5's inflection-age lookup: argmin(|age - t|) compared t in Ma against age in years, so all three paleo-Earth maps stamped the same ~349 ppmv (near-present) pCO2. Now the run window prints "0 - 600 Ma" and the maps show the correct age-specific pCO2 (250 Ma -> 8690, 100 Ma, 30 Ma -> 336 ppmv). - API fix: the current amer7632/pySCION pySCION_initialise() returns (run, interpstack, lipstack) for production runs, not a single Run_class. Unpack robustly: state = (run[0] if isinstance(run, tuple) else run).state. - Point the pySCION repo reference at github.com/amer7632/pySCION (the repo the notebook actually expects), strip the repeated inline pySCION/Scotese URL clutter, drop the "# Cell N" comments. - Re-executed against a fresh clone of amer7632/pySCION (needs openpyxl for the Excel forcings). external/pySCION is gitignored, so it is not committed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Dependencies the paleoclimate cluster now needs but were missing from the env file: - cmcrameri (conda-forge) — T44/T45 colour maps - openpyxl (conda-forge) — pySCION Excel forcings (T45) - cgeniepy (pip; not on conda-forge) — cGENIE reader (T41) bayfox (T42) intentionally omitted. pySCION (T45) is a separate clone at external/pySCION, not a package, so it's not listed here. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…rence Correct the preamble attribution, the Data-availability provenance, and the reference list to Merdith et al. (2025) Phanerozoic icehouse climates..., Science Advances 11(7), eadm9798 (was 'Mills & Gurung'). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… pass Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…te#1 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dietmarmuller
added a commit
that referenced
this pull request
Jul 16, 2026
Adopts substantive fixes from Andrew's PR #1 (branch palaeoclimate-cluster- fixes on amer7632 fork) onto the just-resequenced state, without restoring the T42/T43 deletes (per user email direction). Infrastructure: * Notebooks/paleoclimate_helpers.py — three display-only helpers (close_lon_seam, clamp_lat_poles, refine_for_plot) that fix Mollweide seam wrap, pole NaN slivers, and coarse-grid staircase artefacts along the map rim. Adopted from Andrew's PR; imported by T45, T46, T47. Data + naming corrections (Holden et al. 2016 identify the runs as PLASIM-GENIE, not cGENIE-PLASIM or SCION): * Renamed data/scion_permian/ → data/plasim_genie_permian/ * Renamed files scion_252Ma_{bathymetry,equilibrium,spinup}.nc → plasim_genie_252Ma_*.nc * Updated data/plasim_genie_permian/README.md * Updated SCION_NC → PLASIM_GENIE_NC config-var name in T47 * Renamed T47 file: SCION_CO2_Sensitivity → PLASIM_GENIE_CO2_Sensitivity * Swept 'cGENIE-PLASIM' → 'PLASIM-GENIE' across the suite T45 (was T40 Deep-time paleoclimate snapshots): * jet → vik anomaly palette (perceptually-uniform, colourblind-friendly) * Wrapped 3 grdimage calls with refine_for_plot (kills seam grey wedge + pole slivers + Mollweide rim staircase in one) * Removed the earlier _tag_as_pixel_geo helper — refine_for_plot supersedes with a more complete fix T46 (was T41 cGENIE SST vs proxies): * Wrapped grdimage call with refine_for_plot T47 (was T44 SCION CO2 sensitivity — file renamed): * SCION → PLASIM-GENIE prose sweep (preserving legitimate pySCION mentions as the ensemble driver — pySCION generated the runs, but the runs themselves are PLASIM-GENIE output) * CO₂ → CO2 in GMT-facing titles/labels (Unicode subscript doesn't render in GMT) * Wrapped grdimage call with refine_for_plot T48 (was T45 pySCION Phanerozoic): * years → Ma bug fix: appended ` / 1e6 # years → Ma` to age = state.time assignments. Before this, x-axes read 0-6e8 'Ma' and SET-5's inflection lookup compared Ma against years, stamping the same ~349 ppmv on every paleo-Earth map. Deferred (Andrew's PR does these too, but I haven't ported yet — they're targeted diffs that need per-notebook code inspection): * T47 64× normalization bug on spin-up scalars * T47 SAT-map coastlines: modern GSHHG → model's own land-sea-mask contour * T47 spin-up / equilibrium check move up to §2 * T46 remove unused cgeniepy dependency; switch to reconstructed 50 Ma coastlines (were modern); viridis → thermal palette * T48 adapt pySCION_initialise return signature to the amer7632 fork API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Palaeoclimate cluster (T40–T45): tidy pass, rim/coastline fixes, PLASIM-GENIE naming
A review/fix pass over the paleoclimate-cluster notebooks. All notebooks
re-executed in a clean kernel; a change-summary lives in
claude_palaeoclimate.md.T42 is intentionally not touched (see Known issues).
Shared infrastructure
Notebooks/paleoclimate_helpers.py—close_lon_seam,clamp_lat_poles,refine_for_plot: display-only helpers that fix the Mollweide ±180° seam wedgeand the high-latitude staircase when drawing coarse GCM rasters. Imported by
T40/T41/T43/T44.
data/scion_permian/→data/plasim_genie_permian/(files andREADME updated).
environment.yml— addedcmcrameri,openpyxl(conda-forge) andcgeniepy(pip).Model naming
The bundled end-Permian fields were labelled "cGENIE-PLASIM"/"SCION". They are
PLASIM-GENIE runs (cGENIE module off; Holden et al. 2016). T40/T43/T44 renamed
and relabelled accordingly; T45 stays pySCION (Merdith et al. 2025, Science
Advances).
Per-notebook
the deep-time map); prose/code palette mismatches;
jet→vik; SCION removed.cgeniepydep; rim fix; reconstructed50 Ma coastlines (were modern);
viridis→thermal; wrong filename fixed...._SCION_...) — SCION→PLASIM-GENIE; fixed wrongplate-model labels (prose said Müller2022/Zahirovic2022 for Merdith2021
coastlines); rim fix on both panels.
..._SCION_...) — SAT-map coastlines were modernGSHHG on a 252 Ma map → now the model's own land-sea-mask contour; mangled
"CO₂" title fixed; rim fix; spin-up/equilibrium check moved up to §2; fixed a
64× normalization bug in the spin-up scalars (missing
/n_lon).state.timeis in years): x-axes read 0–6×10⁸ "Ma"and SET 5's inflection lookup stamped ~349 ppmv on all three maps. After
/1e6the run window is "0–600 Ma" and maps show age-correct pCO₂ (250 Ma → 8690,
30 Ma → 336 ppmv). Adapted to the current pySCION tuple return; reference set to
Merdith et al. 2025.
Known issues / follow-ups
bayfoxinstalled (callsnon-existent
bayfox.predict_sst; invalidSPECIES), and its prose stilldescribes the old LR04 benthic data.
data/paleoclimate/hadcm3_modern_mat.nc(T40 modern panel) is nearly zonal —not a faithful HadCM3 field; left as-is.
plasim_genie_252Ma_spinup.ncstill stores the 64×-inflated values at source(T44 divides by
n_lonas a workaround).external/pySCION(amer7632/pySCION,gitignored) plus
openpyxl— not bundled.🤖 Generated with Claude Code