├── .coveragerc
├── .github
└── workflows
│ └── ci.yml
├── .gitignore
├── AUTHORS.md
├── CHANGELOG.md
├── CITE.md
├── LICENCE.txt
├── README.md
├── cherab
├── __init__.py
├── core
│ ├── VERSION
│ ├── __init__.pxd
│ ├── __init__.py
│ ├── atomic
│ │ ├── __init__.pxd
│ │ ├── __init__.py
│ │ ├── data
│ │ │ ├── lineshape
│ │ │ │ ├── stark
│ │ │ │ │ ├── d.json
│ │ │ │ │ ├── h.json
│ │ │ │ │ └── t.json
│ │ │ │ └── zeeman
│ │ │ │ │ └── parametrised
│ │ │ │ │ ├── b.json
│ │ │ │ │ ├── be.json
│ │ │ │ │ ├── c.json
│ │ │ │ │ ├── d.json
│ │ │ │ │ ├── h.json
│ │ │ │ │ ├── he.json
│ │ │ │ │ ├── he3.json
│ │ │ │ │ ├── n.json
│ │ │ │ │ ├── ne.json
│ │ │ │ │ └── o.json
│ │ │ └── maxwellian_free_free_gaunt_factor.json
│ │ ├── elements.pxd
│ │ ├── elements.pyx
│ │ ├── gaunt.pxd
│ │ ├── gaunt.pyx
│ │ ├── interface.pxd
│ │ ├── interface.pyx
│ │ ├── line.pxd
│ │ ├── line.pyx
│ │ ├── rates.pxd
│ │ ├── rates.pyx
│ │ ├── zeeman.pxd
│ │ └── zeeman.pyx
│ ├── beam
│ │ ├── __init__.pxd
│ │ ├── __init__.py
│ │ ├── material.pxd
│ │ ├── material.pyx
│ │ ├── model.pxd
│ │ ├── model.pyx
│ │ ├── node.pxd
│ │ └── node.pyx
│ ├── distribution.pxd
│ ├── distribution.pyx
│ ├── laser
│ │ ├── __init__.pxd
│ │ ├── __init__.py
│ │ ├── laserspectrum.pxd
│ │ ├── laserspectrum.pyx
│ │ ├── material.pxd
│ │ ├── material.pyx
│ │ ├── model.pxd
│ │ ├── model.pyx
│ │ ├── node.pxd
│ │ ├── node.pyx
│ │ ├── profile.pxd
│ │ ├── profile.pyx
│ │ └── tests
│ │ │ ├── __init__.py
│ │ │ ├── test_laser.py
│ │ │ └── test_laserspectrum.py
│ ├── math
│ │ ├── __init__.pxd
│ │ ├── __init__.py
│ │ ├── caching
│ │ │ ├── __init__.pxd
│ │ │ ├── __init__.py
│ │ │ ├── caching1d.pxd
│ │ │ ├── caching1d.pyx
│ │ │ ├── caching2d.pxd
│ │ │ ├── caching2d.pyx
│ │ │ ├── caching3d.pxd
│ │ │ ├── caching3d.pyx
│ │ │ ├── tests
│ │ │ │ ├── __init__.py
│ │ │ │ ├── test_caching1d.py
│ │ │ │ ├── test_caching2d.py
│ │ │ │ └── test_caching3d.py
│ │ │ └── utility.py
│ │ ├── clamp.pxd
│ │ ├── clamp.pyx
│ │ ├── function
│ │ │ ├── __init__.pxd
│ │ │ └── __init__.py
│ │ ├── integrators
│ │ │ ├── __init__.pxd
│ │ │ ├── __init__.py
│ │ │ ├── integrators1d.pxd
│ │ │ └── integrators1d.pyx
│ │ ├── interpolators
│ │ │ ├── __init__.pxd
│ │ │ ├── __init__.py
│ │ │ ├── interpolators1d.pxd
│ │ │ ├── interpolators1d.pyx
│ │ │ ├── interpolators2d.pxd
│ │ │ ├── interpolators2d.pyx
│ │ │ ├── interpolators3d.pxd
│ │ │ ├── interpolators3d.pyx
│ │ │ ├── tests
│ │ │ │ ├── __init__.py
│ │ │ │ ├── data_test_interpolators3d.py
│ │ │ │ ├── scripts
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── generate_interp_1d_c1.py
│ │ │ │ │ ├── generate_interp_1d_c2.py
│ │ │ │ │ ├── generate_interp_2d.py
│ │ │ │ │ └── generate_interp_3d.py
│ │ │ │ ├── test_interpolators1d.py
│ │ │ │ ├── test_interpolators2d.py
│ │ │ │ └── test_interpolators3d.py
│ │ │ ├── utility.pxd
│ │ │ └── utility.pyx
│ │ ├── mappers.pxd
│ │ ├── mappers.pyx
│ │ ├── mask.pxd
│ │ ├── mask.pyx
│ │ ├── samplers.pxd
│ │ ├── samplers.pyx
│ │ ├── slice.pxd
│ │ ├── slice.pyx
│ │ ├── tests
│ │ │ ├── __init__.py
│ │ │ ├── test_integrators.py
│ │ │ ├── test_mappers.py
│ │ │ ├── test_samplers.py
│ │ │ └── test_transform.py
│ │ └── transform
│ │ │ ├── __init__.pxd
│ │ │ ├── __init__.py
│ │ │ ├── cylindrical.pxd
│ │ │ ├── cylindrical.pyx
│ │ │ ├── periodic.pxd
│ │ │ └── periodic.pyx
│ ├── model
│ │ ├── __init__.pxd
│ │ ├── __init__.py
│ │ ├── attenuator
│ │ │ ├── __init__.pxd
│ │ │ ├── __init__.py
│ │ │ ├── singleray.pxd
│ │ │ └── singleray.pyx
│ │ ├── beam
│ │ │ ├── __init__.pxd
│ │ │ ├── __init__.py
│ │ │ ├── beam_emission.pxd
│ │ │ ├── beam_emission.pyx
│ │ │ ├── charge_exchange.pxd
│ │ │ └── charge_exchange.pyx
│ │ ├── laser
│ │ │ ├── __init__.pxd
│ │ │ ├── __init__.py
│ │ │ ├── laserspectrum.pxd
│ │ │ ├── laserspectrum.pyx
│ │ │ ├── math_functions.pxd
│ │ │ ├── math_functions.pyx
│ │ │ ├── model.pxd
│ │ │ ├── model.pyx
│ │ │ ├── profile.pxd
│ │ │ ├── profile.pyx
│ │ │ └── tests
│ │ │ │ ├── __init__.py
│ │ │ │ ├── test_laserspectrum.py
│ │ │ │ ├── test_model.py
│ │ │ │ └── test_profiles.py
│ │ ├── lineshape
│ │ │ ├── __init__.pxd
│ │ │ ├── __init__.py
│ │ │ ├── base.pxd
│ │ │ ├── base.pyx
│ │ │ ├── beam
│ │ │ │ ├── __init__.pxd
│ │ │ │ ├── __init__.py
│ │ │ │ ├── base.pxd
│ │ │ │ ├── base.pyx
│ │ │ │ ├── mse.pxd
│ │ │ │ └── mse.pyx
│ │ │ ├── doppler.pxd
│ │ │ ├── doppler.pyx
│ │ │ ├── gaussian.pxd
│ │ │ ├── gaussian.pyx
│ │ │ ├── multiplet.pxd
│ │ │ ├── multiplet.pyx
│ │ │ ├── stark.pxd
│ │ │ ├── stark.pyx
│ │ │ ├── zeeman.pxd
│ │ │ └── zeeman.pyx
│ │ └── plasma
│ │ │ ├── __init__.pxd
│ │ │ ├── __init__.py
│ │ │ ├── bremsstrahlung.pxd
│ │ │ ├── bremsstrahlung.pyx
│ │ │ ├── impact_excitation.pxd
│ │ │ ├── impact_excitation.pyx
│ │ │ ├── recombination.pxd
│ │ │ ├── recombination.pyx
│ │ │ ├── thermal_cx.pxd
│ │ │ ├── thermal_cx.pyx
│ │ │ ├── total_radiated_power.pxd
│ │ │ └── total_radiated_power.pyx
│ ├── plasma
│ │ ├── __init__.pxd
│ │ ├── __init__.py
│ │ ├── material.pxd
│ │ ├── material.pyx
│ │ ├── model.pxd
│ │ ├── model.pyx
│ │ ├── node.pxd
│ │ └── node.pyx
│ ├── species.pxd
│ ├── species.pyx
│ ├── tests
│ │ ├── __init__.py
│ │ ├── test_beam.py
│ │ ├── test_beamcxline.py
│ │ ├── test_bremsstrahlung.py
│ │ ├── test_line_emission.py
│ │ ├── test_lineshapes.py
│ │ ├── test_maxwellian.py
│ │ ├── test_species.py
│ │ └── test_total_radiated_power.py
│ └── utility
│ │ ├── __init__.pxd
│ │ ├── __init__.py
│ │ ├── constants.pxd
│ │ ├── constants.pyx
│ │ ├── conversion.py
│ │ ├── notify.py
│ │ ├── recursivedict.py
│ │ └── tests
│ │ ├── __init__.py
│ │ └── test_conversion.py
├── generomak
│ ├── __init__.py
│ ├── equilibrium
│ │ ├── __init__.py
│ │ ├── data
│ │ │ └── generomak_equilibrium.json
│ │ └── equilibrium.py
│ ├── machine
│ │ ├── __init__.py
│ │ ├── data
│ │ │ └── first_wall
│ │ │ │ ├── BottomBaffle.obj
│ │ │ │ ├── BottomDivertorFloor.obj
│ │ │ │ ├── BottomInnerVerticalTarget.obj
│ │ │ │ ├── BottomOuterVerticalTarget.obj
│ │ │ │ ├── InnerDivertorBaffle.obj
│ │ │ │ ├── InnerWallLimiter.obj
│ │ │ │ ├── OuterWallLimiter.obj
│ │ │ │ ├── TopBaffle.obj
│ │ │ │ ├── TopDivertorFloor.obj
│ │ │ │ ├── TopInnerVerticalTarget.obj
│ │ │ │ └── TopOuterVerticalTarget.obj
│ │ └── first_wall.py
│ └── plasma
│ │ ├── __init__.py
│ │ ├── data
│ │ ├── core
│ │ │ ├── carbon0.json
│ │ │ ├── carbon1.json
│ │ │ ├── carbon2.json
│ │ │ ├── carbon3.json
│ │ │ ├── carbon4.json
│ │ │ ├── carbon5.json
│ │ │ ├── carbon6.json
│ │ │ ├── electrons.json
│ │ │ ├── hydrogen0.json
│ │ │ ├── hydrogen1.json
│ │ │ └── psi_norm.json
│ │ └── edge
│ │ │ ├── carbon0.json
│ │ │ ├── carbon1.json
│ │ │ ├── carbon2.json
│ │ │ ├── carbon3.json
│ │ │ ├── carbon4.json
│ │ │ ├── carbon5.json
│ │ │ ├── carbon6.json
│ │ │ ├── electrons.json
│ │ │ ├── hydrogen0.json
│ │ │ ├── hydrogen1.json
│ │ │ └── mesh.json
│ │ └── plasma.py
├── openadas
│ ├── __init__.py
│ ├── install.py
│ ├── openadas.py
│ ├── parse
│ │ ├── __init__.py
│ │ ├── adf11.py
│ │ ├── adf12.py
│ │ ├── adf15.py
│ │ ├── adf21.py
│ │ ├── adf22.py
│ │ └── utility.py
│ ├── rates
│ │ ├── __init__.pxd
│ │ ├── __init__.py
│ │ ├── atomic.pxd
│ │ ├── atomic.pyx
│ │ ├── beam.pxd
│ │ ├── beam.pyx
│ │ ├── cx.pxd
│ │ ├── cx.pyx
│ │ ├── pec.pxd
│ │ ├── pec.pyx
│ │ ├── radiated_power.pxd
│ │ └── radiated_power.pyx
│ ├── repository
│ │ ├── __init__.py
│ │ ├── atomic.py
│ │ ├── beam
│ │ │ ├── __init__.py
│ │ │ ├── cx.py
│ │ │ ├── emission.py
│ │ │ ├── population.py
│ │ │ └── stopping.py
│ │ ├── create.py
│ │ ├── pec.py
│ │ ├── radiated_power.py
│ │ ├── utility.py
│ │ └── wavelength.py
│ └── tests
│ │ ├── __init__.py
│ │ └── test_adf11_charges.py
└── tools
│ ├── __init__.py
│ ├── emitters
│ ├── __init__.py
│ ├── radiation_function.pxd
│ └── radiation_function.pyx
│ ├── equilibrium
│ ├── __init__.py
│ ├── efit.pxd
│ ├── efit.pyx
│ ├── eqdsk.py
│ ├── example.json
│ ├── example.py
│ └── plot.py
│ ├── inversions
│ ├── __init__.py
│ ├── admt_utils.py
│ ├── lstsq.py
│ ├── nnls.py
│ ├── opencl
│ │ ├── __init__.py
│ │ ├── opencl_utils.py
│ │ ├── sart_kernels.cl
│ │ ├── sart_kernels_atomic.cl
│ │ └── sart_opencl.py
│ ├── sart.pyx
│ ├── svd.py
│ └── voxels.pyx
│ ├── observers
│ ├── __init__.py
│ ├── bolometry.py
│ ├── calcam.py
│ ├── group
│ │ ├── __init__.py
│ │ ├── base.py
│ │ ├── fibreoptic.py
│ │ ├── pixel.py
│ │ ├── plotting.py
│ │ ├── sightline.py
│ │ ├── spectroscopic.py
│ │ └── targettedpixel.py
│ ├── intersections.py
│ └── spectroscopy
│ │ ├── __init__.py
│ │ ├── base.py
│ │ ├── fibreoptic.py
│ │ └── sightline.py
│ ├── plasmas
│ ├── __init__.py
│ ├── gaussian_volume.pyx
│ ├── ionisation_balance.py
│ └── slab.pyx
│ ├── primitives
│ ├── __init__.py
│ ├── annulus_mesh.py
│ ├── axisymmetric_mesh.pxd
│ ├── axisymmetric_mesh.pyx
│ ├── toroidal_mesh.pxd
│ └── toroidal_mesh.pyx
│ ├── raytransfer
│ ├── __init__.pxd
│ ├── __init__.py
│ ├── emitters.pxd
│ ├── emitters.pyx
│ ├── pipelines.py
│ ├── raytransfer.py
│ ├── roughconductor.pxd
│ ├── roughconductor.pyx
│ └── roughmetal.py
│ ├── spectroscopy
│ ├── __init__.py
│ ├── instrument.py
│ ├── polychromator.py
│ └── spectrometer.py
│ └── tests
│ ├── __init__.py
│ ├── data
│ ├── atomic_rates_mockup
│ │ ├── ionisation
│ │ │ ├── h.json
│ │ │ ├── he.json
│ │ │ └── ne.json
│ │ ├── recombination
│ │ │ ├── h.json
│ │ │ ├── he.json
│ │ │ └── ne.json
│ │ └── thermal_cx
│ │ │ └── h
│ │ │ └── 0
│ │ │ ├── h.json
│ │ │ ├── he.json
│ │ │ └── ne.json
│ ├── geometry_matrix.npy
│ ├── receiver.npy
│ └── true_emissivity.npy
│ ├── test_admt.py
│ ├── test_ionization_balance.py
│ ├── test_observer_groups.py
│ ├── test_plasma_slabs.py
│ ├── test_raytransfer.py
│ ├── test_sart_opencl.py
│ ├── test_spectroscopic_instruments.py
│ └── test_voxels.py
├── demos
├── balmer_series.py
├── beam.py
├── emission_models
│ ├── beam_emission_spectrum.py
│ ├── bremsstrahlung.py
│ ├── charge_exchange.py
│ ├── multiplet.py
│ ├── stark_broadening.py
│ ├── stark_zeeman.py
│ ├── thermal_charge_exchange.py
│ └── zeeman_splitting.py
├── equilibrium
│ └── equilibrium.py
├── generomak
│ └── plasma
│ │ ├── plot_2d_plasma.py
│ │ ├── plot_2d_profiles.py
│ │ └── plot_core_profiles.py
├── laser
│ ├── laser_profile.py
│ ├── laser_spectrum.py
│ ├── model_seldenmatoba.py
│ └── thomson_scattering.py
├── observers
│ ├── bolometry
│ │ ├── .gitignore
│ │ ├── calculate_etendue.py
│ │ ├── camera_from_mesh_and_coordinates.py
│ │ ├── camera_from_primitives.py
│ │ ├── demo_camera_mesh.stl
│ │ ├── geometry_matrix_with_raytransfer.py
│ │ ├── geometry_matrix_with_voxels.py
│ │ ├── inversion_with_raytransfer.py
│ │ ├── inversion_with_voxels.py
│ │ ├── irvb.py
│ │ └── observe_radiation_function.py
│ └── groups.py
├── openadas
│ ├── adf15_plots.py
│ ├── beam_plasma_interaction_rates.py
│ ├── frac_abundance.py
│ └── plot_thermalxcrates.py
├── plasma-and-beam.py
├── plasmas
│ ├── analytic_plasma.py
│ ├── analytic_plasma_function_framework.py
│ ├── beam_into_slab.py
│ ├── ionisation_balance_1d.py
│ ├── ionisation_balance_2d.py
│ ├── mesh_plasma.py
│ └── slab_plasma.py
├── radiation_loads
│ ├── radiation_function.py
│ ├── symmetric_power_load.py
│ └── wall_from_polygon.py
└── ray_transfer
│ ├── 1_ray_transfer_box.py
│ ├── 2_ray_transfer_cylinder.py
│ ├── 3_ray_transfer_mask.py
│ └── 4_ray_transfer_map.py
├── dev
├── build.sh
├── build_docs.sh
├── clean.sh
├── pypi_notes.md
└── test.sh
├── docs
├── Makefile
└── source
│ ├── atomic
│ ├── atomic_data.rst
│ ├── atomic_data_interface.rst
│ ├── data_interpolators.rst
│ ├── elements_and_isotopes.rst
│ ├── emission_lines.rst
│ ├── gaunt_factors.rst
│ ├── openadas.rst
│ ├── rate_coefficients.rst
│ └── repository.rst
│ ├── available_modules.rst
│ ├── conf.py
│ ├── demonstrations
│ ├── active_spectroscopy
│ │ ├── BES_camera.png
│ │ ├── BES_sightline.png
│ │ ├── BES_spectrum_full.png
│ │ ├── BES_spectrum_zoomed.png
│ │ ├── CXS_camera.png
│ │ ├── CXS_multi_sightlines.png
│ │ ├── CXS_spectrum.png
│ │ ├── beam_bes.rst
│ │ └── beam_cxs.rst
│ ├── atomic_data
│ │ ├── D_alpha_PECs.png
│ │ ├── beam_emission_rates.png
│ │ ├── beam_plasma_interactions.rst
│ │ ├── beam_population_rates.png
│ │ ├── beam_stopping_rates.png
│ │ ├── effective_cx_rates.png
│ │ ├── fractional_abundance.png
│ │ ├── fractional_abundance.rst
│ │ ├── photon_emissivity_coefficients.rst
│ │ ├── radiated_powers.rst
│ │ └── stage_resolved_radiation.png
│ ├── bolometry
│ │ ├── bolometer_and_radiation_function.png
│ │ ├── bolometer_etendues.svg
│ │ ├── bolometer_inversion_lines_of_sight.svg
│ │ ├── bolometer_raytransfer_calculated_powers.svg
│ │ ├── bolometer_raytransfer_sensitivities.png
│ │ ├── bolometer_voxel_calculated_powers.svg
│ │ ├── bolometer_voxel_sensitivities.png
│ │ ├── calculate_etendue.rst
│ │ ├── camera_from_mesh_and_coordinates.rst
│ │ ├── camera_from_mesh_and_coordinates.svg
│ │ ├── camera_from_primitives.rst
│ │ ├── camera_from_primitives.svg
│ │ ├── dummy_camera_box.png
│ │ ├── geometry_matrix_from_voxels.rst
│ │ ├── geometry_matrix_with_raytransfer.rst
│ │ ├── inversion_with_raytransfer.rst
│ │ ├── inversion_with_raytransfer_profile.png
│ │ ├── inversion_with_voxels.rst
│ │ ├── inversion_with_voxels_profile.png
│ │ └── observing_radiation_function.rst
│ ├── demonstrations.rst
│ ├── jet_cxrs
│ │ ├── JET_CXRS_d5lines.png
│ │ ├── JET_demo_76666.py
│ │ ├── jet_demo_76666.rst
│ │ └── quickstart.rst
│ ├── line_emission
│ │ ├── balmer_series.py
│ │ ├── balmer_series_spectra.png
│ │ ├── balmer_series_spectra.rst
│ │ ├── custom_emission_model.py
│ │ ├── custom_emitter.rst
│ │ ├── mastu_bulletb_midplane_dalpha.png
│ │ ├── mastu_bulletb_midplane_dgamma.png
│ │ ├── mastu_divcam_isp_ciii_465.png
│ │ ├── mastu_divcam_sxd_dalpha.png
│ │ ├── mastu_divcam_sxd_dalpha_150_samples.png
│ │ ├── mastu_forward_cameras.rst
│ │ ├── mastu_midplane_dalpha_excitation.png
│ │ ├── ne_ray_trajectory.png
│ │ ├── normalised_emission_ray_trajectory.png
│ │ ├── poloidal_dalpha_emission.png
│ │ └── te_ray_trajectory.png
│ ├── passive_spectroscopy
│ │ ├── BalmerSeries_camera.png
│ │ ├── BalmerSeries_spectrum.png
│ │ ├── BalmerSeries_spectrum_zoomed.png
│ │ ├── balmer_series.rst
│ │ ├── multiplet.rst
│ │ ├── multiplet_spectrum.png
│ │ ├── stark_broadening.rst
│ │ ├── stark_spectrum.png
│ │ ├── stark_zeeman.rst
│ │ ├── stark_zeeman_balmer_alpha.png
│ │ ├── stark_zeeman_paschen_beta.png
│ │ ├── zeeman_spectroscopy.rst
│ │ ├── zeeman_spectrum_0deg.png
│ │ ├── zeeman_spectrum_45deg.png
│ │ └── zeeman_spectrum_90deg.png
│ ├── plasmas
│ │ ├── analytic_function_plasma.rst
│ │ ├── analytic_plasma.png
│ │ ├── analytic_plasma_slices.png
│ │ ├── beam_attenuation.png
│ │ ├── beam_density_xz.png
│ │ ├── beam_into_plasma.png
│ │ ├── beam_ion_temp.png
│ │ ├── beam_neutral_temp.png
│ │ ├── beams_into_plasmas.rst
│ │ ├── equilibrium.rst
│ │ ├── equilibrium_lcfs.png
│ │ ├── equilibrium_limiter.png
│ │ ├── equilibrium_mapped_te_xy.png
│ │ ├── equilibrium_mapped_te_xz.png
│ │ ├── equilibrium_surfaces.png
│ │ ├── mesh2d_plasma.rst
│ │ ├── mesh_for_plasma.png
│ │ ├── mesh_plasma_column.png
│ │ ├── mesh_plasma_slices.png
│ │ ├── slab_plasma.png
│ │ ├── slab_plasma.rst
│ │ └── slab_plasma_neutrals.png
│ ├── radiation_loads
│ │ ├── AUG_radiation_load.png
│ │ ├── AUG_wall_outline.png
│ │ ├── AUG_wall_zoomed.png
│ │ ├── radiation_function.png
│ │ ├── radiation_function.rst
│ │ ├── radiation_function_rz.png
│ │ ├── surface_radiation_loads.rst
│ │ ├── symmetric_power_load.png
│ │ ├── symmetric_power_load.rst
│ │ ├── symmetric_power_load_detectors.png
│ │ ├── symmetric_power_load_zoomed_detectors.png
│ │ ├── toroidal_wall.png
│ │ ├── wall_from_polygon.rst
│ │ └── wall_radiation.py
│ ├── ray_transfer
│ │ ├── ray_transfer_box.rst
│ │ ├── ray_transfer_box_demo.png
│ │ ├── ray_transfer_cylinder.rst
│ │ ├── ray_transfer_cylinder_demo.gif
│ │ ├── ray_transfer_map.rst
│ │ ├── ray_transfer_map_demo.gif
│ │ ├── ray_transfer_mask.rst
│ │ └── ray_transfer_mask_demo.gif
│ └── solps
│ │ ├── solps_plasma.rst
│ │ ├── species_narrow.png
│ │ └── species_wide.png
│ ├── figures
│ ├── CHERAB_structure.png
│ └── CHERAB_structure.svg
│ ├── governance.rst
│ ├── index.rst
│ ├── installation_and_structure.rst
│ ├── licence.rst
│ ├── math
│ ├── caching.rst
│ ├── clamp.rst
│ ├── function.rst
│ ├── interpolators.rst
│ ├── mappers.rst
│ ├── mask.rst
│ ├── math.rst
│ ├── samplers.rst
│ ├── slice.rst
│ └── transform.rst
│ ├── models
│ ├── basic_line
│ │ └── basic_line_emission.rst
│ ├── beam
│ │ ├── beam_attenuation_calculation.rst
│ │ └── beam_attenuator.rst
│ ├── bes
│ │ └── bes_model.rst
│ ├── brem
│ │ └── bremsstrahlung.rst
│ ├── custom_models.rst
│ ├── cxs
│ │ ├── atomic_data_calculation.rst
│ │ ├── charge_exchange_calculation.rst
│ │ └── cxs_model.rst
│ ├── emission_models.rst
│ ├── laser
│ │ └── laser.rst
│ ├── line_shapes
│ │ └── spectral_line_shapes.rst
│ └── radiated_power
│ │ └── radiated_power.rst
│ ├── plasmas
│ ├── beam_direction.png
│ ├── core_plasma_classes.rst
│ ├── equilibrium.rst
│ ├── equilibrium_plot.png
│ ├── laser.rst
│ ├── particle_beams.rst
│ ├── plasma_sources.rst
│ └── plasmas.rst
│ ├── static
│ └── theme_overrides.css
│ ├── tools
│ ├── materials.rst
│ ├── observers.rst
│ ├── plasmas.rst
│ ├── primitives.rst
│ ├── spectroscopy.rst
│ ├── tomography.rst
│ ├── tools.rst
│ └── utility.rst
│ └── welcome.rst
├── pyproject.toml
├── requirements.txt
└── setup.py
/.coveragerc:
--------------------------------------------------------------------------------
1 | [run]
2 | plugins = Cython.Coverage
3 | source = cherab
4 | omit = */tests/*
5 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on:
4 | push:
5 | pull_request:
6 |
7 | jobs:
8 | tests:
9 | name: Run tests
10 | runs-on: ubuntu-latest
11 | strategy:
12 | fail-fast: false
13 | matrix:
14 | numpy-version: ["oldest-supported-numpy", "'numpy<2'"]
15 | python-version: ["3.7", "3.8", "3.9", "3.10"]
16 | steps:
17 | - name: Checkout code
18 | uses: actions/checkout@v2
19 | with:
20 | fetch-depth: 0
21 | - name: Set up Python
22 | uses: actions/setup-python@v2
23 | with:
24 | python-version: ${{ matrix.python-version }}
25 | - name: Install Python dependencies
26 | run: python -m pip install --prefer-binary cython~=3.0 ${{ matrix.numpy-version }} scipy matplotlib "pyopencl[pocl]>=2022.2.4"
27 | - name: Install Raysect from pypi
28 | run: pip install raysect==0.8.1.*
29 | - name: Build cherab
30 | run: dev/build.sh
31 | - name: Run tests
32 | run: dev/test.sh
33 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.pyc
2 | *.pyo
3 | *~
4 | .\#*
5 | \#*\#
6 | .DS_Store
7 | *.so
8 | *.pyc
9 | *.pyo
10 | *~
11 | *.o
12 | *.c
13 | *.h
14 | PKG-INFO
15 | MANIFEST
16 | temp/
17 | dist/
18 | docs/build/
19 | build/
20 | .idea/
21 | .nfs*
22 | .coverage
23 | htmlcov*
24 | cherab.egg-info/
--------------------------------------------------------------------------------
/AUTHORS.md:
--------------------------------------------------------------------------------
1 | Core Team
2 | ---------
3 |
4 | * Matthew Carr (Core Developer)
5 | * Jack Lovell (Developer)
6 | * Alex Meakins (Architect/Core Developer)
7 | * Matej Tomes (Developer)
8 | * Vlad Neverov (Developer)
9 |
10 |
11 | Contributors
12 | ------------
13 |
14 | * Joseph Allcock
15 | * Alfonso Baciero
16 | * Corentin Bertrand
17 | * Andrea Callarelli
18 | * Ephrem Delabie
19 | * Carine Giroud
20 | * James Harrison
21 | * Nick Hawkes
22 | * Andy Meigs
23 |
24 |
25 | Project History
26 | ---------------
27 |
28 | Prior to the public release, large scale development was performed by the JET project team. Due to the inclusion of private intellectual property it was not possible to release the full development history of the code prior to the github release. For more information on the development of the code prior to this point, please contact the JET project.
29 |
30 |
--------------------------------------------------------------------------------
/CITE.md:
--------------------------------------------------------------------------------
1 | Citing this project in publications:
2 |
3 | Cherab does not yet have a published overview paper, one is planned in the near future.
4 | Until then you can cite "Carr, M., Meakins, A., Baciero, A., Bernert, M., Callarelli, A.,
5 | Field, A., Giroud, C., Harrison, J., Hawkes, N., Henderson, S. and Lipschultz, B.,
6 | Towards integrated data analysis of divertor diagnostics with ray-tracing. 44th EPS Conference
7 | on Plasma Physics (2017), Belfast, Northern Ireland UK."
--------------------------------------------------------------------------------
/cherab/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | __import__('pkg_resources').declare_namespace(__name__)
20 |
--------------------------------------------------------------------------------
/cherab/core/VERSION:
--------------------------------------------------------------------------------
1 | 1.5.0
2 |
--------------------------------------------------------------------------------
/cherab/core/__init__.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.core.atomic cimport *
20 | from cherab.core.species cimport *
21 | from cherab.core.plasma cimport *
22 | from cherab.core.beam cimport *
23 | from cherab.core.distribution cimport *
24 | from cherab.core.model cimport *
--------------------------------------------------------------------------------
/cherab/core/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from os import path as _path
20 | from .atomic import *
21 | from .species import *
22 | from .plasma import *
23 | from .beam import *
24 | from .distribution import *
25 | from .model import *
26 |
27 | # parse the package version number
28 | with open(_path.join(_path.dirname(__file__), 'VERSION')) as _f:
29 | __version__ = _f.read().strip()
--------------------------------------------------------------------------------
/cherab/core/atomic/__init__.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.core.atomic cimport elements
20 | from cherab.core.atomic.elements cimport Element, Isotope
21 | from cherab.core.atomic.line cimport Line
22 | from cherab.core.atomic.interface cimport AtomicData
23 | from cherab.core.atomic.rates cimport *
24 | from cherab.core.atomic.zeeman cimport ZeemanStructure
25 | from cherab.core.atomic.gaunt cimport *
26 |
27 |
--------------------------------------------------------------------------------
/cherab/core/atomic/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from . import elements
20 | from .elements import *
21 | from .line import Line
22 | from .interface import AtomicData
23 | from .rates import *
24 | from .zeeman import ZeemanStructure
25 | from .gaunt import *
26 |
--------------------------------------------------------------------------------
/cherab/core/atomic/data/lineshape/zeeman/parametrised/b.json:
--------------------------------------------------------------------------------
1 | {
2 | "4": {
3 | "6 -> 5": [
4 | 0.0083423,
5 | 2.0519,
6 | -0.2960
7 | ],
8 | "7 -> 6": [
9 | 0.0228379,
10 | 1.6546,
11 | -0.2941
12 | ],
13 | "8 -> 6": [
14 | 0.0084065,
15 | 1.8041,
16 | -0.3177
17 | ],
18 | "8 -> 7": [
19 | 0.0541883,
20 | 1.4128,
21 | -0.2966
22 | ],
23 | "9 -> 7": [
24 | 0.0190781,
25 | 1.5440,
26 | -0.3211
27 | ],
28 | "10 -> 8": [
29 | 0.0391914,
30 | 1.3569,
31 | -0.3252
32 | ]
33 | },
34 | "reference": "A. Blom and C. Jupén. Parametrisation of the Zeeman effect for hydrogen-like spectra in high-temperature plasmas. Plasma Phys. Control. Fusion 44 (2002) 1229-1241"
35 | }
--------------------------------------------------------------------------------
/cherab/core/atomic/data/lineshape/zeeman/parametrised/be.json:
--------------------------------------------------------------------------------
1 | {
2 | "3": {
3 | "5 -> 4": [
4 | 0.0060354,
5 | 2.1245,
6 | -0.3190
7 | ],
8 | "6 -> 5": [
9 | 0.0202754,
10 | 1.6538,
11 | -0.3192
12 | ],
13 | "7 -> 5": [
14 | 0.0078966,
15 | 1.7017,
16 | -0.3348
17 | ],
18 | "8 -> 6": [
19 | 0.0205025,
20 | 1.4581,
21 | -0.3450
22 | ]
23 | },
24 | "reference": "A. Blom and C. Jupén. Parametrisation of the Zeeman effect for hydrogen-like spectra in high-temperature plasmas. Plasma Phys. Control. Fusion 44 (2002) 1229-1241"
25 | }
--------------------------------------------------------------------------------
/cherab/core/atomic/data/lineshape/zeeman/parametrised/c.json:
--------------------------------------------------------------------------------
1 | {
2 | "5": {
3 | "6 -> 5": [
4 | 0.0040900,
5 | 2.4271,
6 | -0.2818
7 | ],
8 | "7 -> 6": [
9 | 0.0110398,
10 | 1.9785,
11 | -0.2816
12 | ],
13 | "8 -> 6": [
14 | 0.0040747,
15 | 2.1776,
16 | -0.3035
17 | ],
18 | "8 -> 7": [
19 | 0.0261405,
20 | 1.6689,
21 | -0.2815
22 | ],
23 | "9 -> 7": [
24 | 0.0092096,
25 | 1.8495,
26 | -0.3049
27 | ],
28 | "10 -> 8": [
29 | 0.0189020,
30 | 1.6191,
31 | -0.3078
32 | ],
33 | "11 -> 8": [
34 | 0.0110428,
35 | 1.6600,
36 | -0.3162
37 | ],
38 | "10 -> 9": [
39 | 0.0359009,
40 | 1.4464,
41 | -0.3104
42 | ]
43 | },
44 | "reference": "A. Blom and C. Jupén. Parametrisation of the Zeeman effect for hydrogen-like spectra in high-temperature plasmas. Plasma Phys. Control. Fusion 44 (2002) 1229-1241"
45 | }
--------------------------------------------------------------------------------
/cherab/core/atomic/data/lineshape/zeeman/parametrised/d.json:
--------------------------------------------------------------------------------
1 | {
2 | "0": {
3 | "3 -> 2": [
4 | 0.0402068,
5 | 0.4384,
6 | -0.5015
7 | ],
8 | "4 -> 2": [
9 | 0.0220610,
10 | 0.3702,
11 | -0.5132
12 | ]
13 | },
14 | "reference": "A. Blom and C. Jupén. Parametrisation of the Zeeman effect for hydrogen-like spectra in high-temperature plasmas. Plasma Phys. Control. Fusion 44 (2002) 1229-1241"
15 | }
--------------------------------------------------------------------------------
/cherab/core/atomic/data/lineshape/zeeman/parametrised/h.json:
--------------------------------------------------------------------------------
1 | {
2 | "0": {
3 | "3 -> 2": [
4 | 0.0402267,
5 | 0.3415,
6 | -0.5247
7 | ],
8 | "4 -> 2": [
9 | 0.0220724,
10 | 0.2837,
11 | -0.5346
12 | ]
13 | },
14 | "reference": "A. Blom and C. Jupén. Parametrisation of the Zeeman effect for hydrogen-like spectra in high-temperature plasmas. Plasma Phys. Control. Fusion 44 (2002) 1229-1241"
15 | }
--------------------------------------------------------------------------------
/cherab/core/atomic/data/lineshape/zeeman/parametrised/he.json:
--------------------------------------------------------------------------------
1 | {
2 | "1": {
3 | "4 -> 3": [
4 | 0.0205206,
5 | 1.6118,
6 | -0.4838
7 | ],
8 | "5 -> 3": [
9 | 0.0095879,
10 | 1.4294,
11 | -0.4975
12 | ],
13 | "6 -> 4": [
14 | 0.0401955,
15 | 1.0058,
16 | -0.4918
17 | ],
18 | "7 -> 4": [
19 | 0.0273521,
20 | 0.9563,
21 | -0.4981
22 | ]
23 | },
24 | "reference": "A. Blom and C. Jupén. Parametrisation of the Zeeman effect for hydrogen-like spectra in high-temperature plasmas. Plasma Phys. Control. Fusion 44 (2002) 1229-1241"
25 | }
--------------------------------------------------------------------------------
/cherab/core/atomic/data/lineshape/zeeman/parametrised/he3.json:
--------------------------------------------------------------------------------
1 | {
2 | "1": {
3 | "4 -> 3": [
4 | 0.0205200,
5 | 1.4418,
6 | -0.4892
7 | ],
8 | "5 -> 3": [
9 | 0.0095879,
10 | 1.2576,
11 | -0.5001
12 | ],
13 | "6 -> 4": [
14 | 0.0401980,
15 | 0.8976,
16 | -0.4971
17 | ],
18 | "7 -> 4": [
19 | 0.0273538,
20 | 0.8529,
21 | -0.5039
22 | ]
23 | },
24 | "reference": "A. Blom and C. Jupén. Parametrisation of the Zeeman effect for hydrogen-like spectra in high-temperature plasmas. Plasma Phys. Control. Fusion 44 (2002) 1229-1241"
25 | }
--------------------------------------------------------------------------------
/cherab/core/atomic/data/lineshape/zeeman/parametrised/n.json:
--------------------------------------------------------------------------------
1 | {
2 | "6": {
3 | "7 -> 6": [
4 | 0.0060010,
5 | 2.4789,
6 | -0.2817
7 | ],
8 | "8 -> 7": [
9 | 0.0141271,
10 | 2.0249,
11 | -0.2762
12 | ],
13 | "9 -> 8": [
14 | 0.0300127,
15 | 1.7415,
16 | -0.2753
17 | ],
18 | "10 -> 8": [
19 | 0.0102089,
20 | 1.9464,
21 | -0.2975
22 | ],
23 | "11 -> 9": [
24 | 0.0193799,
25 | 1.7133,
26 | -0.2973
27 | ]
28 | },
29 | "reference": "A. Blom and C. Jupén. Parametrisation of the Zeeman effect for hydrogen-like spectra in high-temperature plasmas. Plasma Phys. Control. Fusion 44 (2002) 1229-1241"
30 | }
--------------------------------------------------------------------------------
/cherab/core/atomic/data/lineshape/zeeman/parametrised/ne.json:
--------------------------------------------------------------------------------
1 | {
2 | "9": {
3 | "9 -> 8": [
4 | 0.0072488,
5 | 2.8838,
6 | -0.2758
7 | ],
8 | "10 -> 9": [
9 | 0.0141002,
10 | 2.4755,
11 | -0.2718
12 | ],
13 | "11 -> 9": [
14 | 0.0046673,
15 | 2.8410,
16 | -0.2917
17 | ],
18 | "11 -> 10": [
19 | 0.0257292,
20 | 2.1890,
21 | -0.2715
22 | ]
23 | },
24 | "reference": "A. Blom and C. Jupén. Parametrisation of the Zeeman effect for hydrogen-like spectra in high-temperature plasmas. Plasma Phys. Control. Fusion 44 (2002) 1229-1241"
25 | }
--------------------------------------------------------------------------------
/cherab/core/atomic/data/lineshape/zeeman/parametrised/o.json:
--------------------------------------------------------------------------------
1 | {
2 | "7": {
3 | "8 -> 7": [
4 | 0.0083081,
5 | 2.4263,
6 | -0.2747
7 | ],
8 | "9 -> 8": [
9 | 0.0176049,
10 | 2.0652,
11 | -0.2721
12 | ],
13 | "10 -> 8": [
14 | 0.0059933,
15 | 2.3445,
16 | -0.2944
17 | ],
18 | "10 -> 9": [
19 | 0.0343805,
20 | 1.8122,
21 | -0.2718
22 | ],
23 | "11 -> 9": [
24 | 0.0113640,
25 | 2.0268,
26 | -0.2911
27 | ]
28 | },
29 | "reference": "A. Blom and C. Jupén. Parametrisation of the Zeeman effect for hydrogen-like spectra in high-temperature plasmas. Plasma Phys. Control. Fusion 44 (2002) 1229-1241"
30 | }
--------------------------------------------------------------------------------
/cherab/core/atomic/elements.pxd:
--------------------------------------------------------------------------------
1 | # cython: language_level=3
2 |
3 | # Copyright 2016-2018 Euratom
4 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
5 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
6 | #
7 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
8 | # European Commission - subsequent versions of the EUPL (the "Licence");
9 | # You may not use this work except in compliance with the Licence.
10 | # You may obtain a copy of the Licence at:
11 | #
12 | # https://joinup.ec.europa.eu/software/page/eupl5
13 | #
14 | # Unless required by applicable law or agreed to in writing, software distributed
15 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
16 | # CONDITIONS OF ANY KIND, either express or implied.
17 | #
18 | # See the Licence for the specific language governing permissions and limitations
19 | # under the Licence.
20 |
21 |
22 | cdef class Element:
23 |
24 | cdef readonly:
25 | str name
26 | str symbol
27 | int atomic_number
28 | double atomic_weight
29 |
30 |
31 | cdef class Isotope(Element):
32 |
33 | cdef readonly:
34 | int mass_number
35 | Element element
--------------------------------------------------------------------------------
/cherab/core/atomic/gaunt.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2022 Euratom
2 | # Copyright 2016-2022 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2022 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.core.math cimport Function2D
20 |
21 |
22 | cdef class FreeFreeGauntFactor():
23 |
24 | cpdef double evaluate(self, double z, double temperature, double wavelength) except? -1e999
25 |
26 |
27 | cdef class InterpolatedFreeFreeGauntFactor(FreeFreeGauntFactor):
28 |
29 | cdef:
30 | readonly tuple u_range, gamma2_range
31 | readonly dict raw_data
32 | double _u_min, _u_max, _gamma2_min, _gamma2_max
33 | Function2D _gaunt_factor
34 |
35 |
36 | cdef class MaxwellianFreeFreeGauntFactor(InterpolatedFreeFreeGauntFactor):
37 |
38 | pass
39 |
40 |
--------------------------------------------------------------------------------
/cherab/core/atomic/line.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.core.atomic.elements cimport Element
20 |
21 |
22 | cdef class Line:
23 |
24 | cdef readonly:
25 | Element element
26 | int charge
27 | tuple transition
28 |
--------------------------------------------------------------------------------
/cherab/core/atomic/zeeman.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 |
20 | cdef class ZeemanStructure:
21 |
22 | cdef:
23 | list _pi_components, _sigma_plus_components, _sigma_minus_components
24 |
25 | cdef double[:, :] evaluate(self, double b, int polarisation)
26 |
27 |
--------------------------------------------------------------------------------
/cherab/core/beam/__init__.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.core.beam.node cimport Beam
20 | from cherab.core.beam.model cimport BeamModel, BeamAttenuator
21 |
--------------------------------------------------------------------------------
/cherab/core/beam/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from .node import Beam
20 | from .model import BeamModel, BeamAttenuator
21 |
--------------------------------------------------------------------------------
/cherab/core/beam/material.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from raysect.optical.material.emitter cimport InhomogeneousVolumeEmitter
20 |
21 | from cherab.core.plasma cimport Plasma
22 | from cherab.core.beam cimport Beam
23 | from cherab.core.atomic cimport AtomicData
24 |
25 |
26 | cdef class BeamMaterial(InhomogeneousVolumeEmitter):
27 |
28 | cdef:
29 | Beam _beam
30 | Plasma _plasma
31 | AtomicData _atomic_data
32 | list _models
33 |
34 |
--------------------------------------------------------------------------------
/cherab/core/beam/model.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from raysect.optical cimport Spectrum, Point3D, Vector3D
20 |
21 | from cherab.core.plasma.node cimport Plasma
22 | from cherab.core.beam.node cimport Beam
23 | from cherab.core.atomic cimport AtomicData
24 |
25 |
26 | cdef class BeamModel:
27 |
28 | cdef:
29 | Plasma _plasma
30 | Beam _beam
31 | AtomicData _atomic_data
32 |
33 | cdef object __weakref__
34 |
35 | cpdef Spectrum emission(self, Point3D beam_point, Point3D plasma_point, Vector3D beam_direction, Vector3D observation_direction, Spectrum spectrum)
36 |
37 |
38 | cdef class BeamAttenuator:
39 |
40 | cdef:
41 | readonly object notifier
42 | Plasma _plasma
43 | Beam _beam
44 | AtomicData _atomic_data
45 |
46 | cdef object __weakref__
47 |
48 | cpdef double density(self, double x, double y, double z) except? -1e999
--------------------------------------------------------------------------------
/cherab/core/distribution.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from raysect.optical cimport Vector3D
20 |
21 | from cherab.core.math cimport Function3D, VectorFunction3D
22 |
23 |
24 | cdef class DistributionFunction:
25 |
26 | cdef object notifier
27 |
28 | cdef double evaluate(self, double x, double y, double z, double vx, double vy, double vz) except? -1e999
29 |
30 | cpdef Vector3D bulk_velocity(self, double x, double y, double z)
31 |
32 | cpdef double effective_temperature(self, double x, double y, double z) except? -1e999
33 |
34 | cpdef double density(self, double x, double y, double z) except? -1e999
35 |
36 |
37 | cdef class ZeroDistribution(DistributionFunction):
38 | pass
39 |
40 |
41 | cdef class Maxwellian(DistributionFunction):
42 |
43 | cdef readonly:
44 | Function3D _density, _temperature
45 | VectorFunction3D _velocity
46 | double _atomic_mass
47 |
48 |
--------------------------------------------------------------------------------
/cherab/core/laser/__init__.pxd:
--------------------------------------------------------------------------------
1 | from cherab.core.laser.node cimport Laser
2 | from cherab.core.laser.model cimport LaserModel
3 | from cherab.core.laser.laserspectrum cimport LaserSpectrum
4 | from cherab.core.laser.profile cimport LaserProfile
--------------------------------------------------------------------------------
/cherab/core/laser/__init__.py:
--------------------------------------------------------------------------------
1 | from .node import Laser
2 | from .model import LaserModel
3 | from .laserspectrum import LaserSpectrum
4 | from .profile import LaserProfile
--------------------------------------------------------------------------------
/cherab/core/laser/material.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2021 Euratom
2 | # Copyright 2016-2021 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2021 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 |
20 | from raysect.core cimport Primitive
21 | from raysect.core.math cimport AffineMatrix3D
22 | from raysect.optical.material.emitter cimport InhomogeneousVolumeEmitter
23 |
24 | from cherab.core.laser.node cimport Laser
25 |
26 |
27 | cdef class LaserMaterial(InhomogeneousVolumeEmitter):
28 |
29 | cdef:
30 | AffineMatrix3D _laser_to_plasma, _laser_segment_to_laser_node
31 | Primitive _primitive
32 | Laser _laser
33 | list _models
34 |
35 | cdef void _cache_transforms(self)
--------------------------------------------------------------------------------
/cherab/core/laser/model.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2021 Euratom
2 | # Copyright 2016-2021 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2021 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 |
20 | from raysect.optical cimport Vector3D, Point3D
21 | from raysect.optical.spectrum cimport Spectrum
22 |
23 | from cherab.core cimport Plasma
24 | from cherab.core.laser.profile cimport LaserProfile
25 | from cherab.core.laser.laserspectrum cimport LaserSpectrum
26 |
27 |
28 | cdef class LaserModel:
29 | cdef:
30 | Plasma _plasma
31 | LaserSpectrum _laser_spectrum
32 | LaserProfile _laser_profile
33 |
34 | cpdef Spectrum emission(self, Point3D point_plasma, Vector3D observation_plasma, Point3D point_laser,
35 | Vector3D observation_laser, Spectrum spectrum)
36 |
37 | cdef object __weakref__
38 |
--------------------------------------------------------------------------------
/cherab/core/laser/profile.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2021 Euratom
2 | # Copyright 2016-2021 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2021 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 |
20 | from raysect.core.math.function.float cimport Function3D
21 | from raysect.core.math.function.vector3d cimport Function3D as VectorFunction3D
22 |
23 | from raysect.optical cimport Spectrum, Point3D, Vector3D
24 |
25 | from cherab.core.laser.node cimport Laser
26 |
27 |
28 | cdef class LaserProfile:
29 |
30 | cdef:
31 | VectorFunction3D _polarization3d, _pointing3d
32 | Function3D _energy_density3d
33 | readonly object notifier
34 |
35 | cpdef Vector3D get_pointing(self, double x, double y, double z)
36 |
37 | cpdef Vector3D get_polarization(self, double x, double y, double z)
38 |
39 | cpdef double get_energy_density(self, double x, double y, double z)
40 |
41 | cpdef list generate_geometry(self)
--------------------------------------------------------------------------------
/cherab/core/laser/tests/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/cherab/core/laser/tests/__init__.py
--------------------------------------------------------------------------------
/cherab/core/math/__init__.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from raysect.core.math.function.float cimport Blend1D, Blend2D, Blend3D
20 | from cherab.core.math.samplers cimport *
21 | from cherab.core.math.function cimport *
22 | from cherab.core.math.interpolators cimport *
23 | from cherab.core.math.caching cimport *
24 | from cherab.core.math.clamp cimport *
25 | from cherab.core.math.mappers cimport *
26 | from cherab.core.math.mask cimport *
27 | from cherab.core.math.slice cimport *
28 | from cherab.core.math.transform cimport *
29 |
--------------------------------------------------------------------------------
/cherab/core/math/caching/__init__.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.core.math.caching.caching1d cimport Caching1D
20 | from cherab.core.math.caching.caching2d cimport Caching2D
21 | from cherab.core.math.caching.caching3d cimport Caching3D
22 |
--------------------------------------------------------------------------------
/cherab/core/math/caching/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from .caching1d import Caching1D
20 | from .caching2d import Caching2D
21 | from .caching3d import Caching3D
22 |
--------------------------------------------------------------------------------
/cherab/core/math/caching/caching1d.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.core.math.function cimport Function1D
20 | from numpy cimport ndarray, int8_t
21 |
22 | cdef class Caching1D(Function1D):
23 |
24 | cdef readonly:
25 | Function1D function
26 | int no_boundary_error
27 | ndarray x_np
28 | double[::1] x_domain_view
29 | int top_index_x
30 | double x_min, x_delta_inv
31 | double data_min, data_max, data_delta, data_delta_inv
32 | double[::1] x_view, x2_view, x3_view
33 | double[::1] data_view
34 | double[:,::1] coeffs_view
35 | int8_t[::1] calculated_view
36 |
37 | cdef double evaluate(self, double px) except? -1e999
38 |
39 | cdef double _evaluate(self, double px, int i_x)
40 |
41 | cdef double _evaluate_polynomial_derivative(self, int i_x, double px, int der_x)
42 |
--------------------------------------------------------------------------------
/cherab/core/math/caching/tests/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/cherab/core/math/caching/tests/__init__.py
--------------------------------------------------------------------------------
/cherab/core/math/caching/tests/test_caching1d.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | import numpy as np
4 |
5 | from cherab.core.math.caching import Caching1D
6 |
7 |
8 | class TestCaching1D(unittest.TestCase):
9 |
10 | def setUp(self):
11 | self.function = lambda x: np.cos(10 * x)
12 | self.grad_f = lambda x: -10 * np.sin(10 * x)
13 | self.hess_f = lambda x: 100 * np.cos(10 * x)
14 | xmin, xmax = -10, 2
15 | self.space_area = xmin, xmax
16 | self.resolution = 0.1
17 |
18 | def tearDown(self):
19 | del self.function
20 | del self.grad_f
21 | del self.space_area
22 | del self.resolution
23 |
24 | def tolerance(self, x):
25 | tolerance = self.grad_f(x) * self.resolution + self.hess_f(x) * self.resolution ** 2 * 0.5
26 | return max(abs(tolerance), 0.1)
27 |
28 | def test_values(self):
29 | cached_func = Caching1D(self.function, self.space_area, self.resolution)
30 |
31 | for x in np.linspace(self.space_area[0], self.space_area[1], 100):
32 | self.assertAlmostEqual(cached_func(x), self.function(x), delta=self.tolerance(x),
33 | msg='Cached function at {} is too far from exact function!'.format(x))
34 | self.assertAlmostEqual(cached_func(x), self.function(x), delta=0.1,
35 | msg='Cached function at {} is too far from exact function!'.format(x))
36 |
37 |
38 | if __name__ == '__main__':
39 | unittest.main()
--------------------------------------------------------------------------------
/cherab/core/math/integrators/__init__.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2022 Euratom
2 | # Copyright 2016-2022 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2022 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.core.math.integrators.integrators1d cimport Integrator1D, GaussianQuadrature
20 |
21 |
--------------------------------------------------------------------------------
/cherab/core/math/integrators/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2022 Euratom
2 | # Copyright 2016-2022 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2022 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from .integrators1d import Integrator1D, GaussianQuadrature
20 |
--------------------------------------------------------------------------------
/cherab/core/math/integrators/integrators1d.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2022 Euratom
2 | # Copyright 2016-2022 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2022 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from numpy cimport ndarray
20 | from raysect.core.math.function.float cimport Function1D, Function2D
21 |
22 |
23 | cdef class Integrator1D:
24 |
25 | cdef:
26 | Function1D function
27 |
28 | cdef double evaluate(self, double a, double b) except? -1e999
29 |
30 |
31 | cdef class GaussianQuadrature(Integrator1D):
32 |
33 | cdef:
34 | int _min_order, _max_order
35 | double _rtol
36 | ndarray _roots, _weights
37 | double[:] _roots_mv, _weights_mv
38 |
39 | cdef _build_cache(self)
40 |
--------------------------------------------------------------------------------
/cherab/core/math/interpolators/__init__.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.core.math.interpolators.interpolators1d cimport Interpolate1DLinear, Interpolate1DCubic
20 | from cherab.core.math.interpolators.interpolators2d cimport Interpolate2DLinear, Interpolate2DCubic
21 | from cherab.core.math.interpolators.interpolators3d cimport Interpolate3DLinear, Interpolate3DCubic
22 |
23 |
--------------------------------------------------------------------------------
/cherab/core/math/interpolators/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from .interpolators1d import Interpolate1DLinear, Interpolate1DCubic
20 | from .interpolators2d import Interpolate2DLinear, Interpolate2DCubic
21 | from .interpolators3d import Interpolate3DLinear, Interpolate3DCubic
22 |
--------------------------------------------------------------------------------
/cherab/core/math/interpolators/tests/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
--------------------------------------------------------------------------------
/cherab/core/math/interpolators/tests/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
--------------------------------------------------------------------------------
/cherab/core/math/interpolators/utility.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | cimport cython
20 |
21 | cdef int find_index(double[::1] x_view, double v, double padding=*)
22 |
23 | cdef double[::1] derivatives_array(double v, int deriv)
24 |
25 | cdef int factorial(int n)
26 |
27 | @cython.cdivision(True)
28 | cdef inline double lerp(double x0, double x1, double y0, double y1, double x):
29 | return ((y1 - y0) / (x1 - x0)) * (x - x0) + y0
30 |
31 | cdef int factorial(int n)
32 |
--------------------------------------------------------------------------------
/cherab/core/math/mask.pxd:
--------------------------------------------------------------------------------
1 | # cython: language_level=3
2 |
3 | # Copyright 2016-2018 Euratom
4 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
5 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
6 | #
7 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
8 | # European Commission - subsequent versions of the EUPL (the "Licence");
9 | # You may not use this work except in compliance with the Licence.
10 | # You may obtain a copy of the Licence at:
11 | #
12 | # https://joinup.ec.europa.eu/software/page/eupl5
13 | #
14 | # Unless required by applicable law or agreed to in writing, software distributed
15 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
16 | # CONDITIONS OF ANY KIND, either express or implied.
17 | #
18 | # See the Licence for the specific language governing permissions and limitations
19 | # under the Licence.
20 |
21 | from cherab.core.math.function cimport Function2D, Discrete2DMesh
22 |
23 |
24 | cdef class PolygonMask2D(Function2D):
25 |
26 | cdef Discrete2DMesh _mesh
27 |
--------------------------------------------------------------------------------
/cherab/core/math/slice.pxd:
--------------------------------------------------------------------------------
1 | # cython: language_level=3
2 |
3 | # Copyright 2016-2018 Euratom
4 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
5 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
6 | #
7 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
8 | # European Commission - subsequent versions of the EUPL (the "Licence");
9 | # You may not use this work except in compliance with the Licence.
10 | # You may obtain a copy of the Licence at:
11 | #
12 | # https://joinup.ec.europa.eu/software/page/eupl5
13 | #
14 | # Unless required by applicable law or agreed to in writing, software distributed
15 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
16 | # CONDITIONS OF ANY KIND, either express or implied.
17 | #
18 | # See the Licence for the specific language governing permissions and limitations
19 | # under the Licence.
20 |
21 | from cherab.core.math.function cimport Function1D, Function2D, Function3D
22 |
23 |
24 | cdef class Slice2D(Function1D):
25 |
26 | cdef:
27 | readonly int axis
28 | readonly double value
29 | Function2D _function
30 |
31 |
32 | cdef class Slice3D(Function2D):
33 |
34 | cdef:
35 | readonly int axis
36 | readonly double value
37 | Function3D _function
--------------------------------------------------------------------------------
/cherab/core/math/tests/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/cherab/core/math/tests/__init__.py
--------------------------------------------------------------------------------
/cherab/core/math/transform/__init__.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2022 Euratom
2 | # Copyright 2016-2022 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2022 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.core.math.transform.periodic cimport *
20 | from cherab.core.math.transform.cylindrical cimport *
--------------------------------------------------------------------------------
/cherab/core/math/transform/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2022 Euratom
2 | # Copyright 2016-2022 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2022 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from .cylindrical import CylindricalTransform, VectorCylindricalTransform
20 | from .periodic import PeriodicTransform1D, PeriodicTransform2D, PeriodicTransform3D
21 | from .periodic import VectorPeriodicTransform1D, VectorPeriodicTransform2D, VectorPeriodicTransform3D
22 |
--------------------------------------------------------------------------------
/cherab/core/math/transform/cylindrical.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2022 Euratom
2 | # Copyright 2016-2022 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2022 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from raysect.core.math.function.float cimport Function3D
20 | from raysect.core.math.function.vector3d cimport Function3D as VectorFunction3D
21 |
22 |
23 | cdef class CylindricalTransform(Function3D):
24 |
25 | cdef readonly Function3D function3d
26 |
27 |
28 | cdef class VectorCylindricalTransform(VectorFunction3D):
29 |
30 | cdef readonly VectorFunction3D function3d
31 |
--------------------------------------------------------------------------------
/cherab/core/model/__init__.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.core.model.lineshape cimport *
20 | from cherab.core.model.attenuator cimport *
21 | from cherab.core.model.beam cimport *
22 | from cherab.core.model.plasma cimport *
23 |
--------------------------------------------------------------------------------
/cherab/core/model/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from .lineshape import *
20 | from .attenuator import *
21 | from .beam import *
22 | from .plasma import *
23 |
--------------------------------------------------------------------------------
/cherab/core/model/attenuator/__init__.pxd:
--------------------------------------------------------------------------------
1 | from cherab.core.model.attenuator.singleray cimport SingleRayAttenuator
2 |
--------------------------------------------------------------------------------
/cherab/core/model/attenuator/__init__.py:
--------------------------------------------------------------------------------
1 | from .singleray import SingleRayAttenuator
2 |
--------------------------------------------------------------------------------
/cherab/core/model/beam/__init__.pxd:
--------------------------------------------------------------------------------
1 | from cherab.core.model.beam.charge_exchange cimport BeamCXLine
2 | from cherab.core.model.beam.beam_emission cimport BeamEmissionLine
3 |
--------------------------------------------------------------------------------
/cherab/core/model/beam/__init__.py:
--------------------------------------------------------------------------------
1 | # cython: language_level=3
2 |
3 | # Copyright 2016-2018 Euratom
4 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
5 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
6 | #
7 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
8 | # European Commission - subsequent versions of the EUPL (the "Licence");
9 | # You may not use this work except in compliance with the Licence.
10 | # You may obtain a copy of the Licence at:
11 | #
12 | # https://joinup.ec.europa.eu/software/page/eupl5
13 | #
14 | # Unless required by applicable law or agreed to in writing, software distributed
15 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
16 | # CONDITIONS OF ANY KIND, either express or implied.
17 | #
18 | # See the Licence for the specific language governing permissions and limitations
19 | # under the Licence.
20 |
21 |
22 | from .charge_exchange import BeamCXLine
23 | from .beam_emission import BeamEmissionLine
24 |
--------------------------------------------------------------------------------
/cherab/core/model/beam/beam_emission.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 |
20 | from raysect.core.math cimport Vector3D
21 | from cherab.core cimport Line
22 | from cherab.core.math cimport Function1D, Function2D
23 | from cherab.core.beam cimport BeamModel
24 | from cherab.core.model.lineshape cimport BeamLineShapeModel
25 |
26 |
27 | cdef class BeamEmissionLine(BeamModel):
28 |
29 | cdef:
30 | Line _line
31 | double _wavelength
32 | list _rates_list
33 | BeamLineShapeModel _lineshape
34 | Function2D _sigma_to_pi
35 | Function1D _sigma1_to_sigma0, _pi2_to_pi3, _pi4_to_pi3
36 |
37 | cdef double _beam_emission_rate(self, double x, double y, double z, Vector3D beam_velocity) except? -1e999
38 |
39 | cdef int _populate_cache(self) except -1
40 |
--------------------------------------------------------------------------------
/cherab/core/model/laser/__init__.pxd:
--------------------------------------------------------------------------------
1 | from cherab.core.model.laser.laserspectrum import ConstantSpectrum, GaussianSpectrum
2 | from cherab.core.model.laser.profile import UniformEnergyDensity, ConstantAxisymmetricGaussian
3 | from cherab.core.model.laser.profile import ConstantBivariateGaussian, TrivariateGaussian, GaussianBeamAxisymmetric
4 | from cherab.core.model.laser.model import SeldenMatobaThomsonSpectrum
--------------------------------------------------------------------------------
/cherab/core/model/laser/__init__.py:
--------------------------------------------------------------------------------
1 | from .laserspectrum import ConstantSpectrum, GaussianSpectrum
2 | from .profile import UniformEnergyDensity, ConstantAxisymmetricGaussian
3 | from .profile import ConstantBivariateGaussian, TrivariateGaussian, GaussianBeamAxisymmetric
4 | from .model import SeldenMatobaThomsonSpectrum
5 |
--------------------------------------------------------------------------------
/cherab/core/model/laser/laserspectrum.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2021 Euratom
2 | # Copyright 2016-2021 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2021 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 |
20 | from cherab.core.laser cimport LaserSpectrum
21 |
22 |
23 | cdef class ConstantSpectrum(LaserSpectrum):
24 |
25 | cdef double evaluate(self, double x) except? -1e999
26 |
27 |
28 | cdef class GaussianSpectrum(LaserSpectrum):
29 |
30 | cdef:
31 | double _stddev, _recip_stddev, _normalisation, _mean
32 | double _norm_cdf
33 |
34 | cdef double evaluate(self, double x) except? -1e999
35 |
--------------------------------------------------------------------------------
/cherab/core/model/laser/tests/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/cherab/core/model/laser/tests/__init__.py
--------------------------------------------------------------------------------
/cherab/core/model/lineshape/__init__.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2023 Euratom
2 | # Copyright 2016-2023 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2023 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.core.model.lineshape.beam cimport BeamLineShapeModel, BeamEmissionMultiplet
20 | from cherab.core.model.lineshape.base cimport LineShapeModel
21 | from cherab.core.model.lineshape.doppler cimport doppler_shift, thermal_broadening
22 | from cherab.core.model.lineshape.gaussian cimport add_gaussian_line, GaussianLine
23 | from cherab.core.model.lineshape.multiplet cimport MultipletLineShape
24 | from cherab.core.model.lineshape.stark cimport StarkBroadenedLine
25 | from cherab.core.model.lineshape.zeeman cimport ZeemanLineShapeModel, ZeemanTriplet, ParametrisedZeemanTriplet, ZeemanMultiplet
26 |
--------------------------------------------------------------------------------
/cherab/core/model/lineshape/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2023 Euratom
2 | # Copyright 2016-2023 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2023 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from .beam import BeamLineShapeModel, BeamEmissionMultiplet
20 | from .base import LineShapeModel
21 | from .doppler import doppler_shift, thermal_broadening
22 | from .gaussian import add_gaussian_line, GaussianLine
23 | from .multiplet import MultipletLineShape
24 | from .stark import add_lorentzian_line, StarkBroadenedLine
25 | from .zeeman import ZeemanLineShapeModel, ZeemanTriplet, ParametrisedZeemanTriplet, ZeemanMultiplet
26 |
--------------------------------------------------------------------------------
/cherab/core/model/lineshape/base.pxd:
--------------------------------------------------------------------------------
1 | # cython: language_level=3
2 |
3 | # Copyright 2016-2023 Euratom
4 | # Copyright 2016-2023 United Kingdom Atomic Energy Authority
5 | # Copyright 2016-2023 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
6 | #
7 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
8 | # European Commission - subsequent versions of the EUPL (the "Licence");
9 | # You may not use this work except in compliance with the Licence.
10 | # You may obtain a copy of the Licence at:
11 | #
12 | # https://joinup.ec.europa.eu/software/page/eupl5
13 | #
14 | # Unless required by applicable law or agreed to in writing, software distributed
15 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
16 | # CONDITIONS OF ANY KIND, either express or implied.
17 | #
18 | # See the Licence for the specific language governing permissions and limitations
19 | # under the Licence.
20 |
21 | from raysect.optical cimport Spectrum, Point3D, Vector3D
22 | from cherab.core.atomic cimport Line
23 | from cherab.core.species cimport Species
24 | from cherab.core.plasma cimport Plasma
25 | from cherab.core.atomic cimport AtomicData
26 | from cherab.core.math.integrators cimport Integrator1D
27 |
28 |
29 | cdef class LineShapeModel:
30 |
31 | cdef:
32 | Line line
33 | double wavelength
34 | Species target_species
35 | Plasma plasma
36 | AtomicData atomic_data
37 | Integrator1D integrator
38 |
39 | cpdef Spectrum add_line(self, double radiance, Point3D point, Vector3D direction, Spectrum spectrum)
40 |
--------------------------------------------------------------------------------
/cherab/core/model/lineshape/beam/__init__.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2023 Euratom
2 | # Copyright 2016-2023 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2023 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.core.model.lineshape.beam.base cimport *
20 | from cherab.core.model.lineshape.beam.mse cimport *
21 |
--------------------------------------------------------------------------------
/cherab/core/model/lineshape/beam/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2023 Euratom
2 | # Copyright 2016-2023 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2023 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from .base import BeamLineShapeModel
20 | from .mse import BeamEmissionMultiplet
21 |
--------------------------------------------------------------------------------
/cherab/core/model/lineshape/beam/base.pxd:
--------------------------------------------------------------------------------
1 | # cython: language_level=3
2 |
3 | # Copyright 2016-2023 Euratom
4 | # Copyright 2016-2023 United Kingdom Atomic Energy Authority
5 | # Copyright 2016-2023 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
6 | #
7 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
8 | # European Commission - subsequent versions of the EUPL (the "Licence");
9 | # You may not use this work except in compliance with the Licence.
10 | # You may obtain a copy of the Licence at:
11 | #
12 | # https://joinup.ec.europa.eu/software/page/eupl5
13 | #
14 | # Unless required by applicable law or agreed to in writing, software distributed
15 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
16 | # CONDITIONS OF ANY KIND, either express or implied.
17 | #
18 | # See the Licence for the specific language governing permissions and limitations
19 | # under the Licence.
20 |
21 | from raysect.optical cimport Spectrum, Point3D, Vector3D
22 | from cherab.core.atomic cimport Line
23 | from cherab.core.beam cimport Beam
24 | from cherab.core.atomic cimport AtomicData
25 |
26 |
27 | cdef class BeamLineShapeModel:
28 |
29 | cdef:
30 |
31 | Line line
32 | double wavelength
33 | Beam beam
34 | AtomicData atomic_data
35 |
36 | cpdef Spectrum add_line(self, double radiance, Point3D beam_point, Point3D plasma_point,
37 | Vector3D beam_direction, Vector3D observation_direction, Spectrum spectrum)
38 |
--------------------------------------------------------------------------------
/cherab/core/model/lineshape/beam/mse.pxd:
--------------------------------------------------------------------------------
1 | # cython: language_level=3
2 |
3 | # Copyright 2016-2023 Euratom
4 | # Copyright 2016-2023 United Kingdom Atomic Energy Authority
5 | # Copyright 2016-2023 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
6 | #
7 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
8 | # European Commission - subsequent versions of the EUPL (the "Licence");
9 | # You may not use this work except in compliance with the Licence.
10 | # You may obtain a copy of the Licence at:
11 | #
12 | # https://joinup.ec.europa.eu/software/page/eupl5
13 | #
14 | # Unless required by applicable law or agreed to in writing, software distributed
15 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
16 | # CONDITIONS OF ANY KIND, either express or implied.
17 | #
18 | # See the Licence for the specific language governing permissions and limitations
19 | # under the Licence.
20 |
21 | from cherab.core.math cimport Function1D, Function2D
22 | from cherab.core.model.lineshape.beam.base cimport BeamLineShapeModel
23 |
24 |
25 | cdef class BeamEmissionMultiplet(BeamLineShapeModel):
26 |
27 | cdef:
28 |
29 | Function2D _sigma_to_pi
30 | Function1D _sigma1_to_sigma0, _pi2_to_pi3, _pi4_to_pi3
31 |
--------------------------------------------------------------------------------
/cherab/core/model/lineshape/doppler.pxd:
--------------------------------------------------------------------------------
1 | # cython: language_level=3
2 |
3 | # Copyright 2016-2023 Euratom
4 | # Copyright 2016-2023 United Kingdom Atomic Energy Authority
5 | # Copyright 2016-2023 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
6 | #
7 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
8 | # European Commission - subsequent versions of the EUPL (the "Licence");
9 | # You may not use this work except in compliance with the Licence.
10 | # You may obtain a copy of the Licence at:
11 | #
12 | # https://joinup.ec.europa.eu/software/page/eupl5
13 | #
14 | # Unless required by applicable law or agreed to in writing, software distributed
15 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
16 | # CONDITIONS OF ANY KIND, either express or implied.
17 | #
18 | # See the Licence for the specific language governing permissions and limitations
19 | # under the Licence.
20 |
21 | from raysect.optical cimport Vector3D
22 |
23 |
24 | cpdef double doppler_shift(double wavelength, Vector3D observation_direction, Vector3D velocity)
25 |
26 | cpdef double thermal_broadening(double wavelength, double temperature, double atomic_weight)
27 |
--------------------------------------------------------------------------------
/cherab/core/model/lineshape/gaussian.pxd:
--------------------------------------------------------------------------------
1 | # cython: language_level=3
2 |
3 | # Copyright 2016-2023 Euratom
4 | # Copyright 2016-2023 United Kingdom Atomic Energy Authority
5 | # Copyright 2016-2023 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
6 | #
7 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
8 | # European Commission - subsequent versions of the EUPL (the "Licence");
9 | # You may not use this work except in compliance with the Licence.
10 | # You may obtain a copy of the Licence at:
11 | #
12 | # https://joinup.ec.europa.eu/software/page/eupl5
13 | #
14 | # Unless required by applicable law or agreed to in writing, software distributed
15 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
16 | # CONDITIONS OF ANY KIND, either express or implied.
17 | #
18 | # See the Licence for the specific language governing permissions and limitations
19 | # under the Licence.
20 |
21 | from raysect.optical cimport Spectrum
22 | from cherab.core.model.lineshape.base cimport LineShapeModel
23 |
24 |
25 | cpdef Spectrum add_gaussian_line(double radiance, double wavelength, double sigma, Spectrum spectrum)
26 |
27 |
28 | cdef class GaussianLine(LineShapeModel):
29 | pass
30 |
--------------------------------------------------------------------------------
/cherab/core/model/lineshape/multiplet.pxd:
--------------------------------------------------------------------------------
1 | # cython: language_level=3
2 |
3 | # Copyright 2016-2023 Euratom
4 | # Copyright 2016-2023 United Kingdom Atomic Energy Authority
5 | # Copyright 2016-2023 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
6 | #
7 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
8 | # European Commission - subsequent versions of the EUPL (the "Licence");
9 | # You may not use this work except in compliance with the Licence.
10 | # You may obtain a copy of the Licence at:
11 | #
12 | # https://joinup.ec.europa.eu/software/page/eupl5
13 | #
14 | # Unless required by applicable law or agreed to in writing, software distributed
15 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
16 | # CONDITIONS OF ANY KIND, either express or implied.
17 | #
18 | # See the Licence for the specific language governing permissions and limitations
19 | # under the Licence.
20 |
21 | cimport numpy as np
22 |
23 | from cherab.core.model.lineshape.base cimport LineShapeModel
24 |
25 |
26 | cdef class MultipletLineShape(LineShapeModel):
27 |
28 | cdef:
29 | int _number_of_lines
30 | np.ndarray _multiplet
31 | double[:, ::1] _multiplet_mv
32 |
--------------------------------------------------------------------------------
/cherab/core/model/lineshape/stark.pxd:
--------------------------------------------------------------------------------
1 | # cython: language_level=3
2 |
3 | # Copyright 2016-2023 Euratom
4 | # Copyright 2016-2023 United Kingdom Atomic Energy Authority
5 | # Copyright 2016-2023 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
6 | #
7 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
8 | # European Commission - subsequent versions of the EUPL (the "Licence");
9 | # You may not use this work except in compliance with the Licence.
10 | # You may obtain a copy of the Licence at:
11 | #
12 | # https://joinup.ec.europa.eu/software/page/eupl5
13 | #
14 | # Unless required by applicable law or agreed to in writing, software distributed
15 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
16 | # CONDITIONS OF ANY KIND, either express or implied.
17 | #
18 | # See the Licence for the specific language governing permissions and limitations
19 | # under the Licence.
20 |
21 | from raysect.optical cimport Spectrum
22 | from cherab.core.math.integrators cimport Integrator1D
23 | from cherab.core.model.lineshape.zeeman cimport ZeemanLineShapeModel
24 |
25 |
26 | cpdef Spectrum add_lorentzian_line(double radiance, double wavelength, double lambda_1_2, Spectrum spectrum,
27 | Integrator1D integrator)
28 |
29 |
30 | cdef class StarkBroadenedLine(ZeemanLineShapeModel):
31 |
32 | cdef:
33 | double _aij, _bij, _cij
34 | double _fwhm_poly_coeff_gauss[7]
35 | double _fwhm_poly_coeff_lorentz[7]
36 | double _weight_poly_coeff[6]
37 |
--------------------------------------------------------------------------------
/cherab/core/model/lineshape/zeeman.pxd:
--------------------------------------------------------------------------------
1 | # cython: language_level=3
2 |
3 | # Copyright 2016-2023 Euratom
4 | # Copyright 2016-2023 United Kingdom Atomic Energy Authority
5 | # Copyright 2016-2023 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
6 | #
7 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
8 | # European Commission - subsequent versions of the EUPL (the "Licence");
9 | # You may not use this work except in compliance with the Licence.
10 | # You may obtain a copy of the Licence at:
11 | #
12 | # https://joinup.ec.europa.eu/software/page/eupl5
13 | #
14 | # Unless required by applicable law or agreed to in writing, software distributed
15 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
16 | # CONDITIONS OF ANY KIND, either express or implied.
17 | #
18 | # See the Licence for the specific language governing permissions and limitations
19 | # under the Licence.
20 |
21 | from cherab.core.atomic.zeeman cimport ZeemanStructure
22 | from cherab.core.model.lineshape.base cimport LineShapeModel
23 |
24 |
25 | cdef class ZeemanLineShapeModel(LineShapeModel):
26 |
27 | cdef double _polarisation
28 |
29 | pass
30 |
31 |
32 | cdef class ZeemanTriplet(ZeemanLineShapeModel):
33 |
34 | pass
35 |
36 |
37 | cdef class ParametrisedZeemanTriplet(ZeemanLineShapeModel):
38 |
39 | cdef double _alpha, _beta, _gamma
40 |
41 | pass
42 |
43 |
44 | cdef class ZeemanMultiplet(ZeemanLineShapeModel):
45 |
46 | cdef ZeemanStructure _zeeman_structure
47 |
48 | pass
49 |
--------------------------------------------------------------------------------
/cherab/core/model/plasma/__init__.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 |
20 | from cherab.core.model.plasma.bremsstrahlung cimport Bremsstrahlung
21 | from cherab.core.model.plasma.impact_excitation cimport ExcitationLine
22 | from cherab.core.model.plasma.recombination cimport RecombinationLine
23 | from cherab.core.model.plasma.thermal_cx cimport ThermalCXLine
24 | from cherab.core.model.plasma.total_radiated_power cimport TotalRadiatedPower
25 |
--------------------------------------------------------------------------------
/cherab/core/model/plasma/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 |
20 | from .bremsstrahlung import Bremsstrahlung
21 | from .impact_excitation import ExcitationLine
22 | from .recombination import RecombinationLine
23 | from .thermal_cx import ThermalCXLine
24 | from .total_radiated_power import TotalRadiatedPower
25 |
--------------------------------------------------------------------------------
/cherab/core/model/plasma/bremsstrahlung.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2022 Euratom
2 | # Copyright 2016-2022 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2022 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | # cython: language_level=3
20 |
21 | from numpy cimport ndarray
22 | from cherab.core.math cimport Function1D
23 | from cherab.core.math.integrators cimport Integrator1D
24 | from cherab.core.atomic cimport FreeFreeGauntFactor
25 | from cherab.core.plasma cimport PlasmaModel
26 |
27 |
28 | cdef class BremsFunction(Function1D):
29 |
30 | cdef:
31 | double ne, te
32 | FreeFreeGauntFactor gaunt_factor
33 | ndarray species_density, species_charge
34 | double[::1] species_density_mv
35 | double[::1] species_charge_mv
36 |
37 |
38 | cdef class Bremsstrahlung(PlasmaModel):
39 |
40 | cdef:
41 | BremsFunction _brems_func
42 | bint _user_provided_gaunt_factor
43 | Integrator1D _integrator
44 |
45 | cdef int _populate_cache(self) except -1
46 |
--------------------------------------------------------------------------------
/cherab/core/model/plasma/impact_excitation.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.core.atomic cimport Line, ImpactExcitationPEC
20 | from cherab.core.plasma cimport PlasmaModel
21 | from cherab.core.species cimport Species
22 | from cherab.core.model.lineshape cimport LineShapeModel
23 |
24 |
25 | cdef class ExcitationLine(PlasmaModel):
26 |
27 | cdef:
28 | Line _line
29 | double _wavelength
30 | Species _target_species
31 | ImpactExcitationPEC _rates
32 | LineShapeModel _lineshape
33 | object _lineshape_class, _lineshape_args, _lineshape_kwargs
34 |
35 | cdef int _populate_cache(self) except -1
36 |
--------------------------------------------------------------------------------
/cherab/core/model/plasma/recombination.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.core.atomic cimport Line, RecombinationPEC
20 | from cherab.core.plasma cimport PlasmaModel
21 | from cherab.core.species cimport Species
22 | from cherab.core.model.lineshape cimport LineShapeModel
23 |
24 |
25 | cdef class RecombinationLine(PlasmaModel):
26 |
27 | cdef:
28 | Line _line
29 | double _wavelength
30 | Species _target_species
31 | RecombinationPEC _rates
32 | LineShapeModel _lineshape
33 | object _lineshape_class, _lineshape_args, _lineshape_kwargs
34 |
35 | # cpdef double radiance_at(self, Point3D point, Vector3D direction)
36 |
37 | cdef int _populate_cache(self) except -1
38 |
39 |
--------------------------------------------------------------------------------
/cherab/core/model/plasma/thermal_cx.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.core.atomic cimport Line
20 | from cherab.core.plasma cimport PlasmaModel
21 | from cherab.core.species cimport Species
22 | from cherab.core.model.lineshape cimport LineShapeModel
23 |
24 |
25 | cdef class ThermalCXLine(PlasmaModel):
26 |
27 | cdef:
28 | Line _line
29 | double _wavelength
30 | Species _target_species
31 | list _rates
32 | LineShapeModel _lineshape
33 | object _lineshape_class, _lineshape_args, _lineshape_kwargs
34 |
35 | cdef int _populate_cache(self) except -1
36 |
--------------------------------------------------------------------------------
/cherab/core/model/plasma/total_radiated_power.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 |
20 | from cherab.core.atomic.elements cimport Element
21 | from cherab.core.atomic.rates cimport LineRadiationPower, ContinuumPower, CXRadiationPower
22 | from cherab.core.plasma cimport PlasmaModel
23 | from cherab.core.species cimport Species
24 |
25 |
26 | cdef class TotalRadiatedPower(PlasmaModel):
27 |
28 | cdef:
29 | bint _cache_loaded
30 | Element _element
31 | int _charge
32 | Species _line_rad_species, _recom_species
33 | list _hydrogen_species
34 | LineRadiationPower _plt_rate
35 | ContinuumPower _prb_rate
36 | CXRadiationPower _prc_rate
37 |
38 | cdef int _populate_cache(self) except -1
39 |
--------------------------------------------------------------------------------
/cherab/core/plasma/__init__.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.core.plasma.node cimport Plasma
20 | from cherab.core.plasma.model cimport PlasmaModel
21 |
--------------------------------------------------------------------------------
/cherab/core/plasma/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from .node import Plasma
20 | from .model import PlasmaModel
21 |
--------------------------------------------------------------------------------
/cherab/core/plasma/material.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from raysect.optical cimport World, Primitive, Ray, Spectrum, SpectralFunction, Point3D, Vector3D, AffineMatrix3D
20 | from raysect.optical.material.emitter cimport InhomogeneousVolumeEmitter
21 |
22 | from cherab.core.plasma cimport Plasma
23 | from cherab.core.atomic cimport AtomicData
24 |
25 |
26 | cdef class PlasmaMaterial(InhomogeneousVolumeEmitter):
27 |
28 | cdef:
29 | Plasma _plasma
30 | AtomicData _atomic_data
31 | AffineMatrix3D _local_to_plasma
32 | list _models
33 |
34 |
--------------------------------------------------------------------------------
/cherab/core/plasma/model.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from raysect.optical cimport Spectrum, Point3D, Vector3D
20 |
21 | from cherab.core.plasma.node cimport Plasma
22 | from cherab.core.atomic cimport AtomicData
23 |
24 |
25 | cdef class PlasmaModel:
26 |
27 | cdef:
28 | Plasma _plasma
29 | AtomicData _atomic_data
30 |
31 | cdef object __weakref__
32 |
33 | cpdef Spectrum emission(self, Point3D point, Vector3D direction, Spectrum spectrum)
34 |
--------------------------------------------------------------------------------
/cherab/core/species.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.core.atomic cimport Element
20 | from cherab.core.distribution cimport DistributionFunction
21 |
22 |
23 | cdef class Species:
24 |
25 | cdef readonly:
26 | Element element
27 | int charge
28 | DistributionFunction distribution
29 |
--------------------------------------------------------------------------------
/cherab/core/tests/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 |
20 |
--------------------------------------------------------------------------------
/cherab/core/utility/__init__.pxd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/cherab/core/utility/__init__.pxd
--------------------------------------------------------------------------------
/cherab/core/utility/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from .notify import Notifier
20 | from .conversion import *
21 | from .recursivedict import RecursiveDict
22 |
--------------------------------------------------------------------------------
/cherab/core/utility/constants.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2022 Euratom
2 | # Copyright 2016-2022 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2022 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from libc.math cimport M_PI
20 |
21 | cdef:
22 | double RECIP_2_PI
23 | double RECIP_4_PI
24 | double DEGREES_TO_RADIANS
25 | double RADIANS_TO_DEGREES
26 | double ATOMIC_MASS
27 | double ELEMENTARY_CHARGE
28 | double SPEED_OF_LIGHT
29 | double PLANCK_CONSTANT
30 | double HC_EV_NM
31 | double ELECTRON_CLASSICAL_RADIUS
32 | double ELECTRON_REST_MASS
33 | double RYDBERG_CONSTANT_EV
34 | double VACUUM_PERMITTIVITY
35 | double BOHR_MAGNETON
36 |
--------------------------------------------------------------------------------
/cherab/core/utility/tests/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 |
20 |
--------------------------------------------------------------------------------
/cherab/generomak/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/cherab/generomak/__init__.py
--------------------------------------------------------------------------------
/cherab/generomak/equilibrium/__init__.py:
--------------------------------------------------------------------------------
1 | from .equilibrium import load_equilibrium
--------------------------------------------------------------------------------
/cherab/generomak/equilibrium/equilibrium.py:
--------------------------------------------------------------------------------
1 | import os
2 | import json
3 |
4 | from raysect.core import Point2D
5 |
6 | from cherab.tools.equilibrium import EFITEquilibrium
7 |
8 | def load_equilibrium(file_path=None):
9 | """ Load Generomak EFITEquilibrium.
10 |
11 | :param str file_path: Path to the json equilibrium file (optional)
12 | :return: EFITEquilibrium
13 | """
14 |
15 | if file_path is None:
16 | equilibrium_folder = os.path.dirname(__file__)
17 | file_path = os.path.join(equilibrium_folder, "data/generomak_equilibrium.json")
18 |
19 | with open(file_path, "r") as fhl:
20 | equi_data = json.load(fhl)
21 |
22 | # re-create Point2D for points required by the equilibrium
23 | equi_data["magnetic_axis"] = Point2D(*equi_data["magnetic_axis"])
24 | equi_data["x_points"] = [Point2D(*equi_data["x_points"][0])]
25 | equi_data["strike_points"] = [Point2D(*equi_data["strike_points"][0]),
26 | Point2D(*equi_data["strike_points"][1])]
27 |
28 | equilibrium = EFITEquilibrium(
29 | r=equi_data["r"], z=equi_data["z"], psi_grid=equi_data["psi_grid"],
30 | psi_axis=equi_data["psi_axis"], psi_lcfs=equi_data["psi_lcfs"],
31 | magnetic_axis=equi_data["magnetic_axis"],
32 | x_points=equi_data["x_points"], strike_points=equi_data["strike_points"],
33 | f_profile=equi_data["f_profile"], q_profile=equi_data["q_profile"],
34 | b_vacuum_radius=equi_data["b_vacuum_radius"],
35 | b_vacuum_magnitude=equi_data["b_vacuum_magnitude"],
36 | lcfs_polygon=equi_data["lcfs_polygon"],
37 | limiter_polygon=equi_data["limiter_polygon"],
38 | time=equi_data["time"])
39 |
40 | return equilibrium
41 |
--------------------------------------------------------------------------------
/cherab/generomak/machine/__init__.py:
--------------------------------------------------------------------------------
1 | from .first_wall import load_first_wall
--------------------------------------------------------------------------------
/cherab/generomak/plasma/__init__.py:
--------------------------------------------------------------------------------
1 | from .plasma import get_2d_distributions, get_edge_interpolators, get_edge_plasma
2 | from .plasma import get_core_distributions, get_core_plasma
3 | from .plasma import get_full_profiles, get_plasma
4 |
--------------------------------------------------------------------------------
/cherab/openadas/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from .openadas import OpenADAS
20 | from . import install
21 | from . import repository
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/cherab/openadas/parse/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | from .adf11 import parse_adf11
3 | from .adf12 import parse_adf12
4 | from .adf15 import parse_adf15
5 | from .adf21 import parse_adf21
6 | from .adf22 import parse_adf22bmp, parse_adf22bme
7 |
--------------------------------------------------------------------------------
/cherab/openadas/rates/__init__.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.openadas.rates.beam cimport *
20 | from cherab.openadas.rates.cx cimport *
21 | from cherab.openadas.rates.pec cimport *
22 | from cherab.openadas.rates.atomic cimport *
23 | from cherab.openadas.rates.radiated_power cimport *
24 |
--------------------------------------------------------------------------------
/cherab/openadas/rates/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from .beam import *
20 | from .cx import *
21 | from .pec import *
22 | from .atomic import *
23 | from .radiated_power import *
24 |
--------------------------------------------------------------------------------
/cherab/openadas/rates/cx.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2021 Euratom
2 | # Copyright 2016-2021 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2021 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from cherab.core cimport BeamCXPEC as CoreBeamCXPEC
20 | from cherab.core.math cimport Function1D
21 |
22 |
23 | cdef class BeamCXPEC(CoreBeamCXPEC):
24 |
25 | cdef readonly:
26 | dict raw_data
27 | double wavelength
28 | Function1D _eb, _ti, _ni, _zeff, _b
29 | readonly tuple beam_energy_range
30 | readonly tuple density_range
31 | readonly tuple temperature_range
32 | readonly tuple zeff_range
33 | readonly tuple b_field_range
34 |
35 |
36 | cdef class NullBeamCXPEC(CoreBeamCXPEC):
37 | pass
38 |
--------------------------------------------------------------------------------
/cherab/openadas/repository/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from .beam import *
20 | from .pec import *
21 | from .atomic import *
22 | from .wavelength import *
23 | from .radiated_power import *
24 | from .utility import DEFAULT_REPOSITORY_PATH
25 | from .create import populate
26 |
--------------------------------------------------------------------------------
/cherab/openadas/repository/beam/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from .cx import *
20 | from .stopping import *
21 | from .population import *
22 | from .emission import *
23 |
--------------------------------------------------------------------------------
/cherab/openadas/repository/utility.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | import os
20 |
21 | """
22 | Utilities for managing the local rate repository.
23 | """
24 |
25 | DEFAULT_REPOSITORY_PATH = os.path.expanduser('~/.cherab/openadas/repository')
26 |
27 |
28 | def encode_transition(transition):
29 | """
30 | Generate a key string from a transition.
31 |
32 | Both integer and string transition descriptions are handled.
33 | """
34 |
35 | upper, lower = transition
36 |
37 | upper = str(upper).lower()
38 | lower = str(lower).lower()
39 |
40 | return '{} -> {}'.format(upper, lower)
41 |
42 |
43 | def valid_charge(element, charge):
44 | """
45 | Returns true if the element can be ionised to the specified charge state level.
46 |
47 | :param charge: Integer charge state.
48 | :return: True/False.
49 | """
50 | return charge <= element.atomic_number
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/cherab/openadas/tests/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | # Copyright 2016-2018 Euratom
3 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
4 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
5 | #
6 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
7 | # European Commission - subsequent versions of the EUPL (the "Licence");
8 | # You may not use this work except in compliance with the Licence.
9 | # You may obtain a copy of the Licence at:
10 | #
11 | # https://joinup.ec.europa.eu/software/page/eupl5
12 | #
13 | # Unless required by applicable law or agreed to in writing, software distributed
14 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
15 | # CONDITIONS OF ANY KIND, either express or implied.
16 | #
17 | # See the Licence for the specific language governing permissions and limitations
18 | # under the Licence.
19 |
--------------------------------------------------------------------------------
/cherab/tools/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 |
--------------------------------------------------------------------------------
/cherab/tools/emitters/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 |
20 | from .radiation_function import RadiationFunction
21 |
--------------------------------------------------------------------------------
/cherab/tools/emitters/radiation_function.pxd:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2022 Euratom
2 | # Copyright 2016-2022 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2022 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from raysect.optical.material.emitter cimport InhomogeneousVolumeEmitter
20 | from cherab.core.math.function cimport Function3D
21 |
22 |
23 | cdef class RadiationFunction(InhomogeneousVolumeEmitter):
24 | cdef:
25 | readonly Function3D radiation_function
26 |
--------------------------------------------------------------------------------
/cherab/tools/equilibrium/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2018 Euratom
2 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 |
20 | from .efit import EFITEquilibrium
21 | from .plot import plot_equilibrium
22 | from .eqdsk import import_eqdsk
23 | from .example import example_equilibrium
24 |
--------------------------------------------------------------------------------
/cherab/tools/equilibrium/example.py:
--------------------------------------------------------------------------------
1 |
2 | import os
3 | import json
4 | from raysect.core import Point2D
5 |
6 | from cherab.tools.equilibrium.efit import EFITEquilibrium
7 |
8 |
9 | def example_equilibrium():
10 | """
11 | Return a populated instance of the example equilibrium.
12 |
13 | .. code-block:: pycon
14 |
15 | >>> from cherab.tools.equilibrium import example_equilibrium
16 | >>> equilibrium = example_equilibrium()
17 | """
18 |
19 | directory = os.path.split(__file__)[0]
20 | example_file = os.path.join(directory, 'example.json')
21 | with open(example_file, 'r') as fh:
22 | eq_data = json.load(fh)
23 |
24 | r = eq_data['r']
25 | z = eq_data['z']
26 | psi = eq_data['psi']
27 | psi_axis = eq_data['psi_axis']
28 | psi_lcfs = eq_data['psi_lcfs']
29 | ac = eq_data['axis_coord']
30 | axis_coord = Point2D(ac[0], ac[1])
31 | xp = eq_data['x_points']
32 | x_points = [Point2D(xp[0][0], xp[0][1])]
33 | sp = eq_data['strike_points']
34 | strike_points = [Point2D(sp[0][0], sp[0][1]), Point2D(sp[1][0], sp[1][1])]
35 | f_profile = eq_data['f_profile']
36 | q_profile = eq_data['q_profile']
37 | b_vacuum_radius = eq_data['b_vacuum_radius']
38 | b_vacuum_magnitude = eq_data['b_vacuum_magnitude']
39 | lcfs_polygon = eq_data['lcfs_polygon']
40 | limiter_polygon = eq_data['limiter_polygon']
41 | time = eq_data['time']
42 |
43 | equilibrium = EFITEquilibrium(r, z, psi, psi_axis, psi_lcfs, axis_coord, x_points, strike_points,
44 | f_profile, q_profile, b_vacuum_radius, b_vacuum_magnitude,
45 | lcfs_polygon, limiter_polygon, time)
46 |
47 | return equilibrium
48 |
--------------------------------------------------------------------------------
/cherab/tools/inversions/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | # Copyright 2016-2018 Euratom
3 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
4 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
5 | #
6 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
7 | # European Commission - subsequent versions of the EUPL (the "Licence");
8 | # You may not use this work except in compliance with the Licence.
9 | # You may obtain a copy of the Licence at:
10 | #
11 | # https://joinup.ec.europa.eu/software/page/eupl5
12 | #
13 | # Unless required by applicable law or agreed to in writing, software distributed
14 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
15 | # CONDITIONS OF ANY KIND, either express or implied.
16 | #
17 | # See the Licence for the specific language governing permissions and limitations
18 | # under the Licence.
19 |
20 | from .sart import invert_sart, invert_constrained_sart
21 | from .opencl import SartOpencl
22 | from .nnls import invert_regularised_nnls
23 | from .lstsq import invert_regularised_lstsq
24 | from .svd import invert_svd
25 | from .voxels import Voxel, AxisymmetricVoxel, VoxelCollection, ToroidalVoxelGrid, UnityVoxelEmitter
26 | from .admt_utils import generate_derivative_operators, calculate_admt
27 |
--------------------------------------------------------------------------------
/cherab/tools/inversions/opencl/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Copyright 2016-2018 Euratom
3 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
4 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
5 | #
6 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
7 | # European Commission - subsequent versions of the EUPL (the "Licence");
8 | # You may not use this work except in compliance with the Licence.
9 | # You may obtain a copy of the Licence at:
10 | #
11 | # https://joinup.ec.europa.eu/software/page/eupl5
12 | #
13 | # Unless required by applicable law or agreed to in writing, software distributed
14 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
15 | # CONDITIONS OF ANY KIND, either express or implied.
16 | #
17 | # See the Licence for the specific language governing permissions and limitations
18 | # under the Licence.
19 |
20 | from .sart_opencl import SartOpencl
21 | from .opencl_utils import *
22 |
--------------------------------------------------------------------------------
/cherab/tools/observers/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | # Copyright 2016-2018 Euratom
3 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
4 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
5 | #
6 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
7 | # European Commission - subsequent versions of the EUPL (the "Licence");
8 | # You may not use this work except in compliance with the Licence.
9 | # You may obtain a copy of the Licence at:
10 | #
11 | # https://joinup.ec.europa.eu/software/page/eupl5
12 | #
13 | # Unless required by applicable law or agreed to in writing, software distributed
14 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
15 | # CONDITIONS OF ANY KIND, either express or implied.
16 | #
17 | # See the Licence for the specific language governing permissions and limitations
18 | # under the Licence.
19 |
20 | from .bolometry import BolometerCamera, BolometerFoil, BolometerSlit, BolometerIRVB
21 | from .calcam import load_calcam_calibration
22 | from .intersections import find_wall_intersection
23 | from .spectroscopy import SpectroscopicSightLine, SpectroscopicFibreOptic
24 | from .group import PixelGroup, TargettedPixelGroup, SightLineGroup, FibreOpticGroup, SpectroscopicFibreOpticGroup, SpectroscopicSightLineGroup
25 |
--------------------------------------------------------------------------------
/cherab/tools/observers/group/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2021 Euratom
2 | # Copyright 2016-2021 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2021 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from .fibreoptic import FibreOpticGroup
20 | from .sightline import SightLineGroup
21 | from .targettedpixel import TargettedPixelGroup
22 | from .pixel import PixelGroup
23 | from .spectroscopic import SpectroscopicFibreOpticGroup, SpectroscopicSightLineGroup
24 |
--------------------------------------------------------------------------------
/cherab/tools/observers/intersections.py:
--------------------------------------------------------------------------------
1 |
2 | # Copyright 2016-2018 Euratom
3 | # Copyright 2016-2018 United Kingdom Atomic Energy Authority
4 | # Copyright 2016-2018 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
5 | #
6 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
7 | # European Commission - subsequent versions of the EUPL (the "Licence");
8 | # You may not use this work except in compliance with the Licence.
9 | # You may obtain a copy of the Licence at:
10 | #
11 | # https://joinup.ec.europa.eu/software/page/eupl5
12 | #
13 | # Unless required by applicable law or agreed to in writing, software distributed
14 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
15 | # CONDITIONS OF ANY KIND, either express or implied.
16 | #
17 | # See the Licence for the specific language governing permissions and limitations
18 | # under the Licence.
19 |
20 | from raysect.core.ray import Ray as CoreRay
21 | from raysect.optical.material.material import NullMaterial
22 |
23 |
24 | def find_wall_intersection(world, centre_point, sightline_vec, delta=1E-3):
25 |
26 | while True:
27 |
28 | # Find the next intersection point of the ray with the world
29 | intersection = world.hit(CoreRay(centre_point, sightline_vec))
30 |
31 | if intersection is None:
32 | raise ValueError('No intersection with solid material found.')
33 |
34 | elif isinstance(intersection.primitive.material, NullMaterial):
35 | centre_point += sightline_vec * delta
36 | continue
37 |
38 | else:
39 | hit_point = intersection.hit_point.transform(intersection.primitive_to_world)
40 | return hit_point, intersection.primitive
41 |
--------------------------------------------------------------------------------
/cherab/tools/observers/spectroscopy/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | # Copyright 2016-2021 Euratom
3 | # Copyright 2016-2021 United Kingdom Atomic Energy Authority
4 | # Copyright 2016-2021 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
5 | #
6 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
7 | # European Commission - subsequent versions of the EUPL (the "Licence");
8 | # You may not use this work except in compliance with the Licence.
9 | # You may obtain a copy of the Licence at:
10 | #
11 | # https://joinup.ec.europa.eu/software/page/eupl5
12 | #
13 | # Unless required by applicable law or agreed to in writing, software distributed
14 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
15 | # CONDITIONS OF ANY KIND, either express or implied.
16 | #
17 | # See the Licence for the specific language governing permissions and limitations
18 | # under the Licence.
19 |
20 | from .fibreoptic import SpectroscopicFibreOptic
21 | from .sightline import SpectroscopicSightLine
22 |
--------------------------------------------------------------------------------
/cherab/tools/plasmas/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | from .slab import build_slab_plasma
3 | from .gaussian_volume import GaussianVolume
4 |
--------------------------------------------------------------------------------
/cherab/tools/primitives/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016-2022 Euratom
2 | # Copyright 2016-2022 United Kingdom Atomic Energy Authority
3 | # Copyright 2016-2022 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
4 | #
5 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
6 | # European Commission - subsequent versions of the EUPL (the "Licence");
7 | # You may not use this work except in compliance with the Licence.
8 | # You may obtain a copy of the Licence at:
9 | #
10 | # https://joinup.ec.europa.eu/software/page/eupl5
11 | #
12 | # Unless required by applicable law or agreed to in writing, software distributed
13 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
14 | # CONDITIONS OF ANY KIND, either express or implied.
15 | #
16 | # See the Licence for the specific language governing permissions and limitations
17 | # under the Licence.
18 |
19 | from .annulus_mesh import generate_annulus_mesh_segments
20 | from .toroidal_mesh import toroidal_mesh_from_polygon
21 | from .axisymmetric_mesh import axisymmetric_mesh_from_polygon
22 |
--------------------------------------------------------------------------------
/cherab/tools/primitives/axisymmetric_mesh.pxd:
--------------------------------------------------------------------------------
1 |
2 | # Copyright 2016-2022 Euratom
3 | # Copyright 2016-2022 United Kingdom Atomic Energy Authority
4 | # Copyright 2016-2022 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
5 | #
6 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
7 | # European Commission - subsequent versions of the EUPL (the "Licence");
8 | # You may not use this work except in compliance with the Licence.
9 | # You may obtain a copy of the Licence at:
10 | #
11 | # https://joinup.ec.europa.eu/software/page/eupl5
12 | #
13 | # Unless required by applicable law or agreed to in writing, software distributed
14 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
15 | # CONDITIONS OF ANY KIND, either express or implied.
16 | #
17 | # See the Licence for the specific language governing permissions and limitations
18 | # under the Licence.
19 |
20 | from raysect.primitive.mesh cimport Mesh
21 |
22 | cpdef Mesh axisymmetric_mesh_from_polygon(object polygon, int num_toroidal_segments=*)
23 |
--------------------------------------------------------------------------------
/cherab/tools/primitives/toroidal_mesh.pxd:
--------------------------------------------------------------------------------
1 |
2 | # Copyright 2016-2022 Euratom
3 | # Copyright 2016-2022 United Kingdom Atomic Energy Authority
4 | # Copyright 2016-2022 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
5 | #
6 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
7 | # European Commission - subsequent versions of the EUPL (the "Licence");
8 | # You may not use this work except in compliance with the Licence.
9 | # You may obtain a copy of the Licence at:
10 | #
11 | # https://joinup.ec.europa.eu/software/page/eupl5
12 | #
13 | # Unless required by applicable law or agreed to in writing, software distributed
14 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
15 | # CONDITIONS OF ANY KIND, either express or implied.
16 | #
17 | # See the Licence for the specific language governing permissions and limitations
18 | # under the Licence.
19 |
20 | from raysect.primitive.mesh cimport Mesh
21 |
22 | cpdef Mesh toroidal_mesh_from_polygon(object polygon, double toroidal_extent, object polygon_triangles=*, int num_toroidal_segments=*)
23 |
--------------------------------------------------------------------------------
/cherab/tools/raytransfer/__init__.pxd:
--------------------------------------------------------------------------------
1 | from cherab.tools.raytransfer.emitters cimport *
2 |
--------------------------------------------------------------------------------
/cherab/tools/raytransfer/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from .emitters import *
3 | from .roughconductor import *
4 | from .roughmetal import *
5 | from .pipelines import *
6 | from .raytransfer import *
7 |
--------------------------------------------------------------------------------
/cherab/tools/raytransfer/roughconductor.pxd:
--------------------------------------------------------------------------------
1 | from raysect.optical cimport SpectralFunction
2 | from raysect.optical.material cimport RoughConductor
3 | from raysect.optical cimport Vector3D, Spectrum
4 |
5 |
6 | cdef class RToptimisedRoughConductor(RoughConductor):
7 |
8 | cdef double _d(self, Vector3D s_half)
9 |
10 | cdef double _g(self, Vector3D s_incoming, Vector3D s_outgoing)
11 |
12 | cdef double _g1(self, Vector3D v)
13 |
14 | cdef double _fresnel_conductor(self, double ci, double n, double k) nogil
15 |
--------------------------------------------------------------------------------
/cherab/tools/spectroscopy/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | # Copyright 2016-2021 Euratom
3 | # Copyright 2016-2021 United Kingdom Atomic Energy Authority
4 | # Copyright 2016-2021 Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas
5 | #
6 | # Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the
7 | # European Commission - subsequent versions of the EUPL (the "Licence");
8 | # You may not use this work except in compliance with the Licence.
9 | # You may obtain a copy of the Licence at:
10 | #
11 | # https://joinup.ec.europa.eu/software/page/eupl5
12 | #
13 | # Unless required by applicable law or agreed to in writing, software distributed
14 | # under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
15 | # CONDITIONS OF ANY KIND, either express or implied.
16 | #
17 | # See the Licence for the specific language governing permissions and limitations
18 | # under the Licence.
19 |
20 | from .instrument import SpectroscopicInstrument
21 | from .polychromator import PolychromatorFilter, TrapezoidalFilter, Polychromator
22 | from .spectrometer import Spectrometer, CzernyTurnerSpectrometer
23 |
--------------------------------------------------------------------------------
/cherab/tools/tests/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/cherab/tools/tests/__init__.py
--------------------------------------------------------------------------------
/cherab/tools/tests/data/atomic_rates_mockup/ionisation/h.json:
--------------------------------------------------------------------------------
1 | {
2 | "0": {
3 | "ne": [
4 | 1.0e+15,
5 | 1.0e+16,
6 | 1.0e+17,
7 | 1.0e+18,
8 | 1.0e+19,
9 | 1.0e+20,
10 | 1.0e+21
11 | ],
12 | "rate": [
13 | [
14 | 1.0e-43,
15 | 1.0e-20,
16 | 1.0e-14,
17 | 3.0e-14,
18 | 2.0e-14,
19 | 1.0e-14
20 | ],
21 | [
22 | 1.2e-43,
23 | 1.2e-20,
24 | 1.2e-14,
25 | 3.2e-14,
26 | 2.2e-14,
27 | 1.2e-14
28 | ],
29 | [
30 | 1.4e-43,
31 | 1.4e-20,
32 | 1.4e-14,
33 | 3.4e-14,
34 | 2.4e-14,
35 | 1.4e-14
36 | ],
37 | [
38 | 1.8e-43,
39 | 1.8e-20,
40 | 1.8e-14,
41 | 3.8e-14,
42 | 2.8e-14,
43 | 1.8e-14
44 | ],
45 | [
46 | 2.0e-43,
47 | 2.0e-20,
48 | 2.0e-14,
49 | 4.0e-14,
50 | 3.0e-14,
51 | 2.0e-14
52 | ],
53 | [
54 | 2.4e-43,
55 | 2.4e-20,
56 | 2.4e-14,
57 | 4.4e-14,
58 | 3.4e-14,
59 | 2.4e-14
60 | ],
61 | [
62 | 2.4e-43,
63 | 2.4e-20,
64 | 2.4e-14,
65 | 4.4e-14,
66 | 3.4e-14,
67 | 2.4e-14
68 | ]
69 | ],
70 | "te": [
71 | 0.1,
72 | 1,
73 | 10.0,
74 | 100.0,
75 | 1000.0,
76 | 10000.0
77 | ]
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/cherab/tools/tests/data/atomic_rates_mockup/recombination/h.json:
--------------------------------------------------------------------------------
1 | {
2 | "1": {
3 | "ne": [
4 | 1.0e+15,
5 | 1.0e+16,
6 | 1.0e+17,
7 | 1.0e+18,
8 | 1.0e+19,
9 | 1.0e+20,
10 | 1.0e+21
11 | ],
12 | "rate": [
13 | [
14 | 1.0e-18,
15 | 1.0e-19,
16 | 1.0e-20,
17 | 1.0e-21,
18 | 1.0e-22,
19 | 1.0e-23
20 | ],
21 | [
22 | 1.5e-18,
23 | 1.5e-19,
24 | 1.5e-20,
25 | 1.5e-21,
26 | 1.5e-22,
27 | 1.5e-23
28 | ],
29 | [
30 | 2.0e-18,
31 | 2.0e-19,
32 | 2.0e-20,
33 | 2.0e-21,
34 | 2.0e-22,
35 | 2.0e-23
36 | ],
37 | [
38 | 2.5e-18,
39 | 2.5e-19,
40 | 2.5e-20,
41 | 2.5e-21,
42 | 2.5e-22,
43 | 2.5e-23
44 | ],
45 | [
46 | 3.0e-18,
47 | 3.0e-19,
48 | 3.0e-20,
49 | 3.0e-21,
50 | 3.0e-22,
51 | 3.0e-23
52 | ],
53 | [
54 | 3.5e-18,
55 | 3.5e-19,
56 | 3.5e-20,
57 | 3.5e-21,
58 | 3.5e-22,
59 | 3.5e-23
60 | ],
61 | [
62 | 4.5e-18,
63 | 4.5e-19,
64 | 4.5e-20,
65 | 4.5e-21,
66 | 4.5e-22,
67 | 4.5e-23
68 | ]
69 | ],
70 | "te": [
71 | 0.1,
72 | 1,
73 | 10.0,
74 | 100.0,
75 | 1000.0,
76 | 10000.0
77 | ]
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/cherab/tools/tests/data/atomic_rates_mockup/thermal_cx/h/0/h.json:
--------------------------------------------------------------------------------
1 | {
2 | "1": {
3 | "ne": [
4 | 1.0e+15,
5 | 1.0e+16,
6 | 1.0e+17,
7 | 1.0e+18,
8 | 1.0e+19,
9 | 1.0e+20,
10 | 1.0e+21
11 | ],
12 | "rate": [
13 | [
14 | 5.0e-15,
15 | 7.5e-15,
16 | 1.0e-14,
17 | 2.5e-14,
18 | 5.0e-14,
19 | 1.0e-13
20 | ],
21 | [
22 | 5.0e-15,
23 | 7.5e-15,
24 | 1.0e-14,
25 | 2.5e-14,
26 | 5.0e-14,
27 | 1.0e-13
28 | ],
29 | [
30 | 5.0e-15,
31 | 7.5e-15,
32 | 1.0e-14,
33 | 2.5e-14,
34 | 5.0e-14,
35 | 1.0e-13
36 | ],
37 | [
38 | 5.0e-15,
39 | 7.5e-15,
40 | 1.0e-14,
41 | 2.5e-14,
42 | 5.0e-14,
43 | 1.0e-13
44 | ],
45 | [
46 | 5.0e-15,
47 | 7.5e-15,
48 | 1.0e-14,
49 | 2.5e-14,
50 | 5.0e-14,
51 | 1.0e-13
52 | ],
53 | [
54 | 5.0e-15,
55 | 7.5e-15,
56 | 1.0e-14,
57 | 2.5e-14,
58 | 5.0e-14,
59 | 1.0e-13
60 | ],
61 | [
62 | 5.0e-15,
63 | 7.5e-15,
64 | 1.0e-14,
65 | 2.5e-14,
66 | 5.0e-14,
67 | 1.0e-13
68 | ]
69 | ],
70 | "te": [
71 | 0.1,
72 | 1,
73 | 10.0,
74 | 100.0,
75 | 1000.0,
76 | 10000.0
77 | ]
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/cherab/tools/tests/data/geometry_matrix.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/cherab/tools/tests/data/geometry_matrix.npy
--------------------------------------------------------------------------------
/cherab/tools/tests/data/receiver.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/cherab/tools/tests/data/receiver.npy
--------------------------------------------------------------------------------
/cherab/tools/tests/data/true_emissivity.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/cherab/tools/tests/data/true_emissivity.npy
--------------------------------------------------------------------------------
/demos/laser/laser_spectrum.py:
--------------------------------------------------------------------------------
1 | from cherab.core.model.laser import ConstantSpectrum, GaussianSpectrum
2 |
3 | import matplotlib.pyplot as plt
4 |
5 |
6 | # construct a ConstantSpectrum with 10 spectral bins
7 | constant_wide = ConstantSpectrum(min_wavelength=1059.9, max_wavelength=1060.1, bins=10)
8 |
9 | # plot the power_spectral_density attribute of the laser
10 | _, ax = plt.subplots()
11 | ax.plot(constant_wide.wavelengths, constant_wide.power_spectral_density)
12 |
13 | ax.set_xlabel("Wavelength [nm]")
14 | ax.set_ylabel("W / nm")
15 |
16 | ax.set_title("Energy Spectral Density")
17 | plt.show()
18 |
19 | # construct a narrow laser spectrum
20 | constant_narrow = ConstantSpectrum(min_wavelength=1059.999, max_wavelength=1060.001, bins=1)
21 | print("narow spectrum wavelengths: {}, power spectral density: {}".format(constant_narrow.wavelengths,
22 | constant_narrow.power_spectral_density))
23 |
24 | # construct a GaussianSpectrum with 20 bins
25 | gaussian = GaussianSpectrum(min_wavelength=1059, max_wavelength=1061, bins=30,
26 | mean=1060, stddev=0.3)
27 |
28 | _, ax = plt.subplots()
29 | ax.plot(gaussian.wavelengths, gaussian.power_spectral_density)
30 | ax.set_xlabel("Wavelength [nm]")
31 | ax.set_ylabel("W / nm")
32 |
33 | ax.set_title("Energy Spectral Density")
34 | plt.show()
35 |
--------------------------------------------------------------------------------
/demos/observers/bolometry/.gitignore:
--------------------------------------------------------------------------------
1 | *.pickle
2 |
--------------------------------------------------------------------------------
/demos/observers/bolometry/demo_camera_mesh.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/demos/observers/bolometry/demo_camera_mesh.stl
--------------------------------------------------------------------------------
/demos/openadas/adf15_plots.py:
--------------------------------------------------------------------------------
1 |
2 | import numpy as np
3 | import matplotlib.pyplot as plt
4 |
5 | from cherab.core.atomic import deuterium, helium, carbon
6 | from cherab.openadas import OpenADAS
7 |
8 |
9 | adas = OpenADAS()
10 |
11 | # load the PEC rate objects for transitions of interest
12 | dalpha = adas.impact_excitation_pec(deuterium, 0, (3, 2))
13 | heliumii_468 = adas.impact_excitation_pec(helium, 1, (4, 3))
14 | carbonii_515 = adas.impact_excitation_pec(carbon, 1, ("2s1 2p1 3d1 2D4.5", "2s2 4d1 2D4.5"))
15 | carboniii_465 = adas.impact_excitation_pec(carbon, 2, ("2s1 3p1 3P4.0", "2s1 3s1 3S1.0"))
16 |
17 | # settings for plot range
18 | temp_low = 1
19 | temp_high = 1000
20 | num_points = 100
21 | electron_density = 1E19
22 | electron_temperatures = [10**x for x in np.linspace(np.log10(temp_low), np.log10(temp_high), num=num_points)]
23 |
24 | # sample the PECs
25 | dalpha_pecs = []
26 | heliumii_468_pecs = []
27 | carbonii_515_pecs = []
28 | carboniii_465_pecs = []
29 | for te in electron_temperatures:
30 | dalpha_pecs.append(dalpha(electron_density, te))
31 | heliumii_468_pecs.append(heliumii_468(electron_density, te))
32 | carbonii_515_pecs.append(carbonii_515(electron_density, te))
33 | carboniii_465_pecs.append(carboniii_465(electron_density, te))
34 |
35 | plt.figure()
36 | plt.loglog(electron_temperatures, dalpha_pecs, '.-', label="Dalpha")
37 | plt.loglog(electron_temperatures, heliumii_468_pecs, '.-', label="HeliumII_468")
38 | plt.loglog(electron_temperatures, carbonii_515_pecs, '.-', label="CarbonII_515")
39 | plt.loglog(electron_temperatures, carboniii_465_pecs, '.-', label="CarbonIII_465")
40 | plt.xlabel("Temperature (eV)")
41 | plt.ylabel("PECs (W m^-3)")
42 | plt.legend()
43 | plt.show()
44 |
--------------------------------------------------------------------------------
/demos/openadas/plot_thermalxcrates.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import matplotlib.pyplot as plt
3 | from cherab.core.atomic import neon, carbon, helium, hydrogen
4 | from cherab.openadas import OpenADAS
5 | adas = OpenADAS(permit_extrapolation=True)
6 |
7 |
8 | electron_temperatures = [10**x for x in np.linspace(np.log10(1), np.log10(10000), num=100)]
9 | electron_density = 1e19
10 |
11 | elem = neon
12 |
13 | numstates = elem.atomic_number + 1
14 |
15 | # Collect rate coefficients
16 | coef_tcx = {}
17 | for i in np.arange(1, elem.atomic_number+1):
18 | coef_tcx[i] = adas.thermal_cx_rate(hydrogen, 0, neon, int(i))
19 |
20 | # test correctness of available charge numbers
21 | try:
22 | adas.thermal_cx_rate(hydrogen, 0, neon, i)
23 | except RuntimeError:
24 | print("Check that thermal charge exchange between a neutral element and neutral hydrogen "
25 | "is not allowed.")
26 |
27 |
28 | fig_tcxrates = plt.subplots()
29 | ax = fig_tcxrates[1]
30 | for i in range(1, elem.atomic_number+1):
31 | tcx_rate = [coef_tcx[i](electron_density, x) for x in electron_temperatures]
32 | ax.loglog(electron_temperatures, tcx_rate, "-x", label = "Ne{}+".format(i))
33 |
34 | plt.xlabel("Electron Temperature (eV)")
35 | ax.set_ylabel("rate [m^3s^-1]")
36 | plt.title("Thermal Charge Exchange Rates")
37 |
38 |
39 | plt.show()
40 |
41 |
42 | # test loading rates for CX between neutrals is not allowed
43 | try:
44 | coef_notallowed = adas.thermal_cx_rate(hydrogen, 0, neon, 0)
45 | except RuntimeError:
46 | print("All correct")
47 |
--------------------------------------------------------------------------------
/demos/radiation_loads/wall_from_polygon.py:
--------------------------------------------------------------------------------
1 |
2 | import numpy as np
3 | from raysect.core import Point2D
4 | from raysect.primitive import export_obj
5 |
6 | from cherab.tools.primitives import axisymmetric_mesh_from_polygon
7 |
8 |
9 | PLASMA_AXIS = Point2D(1.5, 0)
10 | LCFS_RADIUS = 1
11 | RING_RADIUS = 0.5
12 |
13 | RADIATION_PEAK = 1
14 | CENTRE_PEAK_WIDTH = 0.05
15 | RING_WIDTH = 0.025
16 |
17 | # distance of wall from LCFS
18 | WALL_LCFS_OFFSET = 0.1
19 |
20 | CYLINDER_RADIUS = PLASMA_AXIS.x + LCFS_RADIUS + WALL_LCFS_OFFSET * 1.1
21 | CYLINDER_HEIGHT = (LCFS_RADIUS + WALL_LCFS_OFFSET) * 2
22 | WALL_RADIUS = LCFS_RADIUS + WALL_LCFS_OFFSET
23 |
24 |
25 | ##########################################
26 | # make toroidal wall wrapping the plasma #
27 |
28 | # number of poloidal wall elements
29 | num = 250
30 | d_angle = (2*np.pi) / num
31 |
32 | wall_polygon = np.zeros((num, 2))
33 | for i in range(num):
34 | pr = PLASMA_AXIS.x + WALL_RADIUS * np.sin(d_angle * i)
35 | pz = PLASMA_AXIS.y + WALL_RADIUS * np.cos(d_angle * i)
36 | wall_polygon[i, :] = pr, pz
37 |
38 | # Note - its important for this application that the resulting mesh triangles
39 | # are facing inwards. This will be determined by the polygon winding direction.
40 | # Positive winding angles produce outward facing meshes so we need to flip
41 | # the polygon to achieve an inward facing mesh.
42 | wall_polygon = wall_polygon[::-1]
43 |
44 | # create a 3D mesh from the 2D polygon outline using symmetry
45 | wall_mesh = axisymmetric_mesh_from_polygon(wall_polygon)
46 |
47 | # write out the mesh to the OBJ triangular mesh format for visualisation in external tools
48 | # (e.g. Meshlab, Blender, etc)
49 | export_obj(wall_mesh, 'toroidal_wall.obj')
50 |
--------------------------------------------------------------------------------
/dev/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | CORES=`nproc --all`
4 |
5 | echo "Rebuilding Cherab extension modules (in place)..."
6 | python setup.py build_ext -j$CORES --inplace $1 $2 $3 $4 $5
7 |
--------------------------------------------------------------------------------
/dev/build_docs.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo Building code...
4 |
5 | dev/build.sh
6 |
7 | echo Building docs...
8 |
9 | export PYTHONPATH=../:$PYTHONPATH
10 |
11 | cd docs
12 |
13 | make html
14 |
--------------------------------------------------------------------------------
/dev/clean.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo Removing all .c, .so and .html files...
4 |
5 | find cherab -type f -name '*.c' -exec rm {} +
6 | find cherab -type f -name '*.so' -exec rm {} +
7 | find cherab -type f -name '*.html' -exec rm {} +
8 | rm build -rf
9 |
10 |
--------------------------------------------------------------------------------
/dev/test.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | python -m unittest $1 $2 $3 $4 $5
4 |
--------------------------------------------------------------------------------
/docs/source/atomic/atomic_data.rst:
--------------------------------------------------------------------------------
1 |
2 | Atomic Data
3 | ===========
4 |
5 | .. toctree::
6 | elements_and_isotopes
7 | emission_lines
8 | rate_coefficients
9 | gaunt_factors
10 | atomic_data_interface
11 | data_interpolators
12 | repository
13 | openadas
14 |
--------------------------------------------------------------------------------
/docs/source/atomic/atomic_data_interface.rst:
--------------------------------------------------------------------------------
1 |
2 | Atomic Data Interface
3 | =====================
4 |
5 | Abstract (interface) class
6 | --------------------------
7 |
8 | Abstract atomic data interface.
9 |
10 | .. autoclass:: cherab.core.atomic.interface.AtomicData
11 | :members:
12 |
13 | OpenADAS atomic data source
14 | ---------------------------
15 |
16 | Interface to local atomic data repository.
17 |
18 | .. autoclass:: cherab.openadas.openadas.OpenADAS
19 | :members:
20 |
--------------------------------------------------------------------------------
/docs/source/atomic/elements_and_isotopes.rst:
--------------------------------------------------------------------------------
1 |
2 | Elements and Isotopes
3 | ---------------------
4 |
5 | .. autoclass:: cherab.core.atomic.elements.Element
6 | :members:
7 |
8 |
9 | Some examples of commonly used pre-defined elements:
10 |
11 | >>> from cherab.core.atomic import hydrogen, helium, lithium, beryllium, boron, \
12 | >>> carbon, nitrogen, oxygen, fluorine, neon, argon, krypton, xenon
13 |
14 | For the full list of available elements please consult the
15 | `source file `_ .
16 |
17 | .. autofunction:: cherab.core.atomic.elements.lookup_element
18 |
19 |
20 | .. autoclass:: cherab.core.atomic.elements.Isotope
21 | :members:
22 |
23 |
24 | Some examples of commonly used pre-defined isotopes:
25 |
26 | >>> from cherab.core.atomic import protium, deuterium, tritium, helium3, helium4
27 |
28 | For the full list of available isotopes please consult the
29 | `source file `_ .
30 |
31 | .. autofunction:: cherab.core.atomic.elements.lookup_isotope
32 |
33 |
--------------------------------------------------------------------------------
/docs/source/atomic/emission_lines.rst:
--------------------------------------------------------------------------------
1 |
2 | Spectroscopic Emission Lines
3 | ----------------------------
4 |
5 | .. autoclass:: cherab.core.atomic.line.Line
6 | :members:
7 |
8 | .. autoclass:: cherab.core.atomic.zeeman.ZeemanStructure
9 | :members:
10 |
--------------------------------------------------------------------------------
/docs/source/atomic/gaunt_factors.rst:
--------------------------------------------------------------------------------
1 |
2 | Gaunt factors
3 | -------------
4 |
5 | This includes classes for temperature-averaged Gaunt factors used to calculate Bremsstrahlung (free-free Gaunt factor)
6 | and radiative recombination continuum (bound-free Gaunt factor) emission.
7 |
8 |
9 | Free-free Gaunt factors
10 | ^^^^^^^^^^^^^^^^^^^^^^^
11 |
12 | .. autoclass:: cherab.core.atomic.gaunt.FreeFreeGauntFactor
13 | :members:
14 | :special-members: __call__
15 |
16 | .. autoclass:: cherab.core.atomic.gaunt.InterpolatedFreeFreeGauntFactor
17 | :show-inheritance:
18 | :members:
19 |
20 | .. autoclass:: cherab.core.atomic.gaunt.MaxwellianFreeFreeGauntFactor
21 | :show-inheritance:
22 | :members:
23 |
24 |
--------------------------------------------------------------------------------
/docs/source/atomic/openadas.rst:
--------------------------------------------------------------------------------
1 | Open-ADAS
2 | ---------
3 |
4 | Although a typical Open-ADAS data set is installed to the local atomic data repository
5 | using the `populate()` function, additional atomic data can be installed manually.
6 |
7 | The following functions allow to parse the Open-ADAS files and install the rates of the atomic processes
8 | to the local atomic data repository.
9 |
10 | Parse
11 | ^^^^^
12 |
13 | .. autofunction:: cherab.openadas.parse.adf11.parse_adf11
14 |
15 | .. autofunction:: cherab.openadas.parse.adf12.parse_adf12
16 |
17 | .. autofunction:: cherab.openadas.parse.adf15.parse_adf15
18 |
19 | .. autofunction:: cherab.openadas.parse.adf21.parse_adf21
20 |
21 | .. autofunction:: cherab.openadas.parse.adf22.parse_adf22bmp
22 |
23 | .. autofunction:: cherab.openadas.parse.adf22.parse_adf22bme
24 |
25 | Install
26 | ^^^^^^^
27 |
28 | .. automodule:: cherab.openadas.install
29 | :members:
30 |
--------------------------------------------------------------------------------
/docs/source/demonstrations/active_spectroscopy/BES_camera.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/active_spectroscopy/BES_camera.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/active_spectroscopy/BES_sightline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/active_spectroscopy/BES_sightline.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/active_spectroscopy/BES_spectrum_full.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/active_spectroscopy/BES_spectrum_full.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/active_spectroscopy/BES_spectrum_zoomed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/active_spectroscopy/BES_spectrum_zoomed.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/active_spectroscopy/CXS_camera.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/active_spectroscopy/CXS_camera.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/active_spectroscopy/CXS_multi_sightlines.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/active_spectroscopy/CXS_multi_sightlines.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/active_spectroscopy/CXS_spectrum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/active_spectroscopy/CXS_spectrum.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/active_spectroscopy/beam_bes.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 |
4 | .. _beam_bes:
5 |
6 | Beam Emission Spectroscopy
7 | ==========================
8 |
9 | This demonstration shows how to model the Beam Emission Spectrum (BES) from a beam-plasma
10 | interaction. These features are sometimes also known as the Motional Stark Effect (MSE)
11 | features. A slab plasma is setup as the target, with a neutral beam injected along the x
12 | axis. It is possible to change the sigma to pi ratios by overriding the line ratio functions
13 | as arguments to the BeamEmissionLine() model.
14 |
15 |
16 | .. literalinclude:: ../../../../demos/emission_models/beam_emission_spectrum.py
17 |
18 | .. figure:: BES_camera.png
19 | :align: center
20 | :width: 450px
21 |
22 | **Caption:** A camera view of a beam entering a slab plasma. The camera is tuned to
23 | D-alpha light. We can see the background passive emission of the neutrals hitting
24 | the slab as well as the beam emission light.
25 |
26 | .. figure:: BES_sightline.png
27 | :align: center
28 | :width: 450px
29 |
30 | **Caption:** A x-z slice of the beam density profile showing the optical sightline.
31 | The amount of Motional Stark Effect (MSE) splitting is direction dependent.
32 |
33 | .. figure:: BES_spectrum_full.png
34 | :align: center
35 | :width: 450px
36 |
37 | **Caption:** The full beam emission spectrum showing the passive emision peak as
38 | well as the three beam emission multiplet components.
39 |
40 | .. figure:: BES_spectrum_zoomed.png
41 | :align: center
42 | :width: 450px
43 |
44 | **Caption:** A zoomed in view of the BES feature.
45 |
46 |
--------------------------------------------------------------------------------
/docs/source/demonstrations/active_spectroscopy/beam_cxs.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 |
4 | .. _beam_cxs:
5 |
6 | Charge Exchange Spectroscopy
7 | ============================
8 |
9 | This demonstration shows how to model the Charge Exchange Spectroscopy (CXS)
10 | spectrum from a beam-plasma interaction. A slab plasma is setup as the target, with a neutral
11 | beam injected along the x axis. The BeamCXLine() emission model is added as a property of
12 | the beam object.
13 |
14 |
15 | .. literalinclude:: ../../../../demos/emission_models/charge_exchange.py
16 |
17 | .. figure:: CXS_camera.png
18 | :align: center
19 | :width: 450px
20 |
21 | **Caption:** A camera view of a beam entering a slab plasma. The colouring of the image is
22 | due to the mixing of both charge exchange spectral lines.
23 |
24 | .. figure:: CXS_spectrum.png
25 | :align: center
26 | :width: 450px
27 |
28 | **Caption:** The observed spectrum reveals observations of both active charge exchange lines.
29 |
30 | .. figure:: CXS_multi_sightlines.png
31 | :align: center
32 | :width: 450px
33 |
34 | **Caption:** A zoomed in spectral view of the commonly studied CVI n = 8->7 CXS line.
35 | The lines are doppler shifted due to the velocity of the plasma.
36 |
37 |
--------------------------------------------------------------------------------
/docs/source/demonstrations/atomic_data/D_alpha_PECs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/atomic_data/D_alpha_PECs.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/atomic_data/beam_emission_rates.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/atomic_data/beam_emission_rates.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/atomic_data/beam_plasma_interactions.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 |
4 | .. _beam_plasma_interaction_rates:
5 |
6 | Beam-Plasma Interaction Rates
7 | =============================
8 |
9 | Some example code for requesting beam rate objects and sampling them with the __call__()
10 | method.
11 |
12 |
13 | .. literalinclude:: ../../../../demos/openadas/beam_plasma_interaction_rates.py
14 |
15 |
16 | .. figure:: beam_stopping_rates.png
17 | :align: center
18 | :width: 450px
19 |
20 | .. figure:: beam_population_rates.png
21 | :align: center
22 | :width: 450px
23 |
24 | .. figure:: beam_emission_rates.png
25 | :align: center
26 | :width: 450px
27 |
28 | .. figure:: effective_cx_rates.png
29 | :align: center
30 | :width: 450px
31 |
--------------------------------------------------------------------------------
/docs/source/demonstrations/atomic_data/beam_population_rates.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/atomic_data/beam_population_rates.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/atomic_data/beam_stopping_rates.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/atomic_data/beam_stopping_rates.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/atomic_data/effective_cx_rates.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/atomic_data/effective_cx_rates.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/atomic_data/fractional_abundance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/atomic_data/fractional_abundance.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/atomic_data/fractional_abundance.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 |
4 | .. _fractional_abundances:
5 |
6 | Fractional Abundances
7 | =====================
8 |
9 | Some example code for requesting fractional abundances and plotting them.
10 |
11 |
12 | .. literalinclude:: ../../../../demos/openadas/frac_abundance.py
13 |
14 |
15 | .. figure:: fractional_abundance.png
16 | :align: center
17 | :width: 450px
18 |
19 |
--------------------------------------------------------------------------------
/docs/source/demonstrations/atomic_data/stage_resolved_radiation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/atomic_data/stage_resolved_radiation.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/bolometry/bolometer_and_radiation_function.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/bolometry/bolometer_and_radiation_function.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/bolometry/bolometer_raytransfer_sensitivities.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/bolometry/bolometer_raytransfer_sensitivities.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/bolometry/bolometer_voxel_sensitivities.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/bolometry/bolometer_voxel_sensitivities.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/bolometry/dummy_camera_box.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/bolometry/dummy_camera_box.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/bolometry/geometry_matrix_from_voxels.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 | .. _bolometer_geometry_voxels:
4 |
5 |
6 | Calculating a Geometry Matrix using the Voxel Framework
7 | =======================================================
8 |
9 | In this demonstration, we calculate the geometry matrix for a slightly more complicated
10 | bolometer system, consisting of 3 cameras each of which have 16 foils looking through a
11 | single aperture. For simplicity we discretise the measurement space into toroidally
12 | symmetric voxels of identical rectangular cross section, although it is possible to
13 | have an arbitrary cross section in the voxel framework.
14 |
15 | In addition to the geometry matrix, a regularisation operator is generated. This is
16 | needed for regularised tomographic inversions, as shown in the :ref:`Inversion with
17 | Voxels ` demo. We use a simple Laplacian operator as the
18 | regularisation operator, which corresponds to isotropic smoothing.
19 |
20 | .. literalinclude:: ../../../../demos/observers/bolometry/geometry_matrix_with_voxels.py
21 |
22 | .. figure:: bolometer_inversion_lines_of_sight.svg
23 | :align: center
24 |
25 | **Caption** The lines of sight of the 48 foils in 3 bolometer cameras, used to
26 | generate the sensitivity matrix.
27 |
28 | .. figure:: bolometer_voxel_sensitivities.png
29 | :align: center
30 |
31 | **Caption** The result of summing the sensitivty of all foils, for each voxel in the
32 | voxel collection.
33 |
--------------------------------------------------------------------------------
/docs/source/demonstrations/bolometry/inversion_with_raytransfer_profile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/bolometry/inversion_with_raytransfer_profile.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/bolometry/inversion_with_voxels_profile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/bolometry/inversion_with_voxels_profile.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/jet_cxrs/JET_CXRS_d5lines.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/jet_cxrs/JET_CXRS_d5lines.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/jet_cxrs/jet_demo_76666.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 |
4 | .. _jet_cxrs_76666:
5 |
6 | 76666 sample analysis
7 | =====================
8 |
9 | Demo for pulse 76666 at t=61s
10 |
11 | .. literalinclude:: ./JET_demo_76666.py
12 |
--------------------------------------------------------------------------------
/docs/source/demonstrations/line_emission/balmer_series_spectra.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/line_emission/balmer_series_spectra.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/line_emission/mastu_bulletb_midplane_dalpha.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/line_emission/mastu_bulletb_midplane_dalpha.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/line_emission/mastu_bulletb_midplane_dgamma.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/line_emission/mastu_bulletb_midplane_dgamma.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/line_emission/mastu_divcam_isp_ciii_465.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/line_emission/mastu_divcam_isp_ciii_465.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/line_emission/mastu_divcam_sxd_dalpha.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/line_emission/mastu_divcam_sxd_dalpha.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/line_emission/mastu_divcam_sxd_dalpha_150_samples.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/line_emission/mastu_divcam_sxd_dalpha_150_samples.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/line_emission/mastu_midplane_dalpha_excitation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/line_emission/mastu_midplane_dalpha_excitation.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/line_emission/ne_ray_trajectory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/line_emission/ne_ray_trajectory.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/line_emission/normalised_emission_ray_trajectory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/line_emission/normalised_emission_ray_trajectory.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/line_emission/poloidal_dalpha_emission.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/line_emission/poloidal_dalpha_emission.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/line_emission/te_ray_trajectory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/line_emission/te_ray_trajectory.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/passive_spectroscopy/BalmerSeries_camera.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/passive_spectroscopy/BalmerSeries_camera.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/passive_spectroscopy/BalmerSeries_spectrum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/passive_spectroscopy/BalmerSeries_spectrum.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/passive_spectroscopy/BalmerSeries_spectrum_zoomed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/passive_spectroscopy/BalmerSeries_spectrum_zoomed.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/passive_spectroscopy/balmer_series.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 |
4 | .. _impact_recom_lines:
5 |
6 | Impact Excitation and Recombination
7 | ===================================
8 |
9 | This demonstration shows how to model the commonly observed passive emission lines due
10 | to electron impact excitation and recombination. A spherical plasma is initialised in
11 | a similar way to other demonstrations on creating plasmas. Then the ExcitationLine()
12 | and RecombinationLine() emission models for the first five Balmer series lines are
13 | attached to the plasma.
14 |
15 |
16 | .. literalinclude:: ../../../../demos/balmer_series.py
17 |
18 | .. figure:: BalmerSeries_spectrum.png
19 | :align: center
20 | :width: 450px
21 |
22 | **Caption:** The observed Balmer series spectrum.
23 |
24 | .. figure:: BalmerSeries_spectrum_zoomed.png
25 | :align: center
26 | :width: 450px
27 |
28 | **Caption:** A zoomed in view on the h-alpha lines reveals the doppler shifts observable
29 | by varying the viewing angle.
30 |
31 | .. figure:: BalmerSeries_camera.png
32 | :align: center
33 | :width: 450px
34 |
35 | **Caption:** A zoomed in spectral view of the commonly studied CVI n = 8->7 CXS line.
36 | The lines are doppler shifted due to the velocity of the plasma.
37 |
38 |
--------------------------------------------------------------------------------
/docs/source/demonstrations/passive_spectroscopy/multiplet.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 |
4 | .. _multiplet_lines:
5 |
6 | Multiplet Line Ratios
7 | =====================
8 |
9 | Some lines split into multiple components, requiring a higher spectroscopy
10 | resolution than is normally modelled in Cherab. It is possible to add the
11 | experimentally measured multiplet ratios by using the MultipletLineShape()
12 | class. The ratios between the multiplet lines will be constant, but the total
13 | emissivity of the multiplet will match the original emissivity as specified
14 | by your atomic data.
15 |
16 | In this example we specify a Nitrogen II multiplet using experimental line
17 | ratios from Table I of the paper: Henderson, S.S., et al. "Determination of
18 | volumetric plasma parameters from spectroscopic N II and N III line ratio
19 | measurements in the ASDEX Upgrade divertor." Nuclear Fusion 58.1 (2017):
20 | 016047.
21 |
22 |
23 | .. literalinclude:: ../../../../demos/emission_models/multiplet.py
24 |
25 | .. figure:: multiplet_spectrum.png
26 | :align: center
27 | :width: 450px
28 |
29 | **Caption:** An observed NII multiplet in the region of 402-407nm. The multiplet
30 | is surrounded by two brighter hydrogen Balmer series lines.
31 |
--------------------------------------------------------------------------------
/docs/source/demonstrations/passive_spectroscopy/multiplet_spectrum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/passive_spectroscopy/multiplet_spectrum.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/passive_spectroscopy/stark_broadening.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 |
4 | .. _stark_broadening:
5 |
6 | Stark Broadening
7 | ================
8 |
9 | Normally, the dominant factor in determining the lineshape is the thermal
10 | doppler broadening. However, in certain high density plasma scenarios a
11 | secondary effect can take over, known as pressure broadening. This effect
12 | results from the fact that radiating ions experience a change in the
13 | electric field due to the presence of neighbouring ions. In normal tokamak
14 | operations this effect is negligible, except in the divertor region.
15 |
16 | It is possible to override the default doppler broadened line shape by
17 | specifying the StarkBroadenedLine() lineshape class.
18 | This class suppors Balmer and Paschen series and is based on
19 | the Stark-Doppler-Zeeman line shape model from B. Lomanowski, et al.
20 | "Inferring divertor plasma properties from hydrogen Balmer
21 | and Paschen series spectroscopy in JET-ILW." Nuclear Fusion 55.12 (2015)
22 | `123028 `_.
23 | In this example we can see two stark broadened balmer series lines surrounding a
24 | Nitrogen II multiplet feature. The logarithmic scale is chosen to illustrate
25 | the power-law decay of the Stark-broadened line wings.
26 |
27 | .. literalinclude:: ../../../../demos/emission_models/stark_broadening.py
28 |
29 | .. figure:: stark_spectrum.png
30 | :align: center
31 | :width: 450px
32 |
33 | **Caption:** The observed spectrum with two stark broadened balmer lines
34 | (397nm and 410nm) surrounding a NII multiplet feature in the logarithmic scale.
35 |
--------------------------------------------------------------------------------
/docs/source/demonstrations/passive_spectroscopy/stark_spectrum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/passive_spectroscopy/stark_spectrum.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/passive_spectroscopy/stark_zeeman_balmer_alpha.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/passive_spectroscopy/stark_zeeman_balmer_alpha.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/passive_spectroscopy/stark_zeeman_paschen_beta.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/passive_spectroscopy/stark_zeeman_paschen_beta.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/passive_spectroscopy/zeeman_spectrum_0deg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/passive_spectroscopy/zeeman_spectrum_0deg.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/passive_spectroscopy/zeeman_spectrum_45deg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/passive_spectroscopy/zeeman_spectrum_45deg.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/passive_spectroscopy/zeeman_spectrum_90deg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/passive_spectroscopy/zeeman_spectrum_90deg.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/plasmas/analytic_plasma.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/plasmas/analytic_plasma.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/plasmas/analytic_plasma_slices.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/plasmas/analytic_plasma_slices.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/plasmas/beam_attenuation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/plasmas/beam_attenuation.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/plasmas/beam_density_xz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/plasmas/beam_density_xz.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/plasmas/beam_into_plasma.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/plasmas/beam_into_plasma.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/plasmas/beam_ion_temp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/plasmas/beam_ion_temp.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/plasmas/beam_neutral_temp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/plasmas/beam_neutral_temp.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/plasmas/equilibrium_lcfs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/plasmas/equilibrium_lcfs.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/plasmas/equilibrium_limiter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/plasmas/equilibrium_limiter.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/plasmas/equilibrium_mapped_te_xy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/plasmas/equilibrium_mapped_te_xy.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/plasmas/equilibrium_mapped_te_xz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/plasmas/equilibrium_mapped_te_xz.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/plasmas/equilibrium_surfaces.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/plasmas/equilibrium_surfaces.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/plasmas/mesh_for_plasma.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/plasmas/mesh_for_plasma.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/plasmas/mesh_plasma_column.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/plasmas/mesh_plasma_column.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/plasmas/mesh_plasma_slices.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/plasmas/mesh_plasma_slices.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/plasmas/slab_plasma.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/plasmas/slab_plasma.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/plasmas/slab_plasma.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 |
4 | .. _slab_plasma:
5 |
6 | Slab Plasma
7 | ===========
8 |
9 | This demonstration uses the utility function
10 | :meth:`~cherab.tools.plasmas.slab.build_slab_plasma` to assemble a slab of plasma
11 | defined along the positive x axis. It is a useful tool for defining a simple plasma
12 | to be used in the testing of emission models.
13 |
14 |
15 | .. literalinclude:: ../../../../demos/plasmas/slab_plasma.py
16 |
17 | .. figure:: slab_plasma.png
18 | :align: center
19 | :width: 450px
20 |
21 | **Caption:** The ion temperature profile with a pedestal starting at x=0.
22 |
23 | .. figure:: slab_plasma_neutrals.png
24 | :align: center
25 | :width: 450px
26 |
27 | **Caption:** The neutral density profile, constant for x<0 and then attenuated
28 | by the plasma.
29 |
--------------------------------------------------------------------------------
/docs/source/demonstrations/plasmas/slab_plasma_neutrals.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/plasmas/slab_plasma_neutrals.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/radiation_loads/AUG_radiation_load.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/radiation_loads/AUG_radiation_load.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/radiation_loads/AUG_wall_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/radiation_loads/AUG_wall_outline.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/radiation_loads/AUG_wall_zoomed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/radiation_loads/AUG_wall_zoomed.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/radiation_loads/radiation_function.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/radiation_loads/radiation_function.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/radiation_loads/radiation_function_rz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/radiation_loads/radiation_function_rz.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/radiation_loads/symmetric_power_load.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/radiation_loads/symmetric_power_load.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/radiation_loads/symmetric_power_load_detectors.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/radiation_loads/symmetric_power_load_detectors.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/radiation_loads/symmetric_power_load_zoomed_detectors.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/radiation_loads/symmetric_power_load_zoomed_detectors.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/radiation_loads/toroidal_wall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/radiation_loads/toroidal_wall.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/radiation_loads/wall_from_polygon.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 |
4 | .. _wall_from_polygon:
5 |
6 |
7 | Defining A Wall From A 2D Polygon
8 | =================================
9 |
10 | When studying candidate reactor designs for future machines, detailed engineering
11 | meshes are not always available. Sometimes all we have is a simple 2D outline
12 | representing a candidate wall design.
13 |
14 | In this example we make a 3D mesh from a simple outline. The wall mesh is intended
15 | to wrap the plasma emission function from the previous
16 | :ref:`radiation function example `. The utility function
17 | :meth:`~cherab.tools.primitives.axisymmetric_mesh.axisymmetric_mesh_from_polygon`
18 | is useful for creating a 3D mesh from a 2D polygon.
19 |
20 |
21 | .. literalinclude:: ../../../../demos/radiation_loads/wall_from_polygon.py
22 |
23 | .. figure:: toroidal_wall.png
24 | :align: center
25 |
26 | **Caption:** The resulting toroidal mesh visualised in Meshlab.
27 |
--------------------------------------------------------------------------------
/docs/source/demonstrations/ray_transfer/ray_transfer_box.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 |
4 | .. _ray_transfer_box:
5 |
6 | Rectangular regular grid
7 | ========================
8 |
9 | This example shows how to:
10 |
11 | * calculate ray transfer matrix (geometry matrix) for a rectangular emitter defined on a regular grid,
12 | * obtain images using calculated ray transfer matrix by collapsing it with various emission profiles.
13 |
14 | Notice that `RoughNickel` material is imported from cherab.tools.raytransfer and not from raysect.optical.library.
15 |
16 |
17 | .. literalinclude:: ../../../../demos/ray_transfer/1_ray_transfer_box.py
18 |
19 | .. figure:: ray_transfer_box_demo.png
20 | :align: center
21 | :width: 450px
22 |
23 | **Caption:** The result of collapsing geometry matrix with four different emission profiles.
24 |
--------------------------------------------------------------------------------
/docs/source/demonstrations/ray_transfer/ray_transfer_box_demo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/ray_transfer/ray_transfer_box_demo.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/ray_transfer/ray_transfer_cylinder.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 |
4 | .. _ray_transfer_cylinder:
5 |
6 | Cylindrical regular grid
7 | ========================
8 |
9 | This example shows how to:
10 |
11 | * calculate ray transfer matrix (geometry matrix) for a cylindrical periodic emitter defined on a regular grid,
12 | * obtain images using calculated ray transfer matrix by collapsing it with various emission profiles.
13 |
14 |
15 | .. literalinclude:: ../../../../demos/ray_transfer/2_ray_transfer_cylinder.py
16 |
17 | .. figure:: ray_transfer_cylinder_demo.gif
18 | :align: center
19 | :width: 450px
20 |
21 | **Caption:** The result of collapsing geometry matrix with 64 different emission profiles.
22 |
--------------------------------------------------------------------------------
/docs/source/demonstrations/ray_transfer/ray_transfer_cylinder_demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/ray_transfer/ray_transfer_cylinder_demo.gif
--------------------------------------------------------------------------------
/docs/source/demonstrations/ray_transfer/ray_transfer_map.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 |
4 | .. _ray_transfer_map:
5 |
6 | Axisymmetrical (toroidal) regular grid with custom mapping of light sources
7 | ===========================================================================
8 |
9 | This example shows how to:
10 |
11 | * calculate ray transfer matrix (geometry matrix) for axisymmetrical cylindrical emitter defined on a regular grid
12 | * map multiple grid cells to a single light source by applying a voxel map
13 |
14 |
15 | .. literalinclude:: ../../../../demos/ray_transfer/4_ray_transfer_map.py
16 |
17 | .. figure:: ray_transfer_map_demo.gif
18 | :align: center
19 | :width: 450px
20 |
21 | **Caption:** The result of collapsing geometry matrix with 30 different emission profiles.
22 |
--------------------------------------------------------------------------------
/docs/source/demonstrations/ray_transfer/ray_transfer_map_demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/ray_transfer/ray_transfer_map_demo.gif
--------------------------------------------------------------------------------
/docs/source/demonstrations/ray_transfer/ray_transfer_mask.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 |
4 | .. _ray_transfer_mask:
5 |
6 | Axisymmetrical (toroidal) regular grid
7 | ======================================
8 |
9 | This example shows how to:
10 |
11 | * calculate ray transfer matrix (geometry matrix) for axisymmetrical cylindrical emitter defined on a regular grid,
12 | * filter out extra grid cells by applying a mask.
13 |
14 |
15 | .. literalinclude:: ../../../../demos/ray_transfer/3_ray_transfer_mask.py
16 |
17 | .. figure:: ray_transfer_mask_demo.gif
18 | :align: center
19 | :width: 450px
20 |
21 | **Caption:** The result of collapsing geometry matrix with 30 different emission profiles.
22 |
--------------------------------------------------------------------------------
/docs/source/demonstrations/ray_transfer/ray_transfer_mask_demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/ray_transfer/ray_transfer_mask_demo.gif
--------------------------------------------------------------------------------
/docs/source/demonstrations/solps/species_narrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/solps/species_narrow.png
--------------------------------------------------------------------------------
/docs/source/demonstrations/solps/species_wide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/demonstrations/solps/species_wide.png
--------------------------------------------------------------------------------
/docs/source/figures/CHERAB_structure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/figures/CHERAB_structure.png
--------------------------------------------------------------------------------
/docs/source/index.rst:
--------------------------------------------------------------------------------
1 |
2 |
3 | Cherab's documentation
4 | ======================
5 |
6 | Welcome to the Cherab project. A python library for forward modelling
7 | diagnostics based on spectroscopic plasma emission.
8 |
9 | Please note that these documentation pages are in a state of flux and might not
10 | become stable until we have finished moving the source code to github.
11 |
12 |
13 | .. toctree::
14 | :maxdepth: 2
15 | :numbered:
16 | :caption: Table of Contents
17 | :name: mastertoc
18 |
19 | welcome
20 | licence
21 | governance
22 | installation_and_structure
23 | available_modules
24 | atomic/atomic_data
25 | plasmas/plasmas
26 | models/emission_models
27 | math/math
28 | tools/tools
29 |
30 |
31 | .. toctree::
32 | :maxdepth: 2
33 | :caption: Demonstrations
34 | :name: demonstrations
35 |
36 | demonstrations/demonstrations
37 |
38 |
39 | Indices and tables
40 | ==================
41 |
42 | * :ref:`genindex`
43 | * :ref:`modindex`
44 |
45 |
--------------------------------------------------------------------------------
/docs/source/math/caching.rst:
--------------------------------------------------------------------------------
1 |
2 | Caching
3 | -------
4 |
5 | .. automodule:: cherab.core.math.caching.caching1d
6 | :show-inheritance:
7 | :members:
8 |
9 | .. automodule:: cherab.core.math.caching.caching2d
10 | :show-inheritance:
11 | :members:
12 |
13 | .. automodule:: cherab.core.math.caching.caching3d
14 | :show-inheritance:
15 | :members:
16 |
--------------------------------------------------------------------------------
/docs/source/math/clamp.rst:
--------------------------------------------------------------------------------
1 |
2 | Clamps
3 | ------
4 |
5 | .. automodule:: cherab.core.math.clamp
6 | :members:
7 |
--------------------------------------------------------------------------------
/docs/source/math/function.rst:
--------------------------------------------------------------------------------
1 |
2 | Functions
3 | =========
4 |
5 | The Cherab function framework is built on the core Raysect 1D, 2D and 3D
6 | `function framework `_.
7 | For more details on the base functionality refer to the Raysect
8 | documentation and the Cherab function tutorials.
9 |
10 | Cherab previously provided vector functions which were not present in Raysect.
11 | New codes should prefer the Raysect vector functions, but the old aliases are preserved for backwards compatibility.
12 |
13 | 2D Vector Functions
14 | -------------------
15 |
16 | .. autoclass:: cherab.core.math.function.VectorFunction2D
17 | :members:
18 |
19 | .. autoclass:: cherab.core.math.function.ScalarToVectorFunction2D
20 | :members:
21 | :show-inheritance:
22 |
23 |
24 | 3D Vector Functions
25 | -------------------
26 |
27 | .. autoclass:: cherab.core.math.function.VectorFunction3D
28 | :members:
29 |
30 | .. autoclass:: cherab.core.math.function.ScalarToVectorFunction3D
31 | :members:
32 | :show-inheritance:
33 |
--------------------------------------------------------------------------------
/docs/source/math/interpolators.rst:
--------------------------------------------------------------------------------
1 |
2 | Interpolators
3 | -------------
4 |
5 | Historically Cherab provided 1D, 2D and 3D interpolators.
6 | New codes are encouraged to use Raysect's `interpolators `_ instead.
7 | For backwards compatibility the Cherab interpolators are retained for now.
8 |
9 |
10 | .. autoclass:: cherab.core.math.interpolators.interpolators1d.Interpolate1DLinear
11 | :members:
12 |
13 | .. autoclass:: cherab.core.math.interpolators.interpolators1d.Interpolate1DCubic
14 | :members:
15 |
16 | .. autoclass:: cherab.core.math.interpolators.interpolators2d.Interpolate2DLinear
17 | :members:
18 |
19 | .. autoclass:: cherab.core.math.interpolators.interpolators2d.Interpolate2DCubic
20 | :members:
21 |
22 | .. autoclass:: cherab.core.math.interpolators.interpolators3d.Interpolate3DLinear
23 | :members:
24 |
25 | .. autoclass:: cherab.core.math.interpolators.interpolators3d.Interpolate3DCubic
26 | :members:
27 |
--------------------------------------------------------------------------------
/docs/source/math/mappers.rst:
--------------------------------------------------------------------------------
1 |
2 | Mappers
3 | -------
4 |
5 | .. automodule:: cherab.core.math.mappers
6 | :members:
7 |
--------------------------------------------------------------------------------
/docs/source/math/mask.rst:
--------------------------------------------------------------------------------
1 |
2 | Masks
3 | -----
4 |
5 | .. automodule:: cherab.core.math.mask
6 | :members:
7 |
--------------------------------------------------------------------------------
/docs/source/math/math.rst:
--------------------------------------------------------------------------------
1 |
2 | Function Framework
3 | ==================
4 |
5 |
6 | One of Cherab's most powerful features is the way it is designed to support mathematical
7 | functions. Most of the physics interfaces in Cherab are specified in terms of math functions
8 | of a specified dimension. I.e. density is a 3D function f(x, y, z), while :math:`\psi_n(r,z)`
9 | is a 2D function in the r-z plane. Cherab leverages Raysect's function framework which provides
10 | arithmetic, blending, interpolation and wrapping capabilities.
11 |
12 | This section of the documentation describes the various additional
13 | utilities that Cherab provides for slicing, dicing and projecting these functions.
14 |
15 | .. toctree::
16 | caching
17 | clamp
18 | function
19 | interpolators
20 | mappers
21 | transform
22 | mask
23 | samplers
24 | slice
25 |
--------------------------------------------------------------------------------
/docs/source/math/samplers.rst:
--------------------------------------------------------------------------------
1 |
2 | Samplers
3 | ========
4 |
5 | This module provides a set of sampling functions for rapidly generating samples
6 | of 1D, 2D and 3D functions.
7 |
8 | These functions use C calls when sampling Function1D, Function2D and Function3D
9 | objects and are therefore considerably faster than the equivalent Python code.
10 |
11 | 1D Sampling
12 | -----------
13 |
14 | .. autofunction:: cherab.core.math.samplers.sample1d
15 |
16 | .. autofunction:: cherab.core.math.samplers.sample1d_points
17 |
18 |
19 | 2D Sampling
20 | -----------
21 |
22 | .. autofunction:: cherab.core.math.samplers.sample2d
23 |
24 | .. autofunction:: cherab.core.math.samplers.sample2d_points
25 |
26 | .. autofunction:: cherab.core.math.samplers.sample2d_grid
27 |
28 | .. autofunction:: cherab.core.math.samplers.samplevector2d
29 |
30 | .. autofunction:: cherab.core.math.samplers.samplevector2d_points
31 |
32 | .. autofunction:: cherab.core.math.samplers.samplevector2d_grid
33 |
34 |
35 | 3D Sampling
36 | -----------
37 |
38 | .. autofunction:: cherab.core.math.samplers.sample3d
39 |
40 | .. autofunction:: cherab.core.math.samplers.sample3d_points
41 |
42 | .. autofunction:: cherab.core.math.samplers.sample3d_grid
43 |
44 | .. autofunction:: cherab.core.math.samplers.samplevector3d
45 |
46 | .. autofunction:: cherab.core.math.samplers.samplevector3d_points
47 |
48 | .. autofunction:: cherab.core.math.samplers.samplevector3d_grid
49 |
50 |
--------------------------------------------------------------------------------
/docs/source/math/slice.rst:
--------------------------------------------------------------------------------
1 |
2 | Slicing
3 | -------
4 |
5 | .. automodule:: cherab.core.math.slice
6 | :members:
7 |
--------------------------------------------------------------------------------
/docs/source/math/transform.rst:
--------------------------------------------------------------------------------
1 |
2 | Transformations
3 | ---------------
4 |
5 | These functions perform coordinate transformations as wrappers for other functions. Unlike mappers, these wrappers do not change the dimensionality of the wrapped functions.
6 |
7 | .. automodule:: cherab.core.math.transform.cylindrical
8 | :members:
9 |
10 | .. automodule:: cherab.core.math.transform.periodic
11 | :members:
12 |
--------------------------------------------------------------------------------
/docs/source/models/basic_line/basic_line_emission.rst:
--------------------------------------------------------------------------------
1 |
2 | Basic Line Emission
3 | ===================
4 |
5 | .. autoclass:: cherab.core.model.plasma.impact_excitation.ExcitationLine
6 |
7 | .. autoclass:: cherab.core.model.plasma.recombination.RecombinationLine
8 |
9 | .. autoclass:: cherab.core.model.plasma.thermal_cx.ThermalCXLine
10 |
--------------------------------------------------------------------------------
/docs/source/models/beam/beam_attenuator.rst:
--------------------------------------------------------------------------------
1 |
2 | Beam Attenuation
3 | ----------------
4 |
5 |
6 | Single Ray Attenuator
7 | ^^^^^^^^^^^^^^^^^^^^^
8 |
9 | .. autoclass:: cherab.core.model.attenuator.singleray.SingleRayAttenuator
10 | :members:
11 |
--------------------------------------------------------------------------------
/docs/source/models/bes/bes_model.rst:
--------------------------------------------------------------------------------
1 |
2 | BES - Beam Emission Spectroscopy
3 | ================================
4 |
5 | Documentation for this model will go here soon...
6 |
--------------------------------------------------------------------------------
/docs/source/models/brem/bremsstrahlung.rst:
--------------------------------------------------------------------------------
1 |
2 | Bremsstrahlung
3 | ==============
4 |
5 | .. autoclass:: cherab.core.model.plasma.bremsstrahlung.Bremsstrahlung
6 | :members:
7 |
--------------------------------------------------------------------------------
/docs/source/models/cxs/cxs_model.rst:
--------------------------------------------------------------------------------
1 |
2 | CXS models
3 | ----------
4 |
5 |
6 | CXS Beam Plasma Intersection
7 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8 |
9 | .. autoclass:: cherab.core.model.beam.charge_exchange.BeamCXLine
10 | :members:
11 | :private-members:
12 |
--------------------------------------------------------------------------------
/docs/source/models/emission_models.rst:
--------------------------------------------------------------------------------
1 |
2 | Emission Models
3 | ===============
4 |
5 | Cherab contains a number of independent physics models for spectroscopic emission.
6 |
7 | .. toctree::
8 | custom_models
9 | beam/beam_attenuator
10 | cxs/cxs_model
11 | cxs/charge_exchange_calculation
12 | bes/bes_model
13 | radiated_power/radiated_power
14 | brem/bremsstrahlung
15 | basic_line/basic_line_emission
16 | line_shapes/spectral_line_shapes
17 | laser/laser
18 |
--------------------------------------------------------------------------------
/docs/source/models/laser/laser.rst:
--------------------------------------------------------------------------------
1 | Laser
2 | ======
3 |
4 | Laser Spectrum
5 | --------------
6 |
7 | .. autoclass:: cherab.core.model.laser.laserspectrum.ConstantSpectrum
8 | :members:
9 | .. autoclass:: cherab.core.model.laser.laserspectrum.GaussianSpectrum
10 | :members:
11 |
12 | Laser Profile
13 | -------------
14 |
15 | .. autoclass:: cherab.core.model.laser.profile.UniformEnergyDensity
16 | :members:
17 | .. autoclass:: cherab.core.model.laser.profile.ConstantBivariateGaussian
18 | :members:
19 | .. autoclass:: cherab.core.model.laser.profile.TrivariateGaussian
20 | :members:
21 | .. autoclass:: cherab.core.model.laser.profile.GaussianBeamAxisymmetric
22 | :members:
23 |
24 | Laser Model
25 | -------------
26 |
27 | .. autoclass:: cherab.core.model.laser.model.SeldenMatobaThomsonSpectrum
28 | :members:
29 |
--------------------------------------------------------------------------------
/docs/source/models/line_shapes/spectral_line_shapes.rst:
--------------------------------------------------------------------------------
1 |
2 | Spectral Line Shapes
3 | ====================
4 |
5 | Cherab contains Doppler-broadened, Doppler-Zeeman and Stark-Doppler-Zeeman line shapes of
6 | atomic spectra.
7 |
8 | **Assumption: Maxwellian distribution of emitting species is assumed.**
9 | **A general model of Doppler broadening will be implemented in the future.**
10 |
11 | .. autoclass:: cherab.core.model.lineshape.doppler.doppler_shift
12 |
13 | .. autoclass:: cherab.core.model.lineshape.doppler.thermal_broadening
14 |
15 | .. autoclass:: cherab.core.model.lineshape.gaussian.add_gaussian_line
16 |
17 | .. autoclass:: cherab.core.model.lineshape.stark.add_lorentzian_line
18 |
19 | .. autoclass:: cherab.core.model.lineshape.base.LineShapeModel
20 | :members:
21 |
22 | .. autoclass:: cherab.core.model.lineshape.gaussian.GaussianLine
23 | :members:
24 |
25 | .. autoclass:: cherab.core.model.lineshape.multiplet.MultipletLineShape
26 | :members:
27 |
28 | .. autoclass:: cherab.core.model.lineshape.zeeman.ZeemanLineShapeModel
29 | :members:
30 |
31 | .. autoclass:: cherab.core.model.lineshape.zeeman.ZeemanTriplet
32 | :members:
33 |
34 | .. autoclass:: cherab.core.model.lineshape.zeeman.ParametrisedZeemanTriplet
35 | :members:
36 |
37 | .. autoclass:: cherab.core.model.lineshape.zeeman.ZeemanMultiplet
38 | :members:
39 |
40 | .. autoclass:: cherab.core.model.lineshape.stark.StarkBroadenedLine
41 | :members:
42 |
43 | .. autoclass:: cherab.core.model.lineshape.beam.base.BeamLineShapeModel
44 | :members:
45 |
46 | .. autoclass:: cherab.core.model.lineshape.beam.mse.BeamEmissionMultiplet
47 | :members:
48 |
--------------------------------------------------------------------------------
/docs/source/models/radiated_power/radiated_power.rst:
--------------------------------------------------------------------------------
1 |
2 | Total Radiated Power
3 | ====================
4 |
5 | .. autoclass:: cherab.core.model.plasma.total_radiated_power.TotalRadiatedPower
6 |
--------------------------------------------------------------------------------
/docs/source/plasmas/beam_direction.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/plasmas/beam_direction.png
--------------------------------------------------------------------------------
/docs/source/plasmas/core_plasma_classes.rst:
--------------------------------------------------------------------------------
1 |
2 | Core Plasma Classes
3 | ===================
4 |
5 | Main Plasma Object
6 | ------------------
7 |
8 | .. autoclass:: cherab.core.Plasma
9 | :members:
10 |
11 | Plasma Species
12 | --------------
13 |
14 | .. autoclass:: cherab.core.Species
15 | :members:
16 |
17 | .. autoclass:: cherab.core.plasma.node.Composition
18 | :special-members: __iter__, __getitem__
19 | :members:
20 |
21 | Distribution functions
22 | ----------------------
23 |
24 | .. autoclass:: cherab.core.distribution.DistributionFunction
25 | :members:
26 | :special-members: __call__
27 |
28 | .. autoclass:: cherab.core.distribution.Maxwellian
29 | :members:
30 | :special-members: __call__
31 | :show-inheritance:
32 |
33 |
--------------------------------------------------------------------------------
/docs/source/plasmas/equilibrium.rst:
--------------------------------------------------------------------------------
1 |
2 | Plasma equilibrium
3 | ==================
4 |
5 |
6 | .. autoclass:: cherab.tools.equilibrium.efit.EFITEquilibrium
7 | :members:
8 |
9 | .. autofunction:: cherab.tools.equilibrium.example.example_equilibrium
10 |
11 | .. autofunction:: cherab.tools.equilibrium.plot.plot_equilibrium
12 |
13 | .. figure:: ../demonstrations/plasmas/equilibrium_surfaces.png
14 | :align: center
15 |
16 | .. autofunction:: cherab.tools.equilibrium.eqdsk.import_eqdsk
17 |
--------------------------------------------------------------------------------
/docs/source/plasmas/equilibrium_plot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cherab/core/26595cb6101e14d6a3eeb1b7421024425114c7a1/docs/source/plasmas/equilibrium_plot.png
--------------------------------------------------------------------------------
/docs/source/plasmas/laser.rst:
--------------------------------------------------------------------------------
1 | Laser
2 | ======
3 |
4 | Laser Spectrum
5 | --------------
6 |
7 | .. autoclass:: cherab.core.laser.laserspectrum.LaserSpectrum
8 | :members:
9 |
10 | Laser Profile
11 | -------------
12 |
13 | .. autoclass:: cherab.core.laser.profile.LaserProfile
14 | :members:
15 |
16 | Laser Model
17 | -------------
18 |
19 | .. autoclass:: cherab.core.laser.model.LaserModel
20 | :members:
21 |
--------------------------------------------------------------------------------
/docs/source/plasmas/particle_beams.rst:
--------------------------------------------------------------------------------
1 |
2 | Mono-energetic Particle Beams
3 | =============================
4 |
5 | .. autoclass:: cherab.core.beam.node.Beam
6 | :members:
7 |
8 | .. figure:: ./beam_direction.png
9 | :align: center
10 |
11 | The beam direction pattern in XZ-plane for the beam with ``sigma`` = 0.1 m
12 | and ``divergence_x`` = 5 :math:`^{\circ}`.
13 |
--------------------------------------------------------------------------------
/docs/source/plasmas/plasmas.rst:
--------------------------------------------------------------------------------
1 |
2 | Plasmas
3 | =======
4 |
5 | .. toctree::
6 |
7 | core_plasma_classes
8 | equilibrium
9 | particle_beams
10 | laser
11 |
--------------------------------------------------------------------------------
/docs/source/tools/materials.rst:
--------------------------------------------------------------------------------
1 |
2 | Materials
3 | =========
4 |
5 | See the Raysect reference documentation for the full catalogue of materials and associated
6 | API interfaces. In Cherab we provide a few useful materials.
7 |
8 |
9 | .. autoclass:: cherab.tools.emitters.radiation_function.RadiationFunction
10 | :show-inheritance:
11 |
12 |
--------------------------------------------------------------------------------
/docs/source/tools/plasmas.rst:
--------------------------------------------------------------------------------
1 |
2 | Plasmas
3 | =======
4 |
5 | In Cherab we provide a few useful utilities for assembling plasmas.
6 |
7 |
8 | .. autofunction:: cherab.tools.plasmas.slab.build_slab_plasma
9 |
10 |
--------------------------------------------------------------------------------
/docs/source/tools/primitives.rst:
--------------------------------------------------------------------------------
1 |
2 | Primitives
3 | ==========
4 |
5 | A few useful utilities for creating primitives particularly relevant for fusion.
6 |
7 |
8 | .. autofunction:: cherab.tools.primitives.axisymmetric_mesh.axisymmetric_mesh_from_polygon
9 |
10 | .. autofunction:: cherab.tools.primitives.toroidal_mesh.toroidal_mesh_from_polygon
--------------------------------------------------------------------------------
/docs/source/tools/spectroscopy.rst:
--------------------------------------------------------------------------------
1 |
2 | Spectroscopy
3 | ============
4 |
5 | The tools for plasma spectroscopy.
6 |
7 | .. _spectroscopy_instruments:
8 |
9 | Spectroscopic instruments
10 | -------------------------
11 |
12 | Spectroscopic instruments such as polychromators and spectrometers
13 | simplify the setup of properties of the observers and rendering pipelines. The instruments
14 | are not connected to the scenegraph, so they cannot observe the world. However, the instruments
15 | have properties, such as `min_wavelength`, `max_wavelength`, `spectral_bins`,
16 | `pipeline_properties`, with which the observer can be configured.
17 | The Cherab core package provides base classes for spectroscopic instruments,
18 | so machine-specific packages can build more advance instruments from them, such as instruments
19 | with spectral properties based on the actual experimental setup for a given shot/pulse.
20 |
21 | .. autoclass:: cherab.tools.spectroscopy.SpectroscopicInstrument
22 | :members:
23 |
24 | .. autoclass:: cherab.tools.spectroscopy.PolychromatorFilter
25 | :members:
26 |
27 | .. autoclass:: cherab.tools.spectroscopy.TrapezoidalFilter
28 | :show-inheritance:
29 | :members:
30 |
31 | .. autoclass:: cherab.tools.spectroscopy.Polychromator
32 | :show-inheritance:
33 | :members:
34 |
35 | .. autoclass:: cherab.tools.spectroscopy.Spectrometer
36 | :show-inheritance:
37 | :members:
38 |
39 | .. autoclass:: cherab.tools.spectroscopy.CzernyTurnerSpectrometer
40 | :show-inheritance:
41 | :members:
42 |
43 |
--------------------------------------------------------------------------------
/docs/source/tools/tools.rst:
--------------------------------------------------------------------------------
1 |
2 | Tools
3 | =====
4 |
5 | .. toctree::
6 |
7 | plasmas
8 | materials
9 | primitives
10 | observers
11 | spectroscopy
12 | tomography
13 | utility
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docs/source/tools/utility.rst:
--------------------------------------------------------------------------------
1 |
2 | Utilities
3 | =========
4 |
5 |
6 | Small module of helper functions and classes.
7 |
8 |
9 | Unit Conversions
10 | ~~~~~~~~~~~~~~~~
11 |
12 | .. automodule:: cherab.core.utility.conversion
13 | :members:
14 |
15 |
16 | Notify
17 | ~~~~~~
18 |
19 | .. automodule:: cherab.core.utility.notify
20 | :members:
21 |
22 |
23 | Recursive Dict
24 | ~~~~~~~~~~~~~~
25 |
26 | .. automodule:: cherab.core.utility.recursivedict
27 | :members:
28 |
--------------------------------------------------------------------------------
/pyproject.toml:
--------------------------------------------------------------------------------
1 | [build-system]
2 | requires = ["setuptools>=62.3", "oldest-supported-numpy", "cython~=3.0", "raysect==0.8.1.*"]
3 | build-backend="setuptools.build_meta"
4 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | cython~=3.0
2 | numpy>=1.14,<2.0
3 | scipy
4 | matplotlib
5 | raysect==0.8.1.*
6 |
--------------------------------------------------------------------------------