input, order=3, axis=-1, output=None, output_type=numarray.Float64) |
input, order=3, output=None, output_type=numarray.Float64) |
Note: The multi-dimensional filter is implemented as a sequence of one-dimensional spline filters. The intermediate arrays are stored in the same data type as the output. Therefore, if an output_type with a limited precision is requested, the results may be imprecise because intermediate results may be stored with insufficient precision. This can be prevented by specifying a output type of high precision.
input, mapping, output_shape=None, output_type=None, output=None, order=3, mode='constant', cval=0.0, prefilter=True, extra_arguments = (), extra_keywords = ) |
For example:
>>> a = arange(12, shape=(4,3), type = Float64) >>> def shift_func(output_coordinates): ... return (output_coordinates[0] - 0.5, output_coordinates[1] - 0.5) ... >>> print geometric_transform(a, shift_func) [[ 0. 0. 0. ] [ 0. 1.3625 2.7375] [ 0. 4.8125 6.1875] [ 0. 8.2625 9.6375]]
Optionally extra arguments can be defined and passed to the filter function. The extra_arguments and extra_keywords arguments can be used to pass a tuple of extra arguments and/or a dictionary of named arguments that are passed to derivative at each call. For example, we can pass the shifts in our example as arguments:
>>> def shift_func(output_coordinates, s0, s1): ... return (output_coordinates[0] - s0, output_coordinates[1] - s1) ... >>> print geometric_transform(a, shift_func, extra_arguments = (0.5, 0.5)) [[ 0. 0. 0. ] [ 0. 1.3625 2.7375] [ 0. 4.8125 6.1875] [ 0. 8.2625 9.6375]]
>>> print geometric_transform(a, shift_func, extra_keywords = {'s0': 0.5, 's1': 0.5}) [[ 0. 0. 0. ] [ 0. 1.3625 2.7375] [ 0. 4.8125 6.1875] [ 0. 8.2625 9.6375]]
Note: The mapping function can also be written in C and passed using a CObject. See 21.10 for more information.
input, coordinates, output_type=None, output=None, order=3, mode='constant', cval=0.0, prefilter=True) |
>>> a = arange(12, shape=(4,3), type = numarray.Float64) >>> print a [[ 0. 1. 2.] [ 3. 4. 5.] [ 6. 7. 8.] [ 9. 10. 11.]] >>> print map_coordinates(a, [[0.5, 2], [0.5, 1]]) [ 1.3625 7. ]
input, matrix, offset=0.0, output_shape=None, output_type=None, output=None, order=3, mode='constant', cval=0.0, prefilter=True) |
input, shift, output_type=None, output=None, order=3, mode='constant', cval=0.0, prefilter=True) |
input, zoom, output_type=None, output=None, order=3, mode='constant', cval=0.0, prefilter=True) |
input, angle, axes=(-1, -2), reshape=1, output_type=None, output=None, order=3, mode='constant', cval=0.0, prefilter=True) |
Send comments to the NumArray community.