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
Conversation
…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.
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.
Clean follow-up to the earlier PR (#42).
Key changes:
-- Added CLI options: --ero-option9 and --ero-option10
max_burial(default 15 km) as lower limit for allowed burialThis enables testing of more complex, stepwise erosion histories in both forward and inversion modes.