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:
- function3d
Callable[[double,double,double],double] Python function or
Function3Dobject.- r_range
tuple[double,double,int] R-axis sampling range: \((R_\text{min}, R_\text{max}, N)\), where \(N\) is the number of samples.
- z_range
tuple[double,double,int] Z-axis sampling range: \((Z_\text{min}, Z_\text{max}, M)\), where \(M\) is the number of samples.
- phi
double,optional Toroidal angle in degree, by default 0.0 [deg].
- function3d
- 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.
- r_points(
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.]])