test_spacecraftChargingEquilibrium

Python reimplementation of spacecraft charging equilibrium math for unit-test cross-checks.

class test_spacecraftChargingEquilibrium.BeamParameters(energy_eb: float, current_eb: float, alpha_eb: float)[source]

Bases: object

Electron-beam parameters matching ElectronBeamMsgPayload fields.

class test_spacecraftChargingEquilibrium.SpacecraftChargingEquilibriumCppReference(energies: ndarray, electron_flux: ndarray, ion_flux: ndarray, yield_see_electron: ndarray, yield_see_ion: ndarray, yield_backscattered: ndarray)[source]

Bases: object

Ground-truth reference implementation matching spacecraftChargingEquilibrium C++ math.

static interp(x_vector: ndarray, y_vector: ndarray, x: float) float[source]

Linear interpolation with the same edge behavior as C++ interp().

static trapz(f: Callable[[float], float], a: float, b: float, n: int) float[source]

Trapezoidal integration matching spacecraftChargingEquilibrium.cpp::trapz().

test_spacecraftChargingEquilibrium.test_cpp_requires_exactly_two_spacecraft(support_data)[source]

Single-spacecraft run should fail reset with the exact-two-spacecraft precondition.

test_spacecraftChargingEquilibrium.test_cpp_vs_python_beam_parameter_cases(support_data, energy_eb, current_eb, alpha_eb)[source]

Compare C++ and Python equilibrium outputs across beam parameter cases.

test_spacecraftChargingEquilibrium.test_cpp_vs_python_plasma_scaling_cases(support_data, scale_electron_flux, scale_ion_flux)[source]

Compare C++ and Python equilibrium outputs across plasma scaling cases.

test_spacecraftChargingEquilibrium.test_cpp_vs_python_sunlit_area_override_cases(support_data, servicer_sunlit_area, target_sunlit_area)[source]

Compare C++ and Python equilibrium outputs when sunlit areas are overridden.

test_spacecraftChargingEquilibrium.test_cpp_vs_python_zero_padded_plasma_bins(support_data)[source]

Ensure trailing zero-filled plasma bins are ignored consistently.

Verify target-potential trend ordering across electron/ion flux scaling.

test_spacecraftChargingEquilibrium.test_python_reimplementation_matches_cpp_module(support_data)[source]

Baseline cross-check under nominal plasma and beam settings.

test_spacecraftChargingEquilibrium.test_target_current_breakdown_cpp_vs_python_equilibrium_beam_cases(support_data, energy_eb, current_eb, alpha_eb)[source]

Compare C++ current-message target terms to Python terms at equilibrium.

test_spacecraftChargingEquilibrium.test_target_current_breakdown_cpp_vs_python_near_equilibrium(support_data, target_sunlit_area)[source]

Compare C++ current-message target terms across sunlit-area settings.