create_dataset module
This file is used to create a GPR dataset using gprMax.
First creates some input files based on the provided configuration, then runs gprMax on the input files to get the output.
It also creates geometry files and converts their content into numpy arrays containing the relevant physical values.
- src.dataset_creation.create_dataset.check_gpu() bool[source]
Checks if it is possible to use a GPU in the simulations process.
- Returns:
- bool
True if it is possible to use a GPU, False otherwise.
- src.dataset_creation.create_dataset.create_gprmax_input_files(config: GprMaxConfig)[source]
Creates the input files needed from gprMax to run the simulations.
Each file also includes geometry save commands to retain the built geometry.
The intermediate A-scans are set to be written in ‘output_dir/tmp/’
Creates an pickled file containing data about the random values of all the input files created.
- Parameters:
- configGprMaxConfig
gprMax configuration
- src.dataset_creation.create_dataset.run_simulations(input_dir: str | Path, tmp_dir: str | Path, output_dir: str | Path, n_ascans: int, geometry_only: bool, gpu: bool)[source]
Runs the gprMax simulations specified inside the input_dir folder and places its outputs in the output_dir folder.
Automatically combines the multiple A-scans created for each sample into a single B-scan file. Autotatically combines the snapshots created from the scripts into an .npz file. Additionally creates gprMax geometry files corresponding to each input file and converts them into numpy format.
If the ‘geometry_only’ parameter is set, only creates geometry files, without running the simulations.
- Parameters:
- input_dirstr | Path
directory in which to find the fprMax input .in files
- tmp_dirstr | Path
directory in which to store the intermediate results
- output_dirstr | Path
directory in which to store the output
- n_ascansint
number of A-scans for each generated B-scan
- geometry_onlybool
if set, gprMax will not run the simulations, but only build the file geometries.
- gpubool
if set, try to run gprMax in gpu mode.