# 3.2.4. Sensitivity Matrix Input File¶

Before running the inversion, we must construct the sensitivity matrix.
The sensitivity matrix defines the linear relationship between the data and model.
The sensitivity matrix is computed using the program **magsen3d_60.exe**, see running the program.

The lines of input file for the executable are as follows:

Line # | Description | Description |
---|---|---|

1 | Tensor mesh | path to tensor mesh file |

2 | Data file | observed data file |

3 | Topography | topography |

4 | Distance/depth weights | name of distance/depth weights file |

5 | Wavelet type | wavelet type used in compression |

6 | Wavelet compression parameters | tol eps |

7 | Output diagnostic options | 0 (no) or 1 (yes) |

8 | Scale sensitivity options | scale for L2 or sparse inversion |

An example of the input file for L2 inversion is shown below. You may also Download the input file for a sparse norm inversion .

## 3.2.4.1. Line Descriptions¶

Tensor Mesh:file path to a tensor mesh file

Data File:file path to the observations file

Topography:there are two options for defining the topography.

- type
nullfor no defined topography (all cells are active)- provide the
filepathto to a topography file

Distance/Depth Weights:path to the depth or distance weights file output by the programpfweight.exe.

Wavelet Type:type of wavelets used to compress the rows of the sensitivity matrix. The choices are:

- Use the flag
NONEfor no wavelet compression- For symmlets, choose one of
symm4,symm5orsymm6- For Daubechies, choose one of
daub1,daub2, … ,daub6

Note

For most inversions, *daub2* works well. Other options remain for the user’s own experimentation.

Wavelet Parameters:

Use the flag

nullif no wavelet compression is usedOtherwise, the wavelet compression is defined by two parameters

itolandepswhich are separated by a space.

itol=1:the program calculates the relative threshold andepsis the relative reconstruction error of the sensitivity. A reconstruction error ofeps= 0.05 (95%) is usually adequate.itol=2:the user defines the threshold level andepsis the threshold to be used.

Output diagnostic options:

0- Do not output diagnostic files1- Output diagnostic files. In this case, the diagnostic files are: (1) the predicted data for a model of ρ=0.1 with the wavelet compressed sensitivity, (2) the predicted data for a model of ρ=0.1 with the full sensitivity, (3) the averaged sensitivity in each cell based on the wavelet compression. An extra line in the log file is also written giving the user the achieved reconstruction error (e.g. eps when itol=1 from above).

Scale sensitivity options:

1- Scale sensitivity by the distance weighting function. This is used when performing an L2 inversion.0- Scale the model objective function by the distance weighting. This option must be used when using compact or blocky norms.