The US Standard Atmosphere 1976 is a model of the Earth’s atmosphere
that defines temperature, pressure, and density as functions of altitude.
It is valid from sea level to approximately 86 km altitude.
Compute atmospheric properties using International Standard Atmosphere (ISA).
This is essentially the troposphere portion of US Standard Atmosphere 1976
with an optional temperature offset for non-standard days.
Parameters:
altitude (array_like) – Geometric altitude in meters.
temperature_offset (float, optional) – Temperature offset from ISA conditions in Kelvin (default: 0).
Positive values indicate warmer than standard day.
altitude (array_like) – Geometric altitude in meters.
Returns:
mach – Mach number.
Return type:
ndarray
Examples
>>> # Aircraft at 300 m/s at sea level>>> mach_number(300,0)0.88...>>> # Same speed at 10 km altitude (lower speed of sound)>>> mach_number(300,10000)1.00...
This is a comprehensive thermosphere model covering altitudes from
approximately -5 km to 1000 km, with detailed chemical composition
and temperature profiles.
The model implements:
- Temperature profile with solar activity and magnetic coupling
- Molecular composition for troposphere/stratosphere/mesosphere
- Atomic species for thermosphere
- Solar flux (F10.7) and magnetic activity (Ap) variations
Parameters:
use_meter_altitude (bool, optional) – If True, expect altitude input in meters. If False, expect km.
Default is True (meters).
This implementation uses empirical correlations for atmospheric
properties as a function of geomagnetic and solar activity indices.
For highest accuracy, use the original NRLMSISE-00 Fortran code
from NASA/NOAA, which includes extensive coefficient tables.
Compute ionospheric delay using the Klobuchar model.
The Klobuchar model is the standard GPS broadcast ionospheric
correction model. It provides single-frequency ionospheric
delay estimates accurate to about 50% RMS.
Parameters:
latitude (array_like) – User geodetic latitude in radians.
longitude (array_like) – User geodetic longitude in radians.
elevation (array_like) – Satellite elevation angle in radians.
azimuth (array_like) – Satellite azimuth angle in radians.
gps_time (array_like) – GPS time of week in seconds.
coefficients (KlobucharCoefficients, optional) – Ionospheric coefficients from GPS navigation message.
If None, uses default mid-latitude values.
Returns:
delay – Ionospheric delay in meters (at L1 frequency).
Return type:
ndarray
Examples
>>> # User at 40°N, 105°W, satellite at 45° elevation>>> delay=klobuchar_delay(... np.radians(40),np.radians(-105),... np.radians(45),np.radians(180),... gps_time=43200# Noon... )>>> delay>0True
Notes
The Klobuchar model assumes a thin-shell ionosphere at 350 km altitude
and uses a cosine model for diurnal variation. It typically removes
about 50% of the ionospheric delay.
Compute ionospheric delay from Total Electron Content.
Parameters:
tec (array_like) – Total Electron Content in TECU (10^16 electrons/m²).
frequency (float, optional) – Signal frequency in Hz. Default is GPS L1.
Returns:
delay – Ionospheric delay in meters.
Return type:
ndarray
Examples
>>> # Typical mid-latitude TEC of 20 TECU>>> delay=ionospheric_delay_from_tec(20.0)>>> delay>0True>>> # Delay at L2 is larger than at L1 (lower frequency)>>> delay_l2=ionospheric_delay_from_tec(20.0,frequency=F_L2)>>> delay_l2>delayTrue
Simplified International Reference Ionosphere (IRI) model.
This provides approximate electron density and TEC values based on
simplified IRI physics. For accurate predictions, use the full IRI
model or external services.
Parameters:
latitude (array_like) – Geodetic latitude in radians.
longitude (array_like) – Geodetic longitude in radians.
altitude (array_like) – Altitude in meters.
hour (array_like) – Local hour (0-24).
month (int, optional) – Month of year (1-12). Default is 6 (June).
solar_flux (float, optional) – F10.7 solar flux in SFU. Default is 150 (moderate activity).
Returns:
state – Ionospheric state with TEC, delays, and F2 layer parameters.
This is a simplified empirical model suitable for educational purposes
and rough estimates. For operational use, the full IRI-2020 model
should be employed.
Uses a simple dipole approximation with the magnetic pole at
approximately 80.5°N, 72.8°W.
Parameters:
latitude (array_like) – Geodetic latitude in radians.
longitude (array_like) – Geodetic longitude in radians.
Returns:
mag_lat – Geomagnetic latitude in radians.
Return type:
ndarray
Examples
>>> importnumpyasnp>>> # New York City (40.7°N, 74°W)>>> mag_lat=magnetic_latitude(np.radians(40.7),np.radians(-74))>>> np.degrees(mag_lat)51.4...>>> # Equator at 0° longitude>>> mag_lat_eq=magnetic_latitude(0.0,0.0)>>> np.abs(np.degrees(mag_lat_eq))<15# Near magnetic equatorTrue
Provides a rough estimate of amplitude scintillation based on
geomagnetic latitude, local time, and geomagnetic activity.
Parameters:
magnetic_latitude (array_like) – Geomagnetic latitude in radians.
hour (array_like) – Local hour (0-24).
kp_index (float, optional) – Kp geomagnetic activity index (0-9). Default is 3 (moderate).
Returns:
s4 – S4 amplitude scintillation index (0-1).
Return type:
ndarray
Examples
>>> importnumpyasnp>>> # Equatorial region at night (high scintillation risk)>>> s4=scintillation_index(np.radians(10),21,kp_index=5.0)>>> s4>0.3# Moderate to strong scintillationTrue>>> # Mid-latitude during daytime (low scintillation)>>> s4_low=scintillation_index(np.radians(45),12,kp_index=1.0)>>> s4_low<0.2True
Notes
S4 > 0.3 indicates moderate scintillation.
S4 > 0.6 indicates strong scintillation that may affect receivers.
The US Standard Atmosphere 1976 is a model of the Earth’s atmosphere
that defines temperature, pressure, and density as functions of altitude.
It is valid from sea level to approximately 86 km altitude.
Compute atmospheric properties using International Standard Atmosphere (ISA).
This is essentially the troposphere portion of US Standard Atmosphere 1976
with an optional temperature offset for non-standard days.
Parameters:
altitude (array_like) – Geometric altitude in meters.
temperature_offset (float, optional) – Temperature offset from ISA conditions in Kelvin (default: 0).
Positive values indicate warmer than standard day.
altitude (array_like) – Geometric altitude in meters.
Returns:
mach – Mach number.
Return type:
ndarray
Examples
>>> # Aircraft at 300 m/s at sea level>>> mach_number(300,0)0.88...>>> # Same speed at 10 km altitude (lower speed of sound)>>> mach_number(300,10000)1.00...
High-fidelity empirical thermosphere density and temperature model including
solar activity and geomagnetic storm effects. Covers altitudes 0-1000 km with
full atmospheric composition.
NRLMSISE-00 Atmospheric Model
High-fidelity thermosphere/atmosphere model from the U.S. Naval Research
Laboratory. Provides density, temperature, and composition profiles for
altitudes from -5 km to 1000 km.
This implementation uses an empirical approach based on atmospheric chemistry,
radiative transfer, and geomagnetic coupling for modeling temperature and
density variations with altitude, latitude, local time, and solar/magnetic activity.
This is a comprehensive thermosphere model covering altitudes from
approximately -5 km to 1000 km, with detailed chemical composition
and temperature profiles.
The model implements:
- Temperature profile with solar activity and magnetic coupling
- Molecular composition for troposphere/stratosphere/mesosphere
- Atomic species for thermosphere
- Solar flux (F10.7) and magnetic activity (Ap) variations
Parameters:
use_meter_altitude (bool, optional) – If True, expect altitude input in meters. If False, expect km.
Default is True (meters).
This implementation uses empirical correlations for atmospheric
properties as a function of geomagnetic and solar activity indices.
For highest accuracy, use the original NRLMSISE-00 Fortran code
from NASA/NOAA, which includes extensive coefficient tables.