Repository navigation
Rtepack scattering - #1197
Merged
Merged
Rtepack scattering#1197
Conversation
Contributor
Author
|
#1194 is affected by this merge. A design change to make |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI message by request:
Scattering on rtepack types; T-matrix in C++ with azimuthally random orientation; polarization and accuracy fixes
Besides moving the scattering containers to rtepack types (bit-identical, no physics change), this PR changes
scattering physics in four places and fixes several bugs that gave wrong numbers without any error.
Physics
ARTS's Stokes convention for particle scattering (behaviour change). Mie and the T-matrix returned scattering
matrices in Mishchenko's (and Bohren & Huffman's) convention, whose U has the opposite sign to ARTS's. As a result,
F34 had the wrong sign, and so did Z13, Z23, Z31, Z32, Z34 and Z43 of fixed orientation. V produced by scattering of
linearly polarized radiation therefore had the wrong sign relative to the rest of ARTS (Zeeman, surfaces). Both are
now in ARTS's convention: the T-matrix phase matrix is the Mueller matrix of its amplitude matrix, and F34 changes
sign in Mie, the T-matrix and their habits.
When Zeeman or surfaces also produce V, I and Q change at the order of that coupling.
T-matrix in C++. Mishchenko's solver is ported, and the Fortran is removed. The port computes in double precision
throughout (the original stored the T-matrix in single precision). It evaluates the amplitude at the angles given,
and it computes the orientation average with exact Clebsch-Gordan coefficients (wigxjpf).
Azimuthally random orientation (new). Particles with a distribution of tilts from the vertical and random azimuth,
such as aligned ice or falling drops. They give the full phase matrix, the extinction (K11, K12, K34) and the
absorption (I, Q) on ARTS's grids, as native ARO habits. The azimuthal average and the absorption integral use the
number of nodes that the band limits of the truncated T-matrix make exact (derived in
concept.tmatrix). They arechecked against Mie, against random orientation (uniform tilts) and against twice the nodes.
Generalized Chebyshev particles (new). Raindrop shapes r0 (1 + c0 + sum c_n cos n theta) with the user's
coefficients. The original fixed one drop's coefficients in its code and could not compute random orientation for
them.
Bugs fixed
truncation n1 grows: errors of 1e-14 at n1 = 14, 1.4e-6 at n1 = 100, and about 1e8 at n1 = 240, the limit ARTS had
raised it to. The exact coefficients remove this.
angles and then interpolated linearly in the scattering angle, about 1.4 % off for a Rayleigh-size T-matrix habit.
The series is now evaluated at each direction pair's exact scattering angle. This affects every spectral TRO habit
used by an ARO consumer (MC, RT4, VDISORT).
parallel below a cross product of 1e-12, about 4500 eps:
The bound is now 16 eps. The plane is also projected back across the incident ray; without that projection,
rounding distorted the phase matrix by about (eps / |k_in x k_out|)^2 even for a regular F.
used the pole limits within 1.4e-5 rad of the axis, an error of about 2e-5 there. Its arccos angle lost sqrt(eps).
Angles now come from atan2 of the components, and the limits are used only on the axis itself.
the root lay outside, which gave the wrong distribution for large variances (b = 10 has r1 ~ 3e-9 a). It is now
found on the whole interval, and a root that double precision cannot resolve is an error.
and it ended the expansion series at a fixed threshold whatever the requested accuracy. The series is now
complete, and non-convergence is an error, also for a T-matrix that is not finite. Such matrices were handed to
LAPACK, where the outcome depended on the BLAS library.
matrix_expwas wrong. Its Padé denominator had the wrong sign for even powers, 7 % off at |A| ~ 1, becausenonstd::pow(-1, k)returned -1 for every k.nonstd::powreturned -|x|^v for negative x. It is now defined forx >= 0 only, and integer powers use exact forms. No production code called
matrix_exp.ExtinctionMatrixData<ARO>::extract_stokes_coeffshad never compiled;For owners of legacy scattering data
ARTS2-format data (and probably the ARTS-SSDB) appear to use Mishchenko's convention: the regenerated MC fixture
matches the ARTS2 XML only in that convention. ARTS3 reads them without conversion, so their F34, and the U rows and
columns of their ARO phase matrices, have the opposite sign to ARTS's convention. This PR does not change the legacy
readers. Each database's convention, including how it defines the azimuth, should be checked and converted on read.
Evidence
The T-matrix is checked against:
generalized Chebyshev particles, all size distributions);