Visualize Focal of view#

import numpy as np
from cherab.iter.observer import FoV
from cherab.iter.tools import plot_fov_2D

# === configuration ===========================================================
view = "DIM_EP1"
case = "2226"
fov_file = "D_4860_{}_case_{}.txt".format(view, case)
fov_data = np.loadtxt(fov_file)
fov = FoV(view)
phi_max = fov.view["FOV"][0] / 2.0
theta_max = fov.view["FOV"][1] / 2.0
nphi = fov_data.shape[0] + 1
ntheta = fov_data.shape[1] + 1
phi = np.linspace(-phi_max, phi_max, nphi, endpoint=True)
theta = np.linspace(theta_max, -theta_max, ntheta, endpoint=True)

# === Plot focal view =========================================================
plot_fov_2D(phi, theta, fov_data.T)

Total running time of the script: ( 0 minutes 0.000 seconds)

Gallery generated by Sphinx-Gallery