test_gravity_model_configuration
Tests for the Python GravBodyData gravity-model configuration API.
- test_gravity_model_configuration.test_gravity_model_access_errors_name_current_configuration_methods()[source]
Verify model access errors direct users only to the supported configuration API.
- test_gravity_model_configuration.test_legacy_gravity_model_flags_are_read_only()[source]
Verify the expired model-selection flag setters are no longer available.
- test_gravity_model_configuration.test_spherical_harmonics_body_mu_is_consistent(mu_case)[source]
Require a valid body GM and use it for both acceleration and gravity-gradient torque.
A degree-zero model isolates the central gravity field. Invalid body GMs must stop simulation initialization even when the coefficient file supplies a valid GM. Valid cases use either an explicit body GM different from the file or an explicit copy of the file GM. The published planet GM, spacecraft acceleration, and gravity-gradient torque must all agree with the chosen body GM.
- Parameters:
mu_case – Body GM configuration to exercise.
- test_gravity_model_configuration.test_spherical_harmonics_field_uses_reference_radius_of_file(tmp_path)[source]
Verify the computed field is scaled by the reference radius of the coefficient file.
A coefficient file with only the normalized \(\bar{C}_{20}\) term is loaded into a body whose equatorial radius and gravitational parameter differ from those of the file. The field computed after initializing the body is compared against the closed-form \(J_2\) acceleration, which uses the reference radius of the file and the
muof the body.
- test_gravity_model_configuration.test_spherical_harmonics_keep_reference_radius_of_file()[source]
Verify initializing the body keeps the reference radius of the coefficient file.
The factory Mars radius differs from the reference radius of
GGM2BData.txt. The field must keep the radius of the file, the body radius must be left unchanged, and the field must use the bodymu.