Skip to content

TurningBands

Turning-bands simulation conditioned by kriging; same conventions as SGS, trend and domains included.

With domains at fit, each domain is transformed on its own, as in SGS, and every domain shares the bands of a realization. A node is conditioned by kriging the residuals of the data of its domain, and of other domains within Search.soft, each of those as its grade (and trend) transformed through the node's domain; the node is back-transformed through its domain's transform.

bands property

bands

Number of lines.

n_samples property

n_samples

Number of fitted samples; None before fit.

search property

search

The conditioning search given at construction; None for the default.

variogram property

variogram

The variogram given at construction.

fit method descriptor

fit(
    coords,
    values,
    *,
    weights=None,
    holes=None,
    trend=None,
    domains=None,
    domain_column=None,
)

Takes the conditioning data. Samples sharing a location keep the first, with a warning naming their holes.

Parameters:

Name Type Description Default
coords (array_like, shape(n, 2) or (n, 3), PointSet or BlockModel)
required
values array_like, shape (n,), or str

Values, or the column of coords holding them; so for weights, holes and trend.

required
weights array_like or str

Declustering weights, for every normal score.

None
holes array_like or str

Drill-hole ids or names, for max_per_hole.

None
trend array_like or str

Trend at the data, from any model or estimator; simulate then needs the trend at the targets.

None
domains array_like or label

Domain label of each sample, or one label for all: strings, numbers or booleans. Samples sharing a location in different domains are all kept.

None
domain_column str

The column of coords holding the domains, instead of domains.

None

Raises:

Type Description
InvalidInput

If a Search.soft names a domain without samples, or has no domains to work on, or both domains and domain_column are given.

from_parquet staticmethod

from_parquet(path)

Reads to_parquet output; raises InvalidInput on another class's file or a newer format.

simulate method descriptor

simulate(
    targets,
    *,
    n=100,
    seed=0,
    cutoffs=None,
    quantiles=Ellipsis,
    tolerances=Ellipsis,
    keep=None,
    anisotropy=None,
    blocks=None,
    window=None,
    groups=None,
    trend=None,
    domains=None,
    domain_column=None,
    grade_tonnage_cutoffs=None,
    density=None,
    tonnage=None,
    categories=None,
    memory=None,
)

Summary of n realizations; same options as SGS.simulate. domains, needed when fitted with them, labels the targets, or is one label for all; a target in a domain without samples raises InvalidInput. Simulated domains, an (n, targets) array, give realization k of the grades the domains of row k; domain_column as in SGS.simulate. memory, the bytes the run may take (at least 1, default 70 % of the memory available now), holds the bands of every realization, then as many realizations at a time as fit beside them and the summary; a run whose bands or single realization do not fit raises InvalidInput. Realizations do not depend on memory. Turning bands sum stationary line processes, so anisotropy (a LocalAnisotropy) raises InvalidInput: simulate with SGS or DSS instead, which take it on any path.

simulate_to_parquet method descriptor

simulate_to_parquet(
    path,
    out,
    *,
    n=100,
    seed=0,
    cutoffs=None,
    quantiles=Ellipsis,
    keep=None,
    rows=1000000,
    domains=None,
    domain_column=None,
    trend=None,
    discretization=None,
    memory=None,
)

Summary of n realizations over the block model file path, written to out chunk by chunk with the input columns: mean, variance, p_above_<c> and mean_above_<c> per cutoff, q<p> per quantile, and realization_<k> for each realization kept with keep. The same values as simulate on the whole model, in memory bounded by rows blocks plus the bands. Returns each realization's global realization_mean and (n, cutoffs) realization_above.

Parameters:

Name Type Description Default
keep bool or sequence of int

Realizations written beside the summary as realization_<k>: none, all, or these 0-based indices.

False
domains array_like or label

Needed when fitted with them: labels of the blocks in file order, or one label for all.

None
domain_column str

Instead of domains, the column of path holding them.

None
trend str

Needed when fitted with a trend: the column of path holding it, with no nulls. A kernel trend's predict is NaN beyond four bandwidths of its data; fill those blocks first, e.g. with the mean of the data.

None
discretization tuple of int

Nodes per axis simulated in each block and averaged by volume, as simulate(model.discretize(discretization), blocks=model); default the centroid. A node takes its block's domain and trend.

None
memory int or float

Bytes the run may take, at least 1; default 70 % of the memory available now. It holds the bands and the realizations of a chunk, and with quantiles caps rows per chunk; a run that does not fit raises InvalidInput. The values do not depend on it.

None

to_parquet method descriptor

to_parquet(path)

Writes arrays as Parquet columns and parameters as JSON in the file metadata; from_parquet reads it back.

Used in