verde.base.check_fit_input

Contents

verde.base.check_fit_input#

verde.base.check_fit_input(coordinates, data, weights, unpack=True)[source]#

Validate the inputs to the fit method of gridders.

Checks that the coordinates, data, and weights (if given) all have the same shape. Weights arrays are raveled.

Parameters:
coordinatestuple of arrays

Arrays with the coordinates of each data point. Should be in the following order: (easting, northing, vertical, …).

dataarray or tuple of arrays

The data values of each data point. Data can have more than one component. In such cases, data should be a tuple of arrays.

weightsNone or array

If not None, then the weights assigned to each data point. Typically, this should be 1 over the data uncertainty squared. If the data has multiple components, the weights have the same number of components.

unpackbool

If False, data and weights will be tuples always. If they are single arrays, then they will be returned as a 1-element tuple. If True, will unpack the tuples if there is only 1 array in each.

Returns:
validated_inputs

The validated inputs in the same order. If weights are given, will ravel the array before returning.