-
Notifications
You must be signed in to change notification settings - Fork 63
A simple forward computation
-
Install Mudpy. If you've already done this then run
git pull
from your terminal to make sure you have the up to date latest version with the right example files. - Configure MudPy for multiprocessor use, this can sometimes be painful and is NOT a necessary step, but try, it'll make your computations much much faster. Even your crappy laptop has at least 4 cores!
Look under $MUDPY/examples/forward_modeling/
you should see a listing of 6 files like so:
Ok, open the file nepal.fwd.py
this is the main parameter file that you will use to command the program. This file can live anywhere in your system it doesn't really matter where.
In order to make things run smoothly and keep everything organized MudPy uses a very specific fodler structure. THis will be created for you. In the parameter file nepal.fwd.py
edit the following lines:
home='/Users/dmelgar/Slip_inv/'
project_name='Nepal_forward_test'
home
must already exist and is where all your MudPy projects will be stored. project_name
is a name to give this particular project. This will be used to create the fodler structure. Note this is completely independent of where you are storing your .fwd.py
parameter files.
Now set the action flags as follows:
init=1
make_green=0
make_synthetics=0
solve=0
You are now ready to run the parameter file to create the folder structure. At your terminal run the python parameter file:
$ python $PATH_TO_FILE/nepal.fwd.py
$PATH_TO_FILE
is the path where you are storing the parameter file. After s execution you should now see a new folder structure under home/project_name
like so:
For a forward run you will need 5 auxiliary files defining the Earth structure model, the fault geometry, the kinematic rupture, and the station locations and kinds of data you want to synthesize. Note that these files need to be in very specific locations where MudPy will look for them.
- Earth structure: Copy the file
avouac.mod
from the examples folder tohome/project_name/structure/
the file should look like so:
The first column is the layer thickness in km, the second column is vs in km/s, the third column is vp in km/s, the fourth column is density in g/cm^3, the fifth column is Qs and the last column is Qp.
-
Station locations file: Copy the file
nepal.sta
tohome/project_name/data/station_info/
. This file is simply the coordinates of the sites you are interested in synthesizing. For this example these are the locations of high rate GPS stations. -
Station gflist file: Copy the file
gps.gflist' to
home/project_name/data/station_info/`. THis file controls what types of data re synthesized, displacement (GPS), velocity (strong motion), InSAR, etc. You need to modify the paths to point to your specific project folder, right now it looks like this and points to the project folder on my system:
The columns with the 1's and 0's indicate which type of data we want to synthesized. In this case we are requesting high-rate displacement data.
-
Fault geometry: Copy the file
nepal.fault
tohome/project_name/data/model_info/
. This file contains the fault geometry (nothing on the rupture kinematics yet) and you will need to build yourself. The header line indicates what each column is. -
Kinematic rupture model: Copy the file
nepal.rupt
tohome/project_name/forward_models
. This file contains the kinematic rupture description, explanations of the columns are in the headers. You need to create this file. If you have USGS finite fault inversions look under$MUDPY/src/python/mudpy/forward.py
there are two functions which you might be able to modify to suit your needs,usgs2fault()
creates the.fault
geometry file andusgs2rupt()
creates the kinematic.rupt
rupture file
Now you are ready to generate impulse response Green's functions and convolve them with the source time function shape fo your choosing to generate synthetics. Set the action flags as follows:
init=0
make_green=1
make_synthetics=1
solve=0
Now set the number of cpus you have available for computation, on my laptop this is ncpus=8
. Remember to look at the openMPI instructions (see above) to make sure parallel computing works for you. Now define static=0
to ensure you compute waveforms instead of static offsets. Also define all the auxiliary files:
model_name='avouac.mod'
rupture_name='nepal.rupt'
fault_name='nepal.fault'
station_file='nepal.sta'
GF_list='gps.gflist'
G_from_file=False
G_name='nepal'
Next define the waveform parameters:
NFFT=512 ; dt=0.2
dk=0.2 ; pmin=0 ; pmax=1 ; kmax=10
custom_stf=None
This will generate synthetics with 512 samples sampled at 5Hz or 0.2s between samples. Now specify the event origin:
time_epi=UTCDateTime('2015-04-25T06:11:26')
epicenter=array([84.708,28.147,15])
And make sure you set integrate=1
if you are interested in displacement synthetics or integrate=0
for velocity synthetics. That's it! Now ru it like last time by typing at your terminal $ python $PATH_TO_FILE/nepal.fwd.py
. You should see a lot of output indicating progress and you can see the GF's and synthetics being stored under home/project_name/GFs/dynamic/
.