GeoclassificationMPS Project
Branch:debug
This notebook is designed to test and debug the geostatistical simulation pipeline within the GeoclassificationMPS project. It enables configuration of simulation parameters, generation of Training Images (TI) and Conditioning Data (CD), execution of the simulation via DeeSse, and subsequent analysis and visualization of results.
from launcher import *
from interface import *
from geone.imgplot import drawImage2D
import os
os.chdir(r"C:\users\amen0052\documents\personal\geoclassificationmps")
print("Current directory:", os.getcwd())Key parameters to adjust as needed:
arg_seed: Random seed.arg_n_ti: Number of Training Images.arg_ti_pct_area: Percentage of area used for TI.arg_num_shape: Number of shapes (for TI generation).arg_aux_vars: Auxiliary variables.arg_output_dir: Output directory.
The central function get_simulation_info_custom() gathers all necessary parameters:
- Data CSV path
- TI generation methods available:
"DependentCircles","DependentSquares","IndependentSquares","Customised","ReducedTiSg" - Management of auxiliary, conditional, and simulation variables
- DeeSse settings (number of realizations, threads, etc.)
- Options for saving and visualizing outputs
- Ensure all required files (.csv, .npy, custom masks) are present in the expected folder (
./data/). - Adjust file paths as needed in the import and configuration cells.
In the relevant cell:
verbose = True
arg_seed = 123
arg_n_ti = 1
arg_ti_pct_area = 90
arg_num_shape = 15
arg_aux_vars = ["grid_lmp", "grid_grv"]
arg_output_dir = "./output/tmp"Modify these values according to your study case.
Call the function:
params, shorten, nvar, sim_var, auxTI_var, auxSG_var, condIm_var, names_var, types_var, outputVarFlag, nr, nc = get_simulation_info_custom(
arg_seed, arg_n_ti, arg_ti_pct_area, arg_num_shape, arg_aux_vars, arg_output_dir)Select the TI generation method, for example:
ti_methods = params['ti_methods']
if "DependentSquares" in ti_methods:
# Generation and visualization...Other methods are available based on your requirements.
Use plotting functions to display intermediate results:
plot_mask(ti_frame_DS[0], masking_strategy="Dependent Squares")
drawImage2D(ti_list[0], iv=0)
save_plot("aux_var")Prepare the simulation object:
deesse_input = gn.deesseinterface.DeesseInput(...)
deesse_output = gn.deesseinterface.deesseRun(deesse_input, nthreads=nthreads, verbose=2)if saveOutput:
save_simulation(deesse_output, params, output_directory=deesse_output_folder_complete)Compute and visualize entropy, divergence, etc.:
ent, dist_hist, dist_topo_hamming = calculate_indicators(...)
std_ent, realizations_range1 = calculate_std_deviation(ent, 1, numberofmpsrealizations)
plot_realization(deesse_output=deesse_output)- File Paths: Enter your own project path in the first cell.
- Documentation: Follow the notebook’s in-line examples and formats for preparing your data files (.csv, .npy).
- Modularity: Experiment with different TI generation methods to compare their impact on results.