shaped_adaptive_weight_matrices

sofia_redux.toolkit.resampling.shaped_adaptive_weight_matrices(sigma, rchi2_values, gradient_mscp, density=None, variance_offsets=None, fixed=None)[source]

Wrapper for shaped_adaptive_weight_matrix over multiple values.

Please see shaped_adaptive_weight_matrix() for details on how the weighting kernel is modified using a scale factor and measure of the derivatives of the fitting function. This function performs the calculation for multiple scaling factors (\(\chi_r^2\)) and derivative measures.

Parameters:
sigmanumpy.ndarray (n_dimensions,)

The standard deviations of the Gaussian for each dimensional component used for the distance weighting of each sample in the initial fit.

rchi2_valuesnumpy.ndarray (n_sets, shape)

The reduced chi-squared statistics of the fit for each data set. Here, shape is an arbitrary array shape which depends upon the shape of the output fit coordinates defined by the user.

gradient_mscpnumpy.ndarray (n_sets, shape, n_dimensions, n_dimensions)

An array where gradient_mscp[i, j] = derivative[i] * derivative[j] in dimensions i and j. Please see derivative_mscp() for further information. The last two dimensions must be Hermitian and real-valued (symmetric) for each fit set/coordinate.

densitynumpy.ndarray (n_sets, shape)

The local relative density of the samples around the fit coordinate. A value of 1 represents uniform distribution. Values greater than 1 indicate clustering around the fitting point, and values less than 1 indicate that samples are sparsely distributed around the fitting point. Please see relative_density() for further information.

variance_offsetsnumpy.ndarray (n_sets, shape)

The variance at the fit coordinate determined from the sample coordinate distribution. i.e., if a fit is performed at the center of the sample distribution, the variance is zero. If done at 2-sigma from the sample distribution center, the variance is 4.

fixednumpy.ndarray of bool (n_dimensions,), optional

If supplied, True values indicate that the width of the Gaussian along the corresponding axis should not be altered in the output result.

Returns:
shape_matricesnumpy.ndarray (n_sets, shape, n_dimensions, n_dimensions)

Shape matrices defined for each set/coordinate.