Found by the #90 units sweep (PR #169).
The float overload of satkit.density.nrlmsise is documented (stub density.pyi) as taking latitude_rad / longitude_rad in radians, consistent with satkit's convention (radians unless a _deg suffix). But python/src/pydensity.rs passes the two floats unchanged to nrlmsise::nrlmsise, which takes degrees — the same slot the itrfcoord overload fills with latitude_deg() / longitude_deg() (fixed in #154), and that satkit.nrlmsise00(..., latitude_deg=, longitude_deg=) fills explicitly in degrees.
So a caller following the stub, e.g. density.nrlmsise(400e3, math.radians(60), math.radians(-70), t), is evaluated at latitude 1.05° / longitude −1.2° instead of 60° / −70°: a different atmosphere (the existing test_density_itrfcoord_matches_degree_call shows the two interpretations differ by well over 0.1 % in density; more at high latitude during storms).
Fix: convert with .to_degrees() in the float branch of pydensity.rs, and add a test that the float form with radians matches the itrfcoord form for the same point. Stub and docs are already correct.
🤖 Generated with Claude Code
https://claude.ai/code/session_01PG969yapJ84DJceKt21Wen
Found by the #90 units sweep (PR #169).
The float overload of
satkit.density.nrlmsiseis documented (stubdensity.pyi) as takinglatitude_rad/longitude_radin radians, consistent with satkit's convention (radians unless a_degsuffix). Butpython/src/pydensity.rspasses the two floats unchanged tonrlmsise::nrlmsise, which takes degrees — the same slot theitrfcoordoverload fills withlatitude_deg()/longitude_deg()(fixed in #154), and thatsatkit.nrlmsise00(..., latitude_deg=, longitude_deg=)fills explicitly in degrees.So a caller following the stub, e.g.
density.nrlmsise(400e3, math.radians(60), math.radians(-70), t), is evaluated at latitude 1.05° / longitude −1.2° instead of 60° / −70°: a different atmosphere (the existingtest_density_itrfcoord_matches_degree_callshows the two interpretations differ by well over 0.1 % in density; more at high latitude during storms).Fix: convert with
.to_degrees()in the float branch ofpydensity.rs, and add a test that the float form with radians matches theitrfcoordform for the same point. Stub and docs are already correct.🤖 Generated with Claude Code
https://claude.ai/code/session_01PG969yapJ84DJceKt21Wen