invert4geom.regional_misfit_uncertainty

invert4geom.regional_misfit_uncertainty#

regional_misfit_uncertainty(runs, sample_gravity=False, parameter_dict=None, region=None, plot=True, plot_region=None, true_regional=None, coast=False, weight_by=None, **kwargs)[source]#

Create a stochastic ensemble of regional gravity anomalies by sampling the constraints, gravity, or parameters within their respective distributions and calculate the cell-wise (weighted) statistics of the ensemble.

Parameters:
  • runs (int) – number of runs to perform

  • sample_gravity (bool) – choose to sample the gravity data from a normal distribution with a mean of each points value and a standard deviation set by the uncert column, by default False

  • parameter_dict (dict[str, Any] | None) – dictionary of parameters passes to regional_separation with the uncertainty distributions defined, by default None

  • region (tuple[float, float, float, float] | None) – region to calculate statistics within, by default None

  • plot (bool) – show the results, by default True

  • plot_region (tuple[float, float, float, float] | None) – clip the plot to a region, by default None

  • true_regional (DataArray | None) – if the true regional misfit is known, will make a plot comparing the results, by default None

  • coast (bool) – whether to plot coastlines, by default False

  • weight_by (str | None) – how to weight the models, by default None

  • kwargs (Any)

Return type:

tuple[Dataset, dict[str, Any]]

Returns:

  • stats_ds (xarray.Dataset) – a dataset with the cell-wise statistics of the ensemble of regional gravity

  • sampled_param_dict (dict[str, typing.Any]) – a dictionary of sampled parameter values.