RTM GIF animation#

import numpy as np
from cherab.iter.observer import FovCamera, FoV
from cherab.iter.tools import create_rtm_gif

# === Configuration ===========================================================
view = "DIM_EP1"
fov_file = "D_alpha_DIM_EP1_case_2226.txt"
fov_data = np.loadtxt(fov_file)  # field of view data
fov = FoV(view)
camera = FovCamera(fov_data.shape, fov=fov.view["FOV"])
phi = camera.phi
theta = camera.theta
rtm = np.load("test_.npy")[0]
# rtm = np.load("RTM_%s.npy" % view)[0]  # RTM for the 1st (and only) pixel in x direction
_, nr, nz = rtm.shape
r = np.linspace(3.95, 8.55, nr + 1)
z = np.linspace(-4.65, 4.8, nz + 1)

# === create gif animation ====================================================
create_rtm_gif(r, z, rtm, phi, theta, fov_data, view)

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

Gallery generated by Sphinx-Gallery