Skip to content

Add iteration controls, GIF export, runtime metrics, and custom colormap to waveform inversion script#33

Open
Fuwsusu wants to merge 1 commit into
mainfrom
codex/add-iteration-time-calculation-and-controls-7j2blb
Open

Add iteration controls, GIF export, runtime metrics, and custom colormap to waveform inversion script#33
Fuwsusu wants to merge 1 commit into
mainfrom
codex/add-iteration-time-calculation-and-controls-7j2blb

Conversation

@Fuwsusu

@Fuwsusu Fuwsusu commented Apr 14, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Provide controllable iteration flow and the option to stop early to speed up debugging and interactive runs by adding requestedIterations and runAllIterations logic.
  • Improve observability of inversion progress by computing and logging per-iteration timing and quantitative metrics (data misfit and time-shift residuals).
  • Produce per-iteration visual output (animated GIF) and improve visual contrast with a soft red-blue colormap for easier interpretation of velocity/attenuation updates.

Description

  • Added iteration, GIF and display controls including runAllIterations, requestedIterations, saveGIF, gif_delay, and gif_save_every, plus a soft red-blue colormap cmap_rb used for image displays.
  • Implemented early-stop logic in the main inversion loop so the run stops when iter exceeds requestedIterations unless runAllIterations is true.
  • Introduced per-iteration metrics and timing variables ITER_TIME_SEC, PHI_ITER, DELTA_PHI_ITER, TAU_SHIFT_ITER, and prev_phi_k, and accumulated phi_k and tau_k inside the adjoint build; metrics are displayed each iteration.
  • Added animated GIF export (gif_filepath) that appends frames per iteration when saveGIF is enabled, updated final save to include the new arrays, and printed main loop and total script runtime.
  • Switched plot colormaps from gray to the new cmap_rb and updated the results save path to include the new metrics.

Testing

  • No automated tests were executed for this change.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant