test_dentonFluxModel
- test_dentonFluxModel.dentonFluxModelTestFunction(show_plots, param1_Kp, param2_LT, param3_z, param4_r_EN, accuracy)[source]
Test method
- test_dentonFluxModel.denton_constant_files(tmp_path_factory)[source]
Create complete electron and ion tables with constant logarithmic fluxes.
- test_dentonFluxModel.denton_file_model(denton_constant_files)[source]
Configure a model at local noon for testing data-file initialization.
- test_dentonFluxModel.denton_flux_output(tables, kp_index, num_energies, local_time, sun_direction)[source]
Evaluate the module once at the requested local time in hours.
- test_dentonFluxModel.denton_interpolation_tables()[source]
Load the table rows bracketing the endpoint energies used in these tests.
- test_dentonFluxModel.test_dentonFluxModel(show_plots, param1_Kp, param2_LT, param3_z, param4_r_EN, accuracy)[source]
Validation Test Description
The Denton Flux Module is tested for several different Kp indices, local times, and spacecraft/Sun/Earth positions
Test Parameters
- Parameters:
show_plots (bool) – specify if plots should be shown
param1_Kp (str) – Kp Index
param2_LT (float) – Local Time (use 2 decimals)
param3_z (float) – z-offset to test spacecraft and Sun position with offset to equatorial plane
param4_r_EN (float np.array) – r_EN_N position vector of Earth w.r.t. N frame, in N frame components
accuracy (float) – absolute accuracy value used in the validation tests
Description of Variables Being Tested
The electron and ion energies are compared to make sure the flux data is computed for the same energy. The main part of the unitTest is to compare the electron and ion flux.
- test_dentonFluxModel.test_dentonFluxModel_complete_data_files(denton_file_model, denton_constant_files, tmp_path, trailing_whitespace)[source]
Accept a complete table with or without trailing whitespace and preserve its fluxes.
- test_dentonFluxModel.test_dentonFluxModel_invalid_data_file(denton_file_model, denton_constant_files, tmp_path, species, value_index, replacement)[source]
Reject missing or invalid values in either file, including unused statistics.
- test_dentonFluxModel.test_dentonFluxModel_invalid_output_energy_count(num_energies)[source]
Reject invalid counts before dividing by the count or accessing the energy arrays.
- test_dentonFluxModel.test_dentonFluxModel_missing_file_format_string()[source]
Validation Test Description
This test verifies that missing Denton data file paths are logged as string data, even when the path contains format specifiers.
- test_dentonFluxModel.test_dentonFluxModel_output_energy_bounds(denton_interpolation_tables, num_energies, last_energy)[source]
Check the full output energy grid and endpoint fluxes at the storage boundaries.
- test_dentonFluxModel.test_dentonFluxModel_periodic_interpolation(denton_interpolation_tables, kp_index, kp_row, local_time, sun_direction)[source]
Check both species against independent interpolation of the source tables.
Cover every whole hour, both sides of noon and midnight, and the last Kp and energy bins. Include rotated Sun directions and exactly 24 h, where rounding can leave the normalized dot product above -1. Expected values interpolate in log energy first, then periodically in local time.