Skip to content

Add MCMC inversion mode alongside NA in TC1D (clean PR to develop) + Enhance erosion model (ero_type 2) to support up to 5 intervals#49

Open
gerardb-fr wants to merge 2 commits intoHUGG:developfrom
gerardb-fr:BG_MCMC_NA_erosion_deposition
Open

Add MCMC inversion mode alongside NA in TC1D (clean PR to develop) + Enhance erosion model (ero_type 2) to support up to 5 intervals#49
gerardb-fr wants to merge 2 commits intoHUGG:developfrom
gerardb-fr:BG_MCMC_NA_erosion_deposition

Conversation

@gerardb-fr
Copy link
Collaborator

Clean follow-up to the earlier PR (#42).

  • Does not edited sample_data.csv
  • Does not add tc1d_original.py
  • Targets develop as requested

Key changes:

  • Adds batch_run_na() and batch_run_mcmc() functions
  • Adds --inverse-mode flag in tc1d_cli.py
  • Preserves existing TC1D structure and CLI compatibility
  • Generates optional MCMC diagnostics (chains, corner, misfit)
    -- Added CLI options: --ero-option9 and --ero-option10
  • Extended erosion rate calculation for up to 5 intervals (thickness + time)
  • Updated total exhumation calculation to include ero_option9
  • Applied constraints in MCMC and NA to prevent exceeding max exhumation
  • Extended batch mode detection and output logging for new parameters
  • Added bounds logic in ‘batch_run_na’ to handle negative erosion values (up to -15 km) using max_burial and max_exhumation constraints.
  • Enforced cumulative erosion thickness to avoid total uplift above surface.
  • Safeguarded temperature and pressure interpolation for depth < 0 (to avoid scipy interpolation errors).
  • Updated MCMC log_prior constraints to support negative values for ero_option1, 3, 5, 7, 9
  • Enforced dynamic upper/lower bounds for each interval based on cumulative exhumation and burial limits
  • Introduced max_burial (default 15 km) as lower limit for allowed burial
  • Rejected models with cumulative erosion < 0 km to avoid unrealistic above-surface placement
  • Applied identical logic for both NA and MCMC to ensure consistent inversion behavior
  • All changes clearly marked with '# BG:’
  • Preserved full backward compatibility for previous 3-interval configurations

This enables testing of more complex, stepwise erosion histories in both forward and inversion modes.

…rosion model (ero_type 2) to support up to 5 intervals and enable support for negative erosion values (burial) for NA and MCMC inversions

- Refactored inversion logic: added separate `batch_run_na` and `batch_run_mcmc` functions
- Introduced `--inverse-mode` CLI flag to switch between NA and MCMC
- Preserved existing TC1D architecture and compatibility with CLI erosion parameters
- Automatic generation of MCMC output plots (corner plots, trace plots, misfit scatter)
- Added CLI options: --ero-option9 and --ero-option10
- Extended erosion rate calculation for up to 5 intervals (thickness + time)
- Updated total exhumation calculation to include ero_option9
- Applied constraints in MCMC and NA to prevent exceeding max exhumation
- Extended batch mode detection and output logging for new parameters
- Added bounds logic in ‘batch_run_na’ to handle negative erosion values (up to -15 km) using max_burial and max_exhumation constraints.
- Enforced cumulative erosion thickness to avoid total uplift above surface.
- Safeguarded temperature and pressure interpolation for depth < 0 (to avoid scipy interpolation errors).
- Updated MCMC log_prior constraints to support negative values for ero_option1, 3, 5, 7, 9
- Enforced dynamic upper/lower bounds for each interval based on cumulative exhumation and burial limits
- Introduced `max_burial` (default 15 km) as lower limit for allowed burial
- Rejected models with cumulative erosion < 0 km to avoid unrealistic above-surface placement
- Applied identical logic for both NA and MCMC to ensure consistent inversion behavior
- All changes clearly marked with '# BG:’
- Preserved full backward compatibility for previous 3-interval configurations

This enables testing of more complex, stepwise erosion histories in both forward and inversion modes.
…rosion model (ero_type 2) to support up to 5 intervals and enable support for negative erosion values (burial) for NA and MCMC inversions

- Refactored inversion logic: added separate `batch_run_na` and `batch_run_mcmc` functions
- Introduced `--inverse-mode` CLI flag to switch between NA and MCMC
- Preserved existing TC1D architecture and compatibility with CLI erosion parameters
- Automatic generation of MCMC output plots (corner plots, trace plots, misfit scatter)
- Added CLI options: --ero-option9 and --ero-option10
- Extended erosion rate calculation for up to 5 intervals (thickness + time)
- Updated total exhumation calculation to include ero_option9
- Applied constraints in MCMC and NA to prevent exceeding max exhumation
- Extended batch mode detection and output logging for new parameters
- Added bounds logic in ‘batch_run_na’ to handle negative erosion values (up to -15 km) using max_burial and max_exhumation constraints.
- Enforced cumulative erosion thickness to avoid total uplift above surface.
- Safeguarded temperature and pressure interpolation for depth < 0 (to avoid scipy interpolation errors).
- Updated MCMC log_prior constraints to support negative values for ero_option1, 3, 5, 7, 9
- Enforced dynamic upper/lower bounds for each interval based on cumulative exhumation and burial limits
- Introduced `max_burial` (default 15 km) as lower limit for allowed burial
- Rejected models with cumulative erosion < 0 km to avoid unrealistic above-surface placement
- Applied identical logic for both NA and MCMC to ensure consistent inversion behavior
- All changes clearly marked with '# BG:’
- Preserved full backward compatibility for previous 3-interval configurations

This enables testing of more complex, stepwise erosion histories in both forward and inversion modes.
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.

1 participant