invert4geom.optimize_eq_source_params#
- optimize_eq_source_params(coordinates, data, n_trials=100, damping_limits=None, depth_limits=None, block_size_limits=None, sampler=None, plot=False, progressbar=True, parallel=False, fname=None, seed=0, **kwargs)[source]#
Use Optuna to find the optimal parameters for fitting equivalent sources to gravity data. The 3 parameters are damping, depth, and block size. Any or all of these can be optimized at the same time. Provide upper and lower limits for each parameter, or if you don’t want to optimize a parameter, provide a constant value of the parameter in the kwargs.
- Parameters:
coordinates (tuple[pandas.Series | numpy.ndarray, pandas.Series | numpy.ndarray, pandas.Series | numpy.ndarray]) – tuple of coordinates in the order (easting, northing, upward) for the gravity observation locations.
data (pandas.Series | numpy.ndarray) – gravity data values
n_trials (int, optional) – number of trials to run, by default 100
damping_limits (tuple[float, float], optional) – damping parameter limits, by default (0, 10**3)
depth_limits (tuple[float, float], optional) – source depth limits (positive downwards) in meters, by default (0, 10e6)
block_size_limits (tuple[float, float] | None, optional) – block size limits in meters, by default None
sampler (optuna.samplers.BaseSampler | None, optional) – specify which Optuna sampler to use, by default GPsampler
plot (bool, optional) – plot the resulting optimization figures, by default False
progressbar (bool, optional) – add a progressbar, by default True
parallel (bool, optional) – run the optimization in parallel, by default False
fname (str | None, optional) – file name to save the study to, by default None
seed (int, optional) – random seed for the samplers, by default 0
kwargs (Any) – additional keyword arguments to pass to OptimalEqSourceParams, which are passed to eq_sources_score. These can include parameters to pass to harmonica.EquivalentSources; “damping”, “depth”, “block_size”, “parallel”, and “dtype”, or parameters to pass to vd.cross_val_score; “delayed”, or “weights”.
- Return type:
- Returns:
study (optuna.study.Study) – the completed optuna study
eqs (harmonica.EquivalentSources) – the fitted equivalent sources model