-
Notifications
You must be signed in to change notification settings - Fork 24
Description
I would like to add to Cherab the emitters and integrators that work with regular grids (Cartesian or cylindrical) in similar way to recently added Ray Transfer Objects, but integrate actual spectra unlike Ray Transfer Objects.
These special emitters and integrators could be used with the observers with high spatial but low spectral resolution like filtered or unfiltered 2D cameras. Of course, the original data generated on a non-regular grid (with SOLPS or EMC3-Eirene) must be interpolated on a regular grid first. However, if the memory allows, the resolution of the regular grid can be very high, so the accuracy of the original mesh can be preserved. These emitters and integrators allow to achieve tenfold speedups compared to the general NumericalIntegrator and emission models used in the Plasma object.
Here is the image simulated using these emitters and integrators for the one of the ITER 55.G1 cameras.

The image parameters are 642x803 pixels, 5000 samples per pixel. The data include the emission of 14 spectral lines of D, He, Be and Ne in visible range calculated with SOLPS (by A.S. Kukushkin) and then interpolated on 1cm x 1cm regular grid for this simulation. The volume integration step is 2 mm. The calculation took only 8 hours on Core i9-9920x (note that just tracing this amount of rays though the scene without plasma would take almost 3 hours). Please note that I still do not have the actual 3D model of the ITER first wall, so I used the model for a single 20-deg sector, which contains many approximations.
I already wrote the Cython code for these emitters and integrators and now only need to add documentation, unit tests and demos.
Here is the interface of the RegularGridCylinder object:
RegularGridCylinder(emission, spectral_index, min_wavelength, radius_outer, height, radius_inner=0, period=360., step=None, parent=None, transform=None)
emissionis the 4D array containing the spectral emission defined on a regular 3D grid (in axisymmetric caseemission.shape[1] == 1). The last dimension of this array is the spectral one. While thedelta_wavelengthused to calculate the spectral emission must be equal to(camera.max_wavelength - camera.min_wavelength) / camera.spectral_bins, some of the spectral bins can be skipped (if they are empty), thusemission.shape[3]can be lower thancamera.spectral_bins. This allows to save memory, which is especially useful in a non-axisymmetric case. In the example above thecamera.spectral_binswas equal to 98 while theemission.shape[3]was equal to 14.spectral_indexis the 1D array withspectral_index.size == emission.shape[3], which maps the spectral emission array to the respective spectral bins.min_wavelengthis the minimal wavelength equal tocamera.min_wavelength. This parameter is required to correctly process dispersive rendering.
All other parameters are the same as for the RayTransferCylinder.
I hope the code will be ready for review in a few days. Your comments would be greatly appreciated.