check_orders_without_bounds¶
- sofia_redux.toolkit.resampling.check_orders_without_bounds(orders, coordinates, mask=None, required=False)[source]¶
Checks maximum order based on unique samples, irrespective of reference.
Given the
coordinates
of a sample distribution (\(X\)), and the desiredorders
of fit (\(o\)), returns the maximum available order of fit. Unlikecheck_orders_with_bounds()
, the location of the fit is unimportant. All that is required is for enough unique sample coordinates to be available for fitting.For dimension \(k\), the maximum fit order is given as:
\[o_k^{max} = min\{ |X_k| - 1, o_k \}\]where \(|.|\) represents the cardinality (size) of the set.
For example, consider a 1-dimensional set of coordinates:
\[X = [1, 1, 1, 2, 3, 4]\]The maximum order of fit would be 3 since there are 4 unique values (1, 2, 3, 4). Therefore, when
orders
>= 3, the return value would be 3. Fororders
< 3,orders
would be returned.If we had a 2-dimensional set of data:
\[X = [(1, 0), (1, 0), (1, 0), (2, 1), (3, 1), (4, 1)]\]The maximum order of fit would be 3 in the first dimension, and 1 in the second.
- Parameters:
- ordersnumpy.ndarray of int
The desired order of the fit as a (1,) or (n_dimensions,) array. If only a single value is supplied, it will be applied over all dimensions. This serves as an upper limit for the check. If the samples are distributed in a way that allows for a fit to be performed using
orders
, the return value will also beorders
.- coordinatesnumpy.ndarray (n_dimensions, n_coordinates)
The coordinates of the sample distribution.
- masknumpy.ndarray of bool (n_coordinates,), optional
An optional mask where
False
values indicate the associated sample should not be included in determining the maximum order.- requiredbool, optional
If required is
False
, the maximum available order given the distribution will be returned (up to a maximum oforders
). If required isTrue
, and the maximum available order is less thanorders
, the first element of the return value will be set to -1, indicating the criteria was not met.
- Returns:
- maximum_ordersnumpy.ndarray
An array of shape (1,) or (n_dimensions,) based on whether a single
orders
was passed in for all dimensions, or each dimension has a separate order requirement. Ifrequired
was set toTrue
, and the sample distribution did not allow for the requested order, the first element will be set to -1. Otherwise, ifrequired
wasFalse
, the maximum order for each dimension will be returned. If a singleorders
was to be applied over all dimensions, the return value will also be of size 1, but contains the min(maximum_order) over all dimensions.