Skip to content

Latest commit

 

History

History
146 lines (97 loc) · 4.8 KB

File metadata and controls

146 lines (97 loc) · 4.8 KB

RFDFWIM — Installation

Requirements and setup for running RFDFWIM on your machine.


System requirements

Required

  • 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).

Recommended

  • Parallel Computing Toolbox — Used by GPRFM.m and RFDFWI.m for parfor and parpool. Without it, you must replace parfor with for and remove or comment out parpool calls.
  • Image Processing Toolbox — Used for imgaussfilt in RFDFWI.m to build the initial model. If unavailable, replace with another smoothing method or omit smoothing.

Installation steps

1. Get the repository

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/

2. Create required folders (if missing)

From the project root, create directories that scripts expect:

For forward modelling:

  • output/ — forward figures and exports
  • obs/ — 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\Hgrad

3. Add paths (optional)

The 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.

4. Input files

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).


Verifying the installation

  1. Set current directory to RFDFWIM root.

  2. Run:

    create_models_mkl

    Check that input/MYMOD_eps.dat, MYMOD_sig.dat, MYMOD_source.dat, MYMOD_receiver.dat are created.

  3. Run:

    GPRFM

    Check that obs/obs_data.mat and figures in output/ are created.

  4. Run:

    RFDFWI

    Check that outputmyINV/ is filled with figures and .mat files.

If any step fails, check the error message: often it is a missing folder, missing toolbox (e.g. imgaussfilt, parpool), or wrong current directory.


Known dependencies

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).

Tested configuration

  • 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

Troubleshooting

  • “Undefined function or variable 'parpool'” — Install Parallel Computing Toolbox or comment out parpool and change parfor to for in the scripts that use them.
  • “Unable to find or open 'obs/obs_data.mat'” — Run GPRFM.m first so that obs/obs_data.mat exists.
  • “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 outputmyINV structure (see step 2 above).
  • Colormap or figure errors — Ensure seismic.map is 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.