Requirements and setup for running RFDFWIM on your machine.
- MATLAB (R2016b or later recommended; 64-bit).
- Operating system: Windows (tested on Windows 10 Pro 64-bit). The code may run on Linux/macOS with minor path/script checks.
- Sufficient RAM for the grid size and number of frequencies (e.g. 32 GB for 180×180, 10 frequencies, as in the tested setup).
- Parallel Computing Toolbox — Used by
GPRFM.mandRFDFWI.mforparforandparpool. Without it, you must replaceparforwithforand remove or comment outparpoolcalls. - Image Processing Toolbox — Used for
imgaussfiltinRFDFWI.mto build the initial model. If unavailable, replace with another smoothing method or omit smoothing.
Clone or download the RFDFWIM folder to your machine, e.g.:
e:\#[CWNU_backup\RFDFWIM
(or your chosen path). Ensure these are present:
- Root:
GPRFM.m,RFDFWI.m,create_models_mkl.m,inp_GPRmodel.m,inp_GPRmodel1.m,seismic.map - Folders:
forward/,inv/,create_models/,input/,docs/ - Optional:
extra/
From the project root, create directories that scripts expect:
For forward modelling:
output/— forward figures and exportsobs/— observed data (obs_data.mat)
For inversion:
outputmyINV/outputmyINV/figs/outputmyINV/models/outputmyINV/grad/outputmyINV/grad_tikh/outputmyINV/gradm/outputmyINV/wavefield/outputmyINV/Hgrad/
In MATLAB:
cd 'e:\#[CWNU_backup\RFDFWIM' % your path
mkdir output
mkdir obs
mkdir outputmyINV
mkdir outputmyINV\figs
mkdir outputmyINV\models
mkdir outputmyINV\grad
mkdir outputmyINV\grad_tikh
mkdir outputmyINV\gradm
mkdir outputmyINV\wavefield
mkdir outputmyINV\HgradThe scripts inp_GPRmodel.m and inp_GPRmodel1.m add subdirectories to the path using path(path, [pwd '/forward']); etc. As long as you run MATLAB with the current directory set to the RFDFWIM root, the code should find all .m files. If you run from another directory, add the root and subfolders to the path first.
Before the first run:
- Run create_models_mkl.m once to generate
input/MYMOD_eps.dat,input/MYMOD_sig.dat,input/MYMOD_source.dat,input/MYMOD_receiver.dat.
If you prefer to use your own models, provide ASCII files in the same format and the same names (or change the file names in readeps1.m, readsig1.m, and read_acq_jan.m).
-
Set current directory to RFDFWIM root.
-
Run:
create_models_mklCheck that
input/MYMOD_eps.dat,MYMOD_sig.dat,MYMOD_source.dat,MYMOD_receiver.datare created. -
Run:
GPRFMCheck that
obs/obs_data.matand figures inoutput/are created. -
Run:
RFDFWICheck that
outputmyINV/is filled with figures and.matfiles.
If any step fails, check the error message: often it is a missing folder, missing toolbox (e.g. imgaussfilt, parpool), or wrong current directory.
| Item | Used in | Note |
|---|---|---|
parpool, parfor |
GPRFM.m, RFDFWI.m, forward/, inv/ | Parallel Computing Toolbox; else use for and no parpool. |
imgaussfilt |
RFDFWI.m | Image Processing Toolbox; else replace with custom smoothing. |
exportgraphics |
GPRFM.m, RFDFWI.m | R2020a+; else use saveas or print. |
load('seismic.map') |
Multiple | Colormap file seismic.map must be in the current directory (root). |
blackharrispulse |
GPRFM.m | Used for time-domain display; ensure this function is on the path (custom or toolbox). |
- OS: Windows 10 Pro, 64-bit
- MATLAB: Not specified in repo; R2016b+ recommended
- Hardware: Lenovo ThinkStation, AMD Ryzen Threadripper PRO 3955WX 16-Cores 3.90 GHz, 32 GB RAM
- “Undefined function or variable 'parpool'” — Install Parallel Computing Toolbox or comment out
parpooland changeparfortoforin the scripts that use them. - “Unable to find or open 'obs/obs_data.mat'” — Run GPRFM.m first so that
obs/obs_data.matexists. - “Unable to find or open 'input/MYMOD_eps.dat'” — Run create_models_mkl.m first, or create the
input/files manually. - “Folder 'outputmyINV/figs' does not exist” — Create the folder or the full
outputmyINVstructure (see step 2 above). - Colormap or figure errors — Ensure
seismic.mapis in the project root and that the current directory in MATLAB is the project root.
For run order and usage, see COMMANDS.md and MANUAL.md.