seisflows.workflow.migration

Seismic migration performs a ‘time-reverse migration’, or backprojection. In the terminology of seismic imaging, we are running a forward and adjoint simulation to derive the gradient of the objective function. This workflow sets up the machinery to derive a scaled, smoothed gradient from an initial model

Warning

Misfit kernels require large amounts of disk space for storage. Setting `export_kernel`==True when PAR.NTASK is large and model files are large may lead to large file overhead.

Note

Migration workflow includes an option to mask the gradient. While both masking and preconditioning involve scaling the gradient, they are fundamentally different operations: masking is ad hoc, preconditioning is a change of variables; For more info, see Modrak & Tromp 2016 GJI

Classes

Migration

Migration Workflow

Module Contents

class seisflows.workflow.migration.Migration(path_mask=None, export_gradient=True, export_kernels=False, **kwargs)

Bases: seisflows.workflow.forward.Forward

Migration Workflow

Run forward and adjoint solver to produce event-dependent misfit kernels. Sum and postprocess kernels to produce gradient. In seismic exploration this is ‘reverse time migration’.

Parameters

type export_gradient:

bool

param export_gradient:

export the gradient after it has been generated in the scratch directory. If False, gradient can be discarded from scratch at any time in the workflow

type export_kernels:

bool

param export_kernels:

export each sources event kernels after they have been generated in the scratch directory. If False, gradient can be discarded from scratch at any time in the workflow

Paths

type path_mask:

str

param path_mask:

optional path to a masking function which is used to mask out or scale parts of the gradient. The user-defined mask must match the file format of the input model (e.g., .bin files).

***

__doc__
export_gradient = True
export_kernels = False
_required_modules = ['system', 'solver', 'preprocess']
property task_list

USER-DEFINED TASK LIST. This property defines a list of class methods that take NO INPUT and have NO RETURN STATEMENTS. This defines your linear workflow, i.e., these tasks are to be run in order from start to finish to complete a workflow.

This excludes ‘check’ (which is run during ‘import_seisflows’) and ‘setup’ which should be run separately

Note

For workflows that require an iterative approach (e.g. inversion), this task list will be looped over, so ensure that any setup and teardown tasks (run once per workflow, not once per iteration) are not included.

Return type:

list

Returns:

list of methods to call in order during a workflow

run_adjoint_simulations(**kwargs)

Performs adjoint simulations for all events. Some additional file naming to ensure kernels are discoverable by other modules.

Note

This is a relatively simple function, but it keeps the approach general by allowing other workflows to include pre- and post- processing tasks, or to overwrite the adjoint simulation task

_run_adjoint_simulation_single(save_kernels=None, export_kernels=None, **kwargs)

Run an adjoint simulation for a single source. Allow saving kernels by moving them out of the run directory to another location. Allow exporting kernels by copying them to the output directory.

Note

Must be run by system.run() so that solvers are assigned individual task ids/working directories.

Note

see solver.specfem.adjoint_simulation() for full detailed list of input parameters

Parameters:
  • save_kernels (str) – path to a directory where kernels created by the adjoint simulation are moved to for further use in the workflow Defaults to saving kernels in scratch/eval_grad/kernels/<source>

  • export_kernels – path to a directory where kernels are copied for more permanent storage, where they will not be wiped by clean or restart. User parameter export_kernels must be set True.

postprocess_event_kernels()

Combine/sum NTASK event kernels into a single volumetric kernel and then (optionally) smooth the output misfit kernel by convolving with a 3D Gaussian function with user-defined horizontal and vertical half-widths, or by using the laplacian smoothing operator.

Note

If you hit a floating point error during the smooth operation, your kernels may be zero due to something going awry in the misfit quantification or adjoint simulations.

evaluate_gradient_from_kernels()

Generates the ‘gradient’ from the ‘misfit kernel’. This involves scaling the gradient by the model vector (log dm –> dm) and applying an optional mask function to the gradient.

Raises:

SystemError – if the gradient vector is zero, which means that none of the kernels returned usable values.