Skip to content

An example with the 2015 M7.8 Nepal earthquake

Diego Melgar edited this page Mar 14, 2017 · 24 revisions

Here I will walk you step by step through running the Nepal earthquake. This is one of the pre-canned examples which you can find in the MUD/examples folder. Note this is using only the high-rate GPS stations. If you want to reproduce the full results that we calculated in the Galetzka et al., 2015 paper in Science, that's more complicated because there we used InSAR. That's for another time. The model you will obtain here is different (this is inversion after all!) from the one in the paper but this is a useful end-to-end exercise.

Step 1: Create a folder for your parameter files in and copy the example .inv file

Parameter files used for inversion have a .inv extension. This is not required I just do it so I have an easy way of identifying what is what. I have a folder separate from everything else where I keep my parameter (.inv) files. So create a folder where you will save all your parameter files and then copy the file nepal_version_2.inv.py from $MUD/examples/nepal_inverse\ into that folder. In my case all my inversion files are in /Users/dmelgar/Slip_inv/run/ this is what that folder looks like for me after copying the relevant file:

Edit the parameter file and run it with init = 0

Open the nepal_version_2.inv.py file and change the variables that define where the inversion results and auxiliary files will be. This is a different folder than where you save your parameter files, like so:

home='/Users/dmelgar/Slip_inv/'
project_name='Nepal_example'
run_name='example'

home is where all the different inversions will live. project_name will be the folder name for this inversion project, and run_name will be the name of the inversion output files. After this is done set the flags to only initalize the folder structure by doing:

init=1 #Initalize project
make_green=0 #Compute GFs
make_synthetics=0 #Compute synthetics for a given model at given stations
G_from_file=0# =0 read GFs and create a new G, =1 load G from file
invert=0  # =1 runs inversion, =0 does nothing

Nothing else matters for now. Next step is to run it. Go to the terminal and run the script by typing:

  python /Users/dmelgar/code/MudPy/examples/nepal_inverse/nepal_version2.inv.py