Skip to content

Add fast emitters and integrators for regular grids #204

@vsnever

Description

@vsnever

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.
case_2226_55 G1_EP12L_visible_rgb
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)

  • emission is the 4D array containing the spectral emission defined on a regular 3D grid (in axisymmetric case emission.shape[1] == 1). The last dimension of this array is the spectral one. While the delta_wavelength used 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), thus emission.shape[3] can be lower than camera.spectral_bins. This allows to save memory, which is especially useful in a non-axisymmetric case. In the example above the camera.spectral_bins was equal to 98 while the emission.shape[3] was equal to 14.
  • spectral_index is the 1D array with spectral_index.size == emission.shape[3], which maps the spectral emission array to the respective spectral bins.
  • min_wavelength is the minimal wavelength equal to camera.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions