ATMOS_NRLMSISE00
This function computes atmospheric temperature, mass density, and pressure using the NRLMSISE-00 empirical atmosphere model. The model supports conditions from near ground level to the upper atmosphere and accounts for geophysical inputs including location, day-of-year, and solar flux.
The pressure value reported by this model interface is derived from ideal-gas relationships applied to modeled species densities and temperature:
P = \rho R T
Inputs include altitude, latitude, longitude, time-of-year, and solar activity proxies (f107 and f107_{avg}). Results are returned as a single-row 2D array for spreadsheet compatibility.
Excel Usage
=ATMOS_NRLMSISE00(z, latitude, longitude, day, seconds, daily_flux, avg_flux)
z(float, required): Elevation above sea level in meters.latitude(float, optional, default: 0): Latitude in degrees (-90 to 90).longitude(float, optional, default: 0): Longitude in degrees (-180 to 180).day(int, optional, default: 0): Day of year (0-366).seconds(float, optional, default: 0): Seconds since start of day (UT1 time).daily_flux(float, optional, default: 150): Daily average 10.7 cm solar flux.avg_flux(float, optional, default: 150): 81-day average solar flux.
Returns (list[list]): 2D list [[Temperature, Density, Pressure]], or error string.
Example 1: Standard Atmosphere at 1 km
Inputs:
| z | latitude | longitude | day | seconds | daily_flux | avg_flux |
|---|---|---|---|---|---|---|
| 1000 | 0 | 0 | 0 | 0 | 150 | 150 |
Excel formula:
=ATMOS_NRLMSISE00(1000, 0, 0, 0, 0, 150, 150)
Expected output:
| Result | ||
|---|---|---|
| 293.656 | 1.05754 | 89219.1 |
Example 2: Mid-latitude Summer Day at 5 km
Inputs:
| z | latitude | longitude | day | seconds | daily_flux | avg_flux |
|---|---|---|---|---|---|---|
| 5000 | 45 | 45 | 180 | 0 | 150 | 150 |
Excel formula:
=ATMOS_NRLMSISE00(5000, 45, 45, 180, 0, 150, 150)
Expected output:
| Result | ||
|---|---|---|
| 263.506 | 0.733251 | 55509.5 |
Example 3: High Altitude at Equator (20 km)
Inputs:
| z | latitude | longitude | day | seconds | daily_flux | avg_flux |
|---|---|---|---|---|---|---|
| 20000 | 0 | 0 | 100 | 0 | 150 | 150 |
Excel formula:
=ATMOS_NRLMSISE00(20000, 0, 0, 100, 0, 150, 150)
Expected output:
| Result | ||
|---|---|---|
| 206.28 | 0.0955605 | 5663.17 |
Example 4: Custom Solar Flux at 10 km
Inputs:
| z | latitude | longitude | day | seconds | daily_flux | avg_flux |
|---|---|---|---|---|---|---|
| 10000 | 30 | -90 | 50 | 36000 | 200 | 180 |
Excel formula:
=ATMOS_NRLMSISE00(10000, 30, -90, 50, 36000, 200, 180)
Expected output:
| Result | ||
|---|---|---|
| 227.886 | 0.424547 | 27795 |
Python Code
Show Code
from fluids.atmosphere import ATMOSPHERE_NRLMSISE00 as fluids_ATMOSPHERE_NRLMSISE00
def atmos_nrlmsise00(z, latitude=0, longitude=0, day=0, seconds=0, daily_flux=150, avg_flux=150):
"""
Compute temperature, density, and pressure using the NRLMSISE-00 atmospheric model.
See: https://fluids.readthedocs.io/fluids.atmosphere.html
This example function is provided as-is without any representation of accuracy.
Args:
z (float): Elevation above sea level in meters.
latitude (float, optional): Latitude in degrees (-90 to 90). Default is 0.
longitude (float, optional): Longitude in degrees (-180 to 180). Default is 0.
day (int, optional): Day of year (0-366). Default is 0.
seconds (float, optional): Seconds since start of day (UT1 time). Default is 0.
daily_flux (float, optional): Daily average 10.7 cm solar flux. Default is 150.
avg_flux (float, optional): 81-day average solar flux. Default is 150.
Returns:
list[list]: 2D list [[Temperature, Density, Pressure]], or error string.
"""
try:
# Validate input types and ranges
z = float(z)
latitude = float(latitude)
longitude = float(longitude)
day = int(day)
seconds = float(seconds)
daily_flux = float(daily_flux)
avg_flux = float(avg_flux)
except Exception:
return "Error: Invalid input types."
try:
if not (-90 <= latitude <= 90):
return "Error: latitude must be between -90 and 90 degrees."
if not ((-180 <= longitude <= 180) or (0 <= longitude <= 360)):
return "Error: longitude must be between -180 and 180 degrees or 0 and 360 degrees."
if not (0 <= day <= 366):
return "Error: day must be between 0 and 366."
result = fluids_ATMOSPHERE_NRLMSISE00(z, latitude, longitude, day, seconds, daily_flux, avg_flux)
T = float(result.T)
rho = float(result.rho)
P = float(result.P)
return [[T, rho, P]]
except Exception as e:
return f"Error: {str(e)}"