from cherab.core.atomic import hydrogen, deuterium, carbon, Line from cherab.core.model import SingleRayAttenuator, BeamEmissionLine, \ ExcitationLine, RecombinationLine from cherab.core.model.beam.beam_emission import SIGMA_TO_PI, SIGMA1_TO_SIGMA0, \ PI2_TO_PI3, PI4_TO_PI3 from cherab.tools.plasmas.slab import build_slab_plasma from cherab.openadas import OpenADAS ############### # Make Plasma # world = World() plasma = build_slab_plasma(width=1.0, height=3.0, peak_density=1e18, impurities=[(carbon, 6, 0.005)], parent=world) plasma.b_field = ConstantVector3D(Vector3D(0, 1.5, 0)) plasma.atomic_data = OpenADAS(permit_extrapolation=True) # add background emission d_alpha = Line(hydrogen, 0, (3, 2)) plasma.models = [ExcitationLine(d_alpha), RecombinationLine(d_alpha)] #################### # Visualise Plasma # h0 = plasma.composition.get(hydrogen, 0) h1 = plasma.composition.get(hydrogen, 1) c6 = plasma.composition.get(carbon, 6)
from raysect.optical.observer import PinholeCamera from cherab.core import Beam from cherab.core.math import sample3d from cherab.core.atomic import hydrogen, deuterium, carbon, Line from cherab.core.model import SingleRayAttenuator, BeamCXLine from cherab.tools.plasmas.slab import build_slab_plasma from cherab.openadas import OpenADAS ############### # Make Plasma # world = World() plasma = build_slab_plasma(peak_density=5e19, impurities=[(carbon, 6, 0.005)], parent=world) plasma.atomic_data = OpenADAS(permit_extrapolation=True) #################### # Visualise Plasma # h0 = plasma.composition.get(hydrogen, 0) h1 = plasma.composition.get(hydrogen, 1) c6 = plasma.composition.get(carbon, 6) # Run some plots to check the distribution functions and emission profile are as expected r, _, z, t_samples = sample3d(h1.distribution.effective_temperature, (-1, 2, 200), (0, 0, 1), (-1, 1, 200)) plt.imshow(np.transpose(np.squeeze(t_samples)), extent=[-1, 2, -1, 1]) plt.colorbar()
from raysect.optical import World from raysect.optical.observer import PinholeCamera, SightLine, PowerPipeline0D, SpectralPowerPipeline0D from cherab.core.math import ConstantVector3D from cherab.core.atomic import hydrogen, Line from cherab.tools.plasmas.slab import build_slab_plasma from renate.cherab_models import RenateBeamEmissionLine, RenateBeam world = World() # PLASMA ---------------------------------------------------------------------- plasma = build_slab_plasma(peak_density=5e19, world=world) plasma.b_field = ConstantVector3D(Vector3D(0, 0.6, 0)) # BEAM SETUP ------------------------------------------------------------------ integration_step = 0.0025 beam_transform = translate(-0.5, 0.0, 0) * rotate_basis(Vector3D(1, 0, 0), Vector3D(0, 0, 1)) line = Line(hydrogen, 0, (3, 2)) beam = RenateBeam(parent=world, transform=beam_transform) beam.plasma = plasma beam.energy = 100000 beam.power = 3e6 beam.element = hydrogen beam.temperature = 30 beam.sigma = 0.05