yasfpy.benchmark.compare_mstm4#

Comparison utilities for MSTM4 reference results.

Contains helpers/data structures to compare YASF output to MSTM4 and summarize error metrics.

Classes#

CompareResult

Container for comparison outputs.

Functions#

compare_single_sphere(*, tmp_dir, wavelength, radius, ...)

Run YASF and MSTM4 for a single sphere and compare efficiencies.

Module Contents#

class yasfpy.benchmark.compare_mstm4.CompareResult#

Container for comparison outputs.

This data structure groups the key arrays extracted from YASF and MSTM4 runs (efficiencies, phase function, and polarization diagnostics).

wavelength: numpy.ndarray#
yasf_q_ext: numpy.ndarray#
yasf_q_sca: numpy.ndarray#
mstm_q_ext_unp: numpy.ndarray#
mstm_q_sca_unp: numpy.ndarray#
phase_theta: numpy.ndarray#
yasf_phase_function: numpy.ndarray#
mstm_phase_function: numpy.ndarray#
yasf_phase_integral: numpy.ndarray#
mstm_phase_integral: numpy.ndarray#
yasf_dolp: numpy.ndarray#
mstm_dolp: numpy.ndarray#
yasfpy.benchmark.compare_mstm4.compare_single_sphere(*, tmp_dir, wavelength, radius, sphere_refractive_index, medium_refractive_index=1.0 + 0j, lmax=10, solver_type='gmres', solver_tolerance=1e-08, solver_max_iter=2000, solver_restart=2000, mstm_parallel=4, mstm_binary='mstm')#

Run YASF and MSTM4 for a single sphere and compare efficiencies.

This helper is designed for tests/benchmarks and intentionally avoids network refractive-index sources by creating local constant w,n,k CSV tables that refidxdb.Handler can load.

Notes

YASF "UNP" corresponds to a single combined polarization state (not a TE/TM average). MSTM provides explicit unpolarized-incidence efficiencies. For an apples-to-apples comparison, use MSTM’s q_*_unp outputs.