@@ -27,7 +27,7 @@ def _scale_pos_axis1(y_curr, y_orig):
27
27
dy = y_orig [0 , 1 , 0 , 0 ] - y0
28
28
return ((y_curr - y0 ) / dy )
29
29
30
- def approx1 (signal , x_interpolated , method = INTERP .LINEAR , off_grid = 0.0 , x_input = None ):
30
+ def approx1 (signal , x , method = INTERP .LINEAR , off_grid = 0.0 , xp = None ):
31
31
"""
32
32
Interpolate along a single dimension.Interpolation is performed along axis 0
33
33
of the input array.
@@ -38,18 +38,18 @@ def approx1(signal, x_interpolated, method=INTERP.LINEAR, off_grid=0.0, x_input
38
38
signal: af.Array
39
39
Input signal array (signal = f(x))
40
40
41
- x_interpolated : af.Array
42
- The x-coordinates of the interpolation points. The interpolation
43
- function is queried at these set of points.
41
+ x : af.Array
42
+ The x-coordinates of the interpolation points. The interpolation
43
+ function is queried at these set of points.
44
44
45
45
method: optional: af.INTERP. default: af.INTERP.LINEAR.
46
46
Interpolation method.
47
47
48
48
off_grid: optional: scalar. default: 0.0.
49
49
The value used for positions outside the range.
50
50
51
- x_input : af.Array
52
- The x-coordinates of the input data points
51
+ xp : af.Array
52
+ The x-coordinates of the input data points
53
53
54
54
Returns
55
55
-------
@@ -67,17 +67,17 @@ def approx1(signal, x_interpolated, method=INTERP.LINEAR, off_grid=0.0, x_input
67
67
68
68
output = Array ()
69
69
70
- if (x_input is not None ):
71
- pos0 = _scale_pos_axis0 (x_interpolated , x_input )
70
+ if (xp is not None ):
71
+ pos0 = _scale_pos_axis0 (x , xp )
72
72
else :
73
- pos0 = x_interpolated
73
+ pos0 = x
74
74
75
75
safe_call (backend .get ().af_approx1 (c_pointer (output .arr ), signal .arr , pos0 .arr ,
76
76
method .value , c_float_t (off_grid )))
77
77
return output
78
78
79
- def approx2 (signal , x_interpolated , y_interpolated ,
80
- method = INTERP .LINEAR , off_grid = 0.0 , x_input = None , y_input = None
79
+ def approx2 (signal , x , y ,
80
+ method = INTERP .LINEAR , off_grid = 0.0 , xp = None , yp = None
81
81
):
82
82
"""
83
83
Interpolate along a two dimension.Interpolation is performed along axes 0 and 1
@@ -89,28 +89,28 @@ def approx2(signal, x_interpolated, y_interpolated,
89
89
signal: af.Array
90
90
Input signal array (signal = f(x, y))
91
91
92
- x_interpolated : af.Array
93
- The x-coordinates of the interpolation points. The interpolation
94
- function is queried at these set of points.
92
+ x : af.Array
93
+ The x-coordinates of the interpolation points. The interpolation
94
+ function is queried at these set of points.
95
95
96
96
97
- y_interpolated : af.Array
98
- The y-coordinates of the interpolation points. The interpolation
99
- function is queried at these set of points.
97
+ y : af.Array
98
+ The y-coordinates of the interpolation points. The interpolation
99
+ function is queried at these set of points.
100
100
101
101
method: optional: af.INTERP. default: af.INTERP.LINEAR.
102
102
Interpolation method.
103
103
104
104
off_grid: optional: scalar. default: 0.0.
105
105
The value used for positions outside the range.
106
106
107
- x_input : af.Array
108
- The x-coordinates of the input data points. The convention followed is that
109
- the x-coordinates vary along axis 0
107
+ xp : af.Array
108
+ The x-coordinates of the input data points. The convention followed is that
109
+ the x-coordinates vary along axis 0
110
110
111
- y_input : af.Array
112
- The y-coordinates of the input data points. The convention followed is that
113
- the y-coordinates vary along axis 1
111
+ yp : af.Array
112
+ The y-coordinates of the input data points. The convention followed is that
113
+ the y-coordinates vary along axis 1
114
114
115
115
Returns
116
116
-------
@@ -129,15 +129,15 @@ def approx2(signal, x_interpolated, y_interpolated,
129
129
130
130
output = Array ()
131
131
132
- if (x_input is not None ):
133
- pos0 = _scale_pos_axis0 (x_interpolated , x_input )
132
+ if (xp is not None ):
133
+ pos0 = _scale_pos_axis0 (x , xp )
134
134
else :
135
- pos0 = x_interpolated
135
+ pos0 = x
136
136
137
- if (y_input is not None ):
138
- pos1 = _scale_pos_axis1 (y_interpolated , y_input )
137
+ if (yp is not None ):
138
+ pos1 = _scale_pos_axis1 (y , yp )
139
139
else :
140
- pos1 = y_interpolated
140
+ pos1 = y
141
141
142
142
safe_call (backend .get ().af_approx2 (c_pointer (output .arr ), signal .arr ,
143
143
pos0 .arr , pos1 .arr , method .value , c_float_t (off_grid )))
0 commit comments