sample3d_rz#

cherab.lhd.tools.samplers.sample3d_rz(function3d, r_range, z_range, phi=0.0)#

Sample a 3D function with a specified toroidal angle and a certain range of R-Z coordinates

Parameters:
function3dCallable[[double, double, double], double]

Python function or Function3D object.

r_rangetuple[double, double, int]

R-axis sampling range: \((R_\text{min}, R_\text{max}, N)\), where \(N\) is the number of samples.

z_rangetuple[double, double, int]

Z-axis sampling range: \((Z_\text{min}, Z_\text{max}, M)\), where \(M\) is the number of samples.

phidouble, optional

Toroidal angle in degree, by default 0.0 [deg].

Returns:
r_points(N, ) array_like

R-axis sample points.

z_points(M, ) array_like

Z-axis sample points.

function_samples(N, M) array_like

Sampled function values.

Examples

>>> def f1(x, y, z):
>>>     return x**3 + y**2 + z
>>>
>>> r_pts, z_pts, f_vals = sample3d_rz(f1, (1, 3, 3), (1, 3, 3), 0.0)
>>> r_pts
array([1., 2., 3.])
>>> f_vals
array([[ 2.,  3.,  4.],
       [ 9., 10., 11.],
       [28., 29., 30.]])