nasa-earthdata

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

NASA Earthdata Database Skill

NASA Earthdata数据库技能

Access atmospheric properties, standard atmosphere models, and aerospace environmental data from NASA's Earthdata platform for aerospace pump design, high-altitude systems, and atmospheric flight analysis.
从NASA的Earthdata平台获取大气特性、标准大气模型及航空航天环境数据,用于航空航天泵设计、高空系统与大气飞行分析。

Overview

概述

NASA Earthdata provides free access to Earth science data from multiple NASA missions and instruments. For aerospace engineering applications, it offers:
  • Atmospheric Properties: Temperature, pressure, density profiles vs altitude
  • Standard Atmosphere Models: US Standard Atmosphere (1976), MSIS, NRLMSISE-00
  • Wind Data: Global wind profiles, jet streams, seasonal variations
  • Temperature Profiles: Troposphere through thermosphere
  • Pressure Profiles: Sea level to exosphere
  • Geopotential Height: Standard atmosphere reference
  • Composition Data: Atmospheric gas composition by altitude
  • Environmental Conditions: Humidity, precipitation, cloud cover
Key Applications:
  • High-altitude pump and compressor design
  • Aircraft and rocket environmental conditions
  • Aerospace fluid system analysis
  • Thermal control system design
  • Aerodynamic heating calculations
  • Launch window planning
NASA Earthdata免费提供来自多个NASA任务与仪器的地球科学数据。针对航空航天工程应用,它提供:
  • 大气特性:温度、压力、密度随海拔变化的剖面数据
  • 标准大气模型:美国标准大气(1976)、MSIS、NRLMSISE-00
  • 风场数据:全球风剖面、急流、季节变化
  • 温度剖面:从对流层到热层
  • 压力剖面:海平面到外逸层
  • 位势高度:标准大气参考值
  • 成分数据:不同海拔的大气气体成分
  • 环境条件:湿度、降水、云量
核心应用场景:
  • 高空泵与压缩机设计
  • 飞机与火箭的环境条件分析
  • 航空航天流体系统分析
  • 热控系统设计
  • 气动加热计算
  • 发射窗口规划

Free Registration Required

需免费注册

NASA Earthdata is free but requires user registration.
NASA Earthdata是免费的,但需要用户注册。

Registration Process

注册流程

  1. Create Earthdata Account
  2. Approve Applications
    • Some datasets require application approval
    • Navigate to: https://urs.earthdata.nasa.gov/home
    • Click "My Applications" → "Approve More Applications"
    • Approve required data services (e.g., GES DISC, ASDC)
  3. Save Credentials
    • Username: Your email or chosen username
    • Password: Your account password
    • Store securely (needed for API access)
  1. 创建Earthdata账户
  2. 授权应用
    • 部分数据集需要应用授权
    • 访问:https://urs.earthdata.nasa.gov/home
    • 点击「我的应用」→「授权更多应用」
    • 授权所需的数据服务(如GES DISC、ASDC)
  3. 保存凭证
    • 用户名:你的邮箱或自定义用户名
    • 密码:你的账户密码
    • 安全存储(API访问时需要)

Authentication Setup

身份验证设置

Method 1: Username/Password Authentication

方法1:用户名/密码验证

python
import requests
from requests.auth import HTTPBasicAuth
python
import requests
from requests.auth import HTTPBasicAuth

Your Earthdata credentials

Your Earthdata credentials

username = "your_earthdata_username" password = "your_earthdata_password"
username = "your_earthdata_username" password = "your_earthdata_password"

Example: Access data with authentication

Example: Access data with authentication

url = "https://goldsmr4.gesdisc.eosdis.nasa.gov/data/MERRA2/..." response = requests.get(url, auth=HTTPBasicAuth(username, password))
undefined
url = "https://goldsmr4.gesdisc.eosdis.nasa.gov/data/MERRA2/..." response = requests.get(url, auth=HTTPBasicAuth(username, password))
undefined

Method 2: .netrc File (Recommended)

方法2:.netrc文件(推荐)

Create a
.netrc
file for automatic authentication:
Linux/Mac (
~/.netrc
):
bash
machine urs.earthdata.nasa.gov
    login your_username
    password your_password
Set permissions:
bash
chmod 600 ~/.netrc
Windows (
C:\Users\YourName\_netrc
):
machine urs.earthdata.nasa.gov
    login your_username
    password your_password
Python with .netrc:
python
import requests
创建
.netrc
文件实现自动验证:
Linux/Mac
~/.netrc
):
bash
machine urs.earthdata.nasa.gov
    login your_username
    password your_password
设置权限:
bash
chmod 600 ~/.netrc
Windows
C:\Users\YourName\_netrc
):
machine urs.earthdata.nasa.gov
    login your_username
    password your_password
使用.netrc的Python代码
python
import requests

Authentication automatically used from .netrc

Authentication automatically used from .netrc

url = "https://goldsmr4.gesdisc.eosdis.nasa.gov/data/..." response = requests.get(url)
undefined
url = "https://goldsmr4.gesdisc.eosdis.nasa.gov/data/..." response = requests.get(url)
undefined

Method 3: Token-Based Authentication

方法3:基于令牌的验证

Generate a token for programmatic access:
  1. Log in to Earthdata: https://urs.earthdata.nasa.gov/
  2. Navigate to "My Profile" → "Generate Token"
  3. Copy the token
Using token in Python:
python
import requests

token = "your_generated_token"
headers = {"Authorization": f"Bearer {token}"}

url = "https://api.earthdata.nasa.gov/..."
response = requests.get(url, headers=headers)
生成令牌用于程序化访问:
  1. 登录Earthdata:https://urs.earthdata.nasa.gov/
  2. 进入「我的资料」→「生成令牌」
  3. 复制令牌
在Python中使用令牌
python
import requests

token = "your_generated_token"
headers = {"Authorization": f"Bearer {token}"}

url = "https://api.earthdata.nasa.gov/..."
response = requests.get(url, headers=headers)

Available Datasets for Aerospace Applications

适用于航空航天应用的可用数据集

1. Standard Atmosphere Models

1. 标准大气模型

MSIS (Mass Spectrometer Incoherent Scatter)

MSIS(质谱非相干散射模型)

  • Description: Empirical atmospheric model
  • Altitude Range: 0 km to 1000 km
  • Parameters: Temperature, density, composition
  • Temporal: Time-dependent (solar activity, season)
  • Use Case: High-altitude aircraft, rockets, satellites
  • 描述:经验大气模型
  • 海拔范围:0公里至1000公里
  • 参数:温度、密度、成分
  • 时间特性:随时间变化(太阳活动、季节)
  • 应用场景:高空飞行器、火箭、卫星

NRLMSISE-00 (Naval Research Laboratory MSIS Extended)

NRLMSISE-00(美国海军研究实验室MSIS扩展模型)

  • Description: Extended atmospheric model to thermosphere
  • Altitude Range: 0 km to 2000 km
  • Parameters: T, P, ρ, composition (N₂, O₂, O, He, H, Ar, N)
  • Inputs: Altitude, latitude, longitude, date, time, solar activity
  • Use Case: Spacecraft drag, upper atmosphere analysis
  • 描述:扩展至热层的大气模型
  • 海拔范围:0公里至2000公里
  • 参数:温度(T)、压力(P)、密度(ρ)、成分(N₂、O₂、O、He、H、Ar、N)
  • 输入参数:海拔、纬度、经度、日期、时间、太阳活动
  • 应用场景:航天器阻力分析、高层大气研究

US Standard Atmosphere (1976)

美国标准大气(1976)

  • Description: Static atmospheric model
  • Altitude Range: 0 km to 1000 km
  • Layers: Troposphere, stratosphere, mesosphere, thermosphere
  • Parameters: T, P, ρ, speed of sound
  • Use Case: Baseline design, standardized testing
  • 描述:静态大气模型
  • 海拔范围:0公里至1000公里
  • 分层:对流层、平流层、中间层、热层
  • 参数:温度(T)、压力(P)、密度(ρ)、声速
  • 应用场景:基准设计、标准化测试

2. MERRA-2 (Modern-Era Retrospective analysis)

2. MERRA-2(现代回顾性分析数据集)

Real atmospheric data from NASA reanalysis:
  • Spatial Resolution: 0.5° × 0.625° (lat × lon)
  • Temporal Resolution: Hourly, 3-hourly, daily, monthly
  • Altitude Levels: Surface to 0.01 hPa (~80 km)
  • Time Period: 1980 to present (updated ongoing)
Available Parameters:
  • Temperature (T) [K]
  • Pressure (P) [Pa]
  • Density (ρ) [kg/m³]
  • Wind components (U, V, W) [m/s]
  • Geopotential height [m]
  • Relative humidity [%]
  • Specific humidity [kg/kg]
Aerospace Applications:
  • Flight envelope analysis
  • Wind shear assessment
  • Thermal environment modeling
  • Launch trajectory planning
来自NASA再分析的真实大气数据:
  • 空间分辨率:0.5° × 0.625°(纬度×经度)
  • 时间分辨率:逐小时、3小时、每日、每月
  • 海拔层级:地表至0.01 hPa(约80公里)
  • 时间范围:1980年至今(持续更新)
可用参数:
  • 温度(T) [K]
  • 压力(P) [Pa]
  • 密度(ρ) [kg/m³]
  • 风分量(U、V、W) [m/s]
  • 位势高度 [m]
  • 相对湿度 [%]
  • 比湿 [kg/kg]
航空航天应用场景:
  • 飞行包线分析
  • 风切变评估
  • 热环境建模
  • 发射轨迹规划

3. AIRS (Atmospheric Infrared Sounder)

3. AIRS(大气红外探测仪)

High-resolution atmospheric profiles:
  • Spatial Resolution: 50 km
  • Vertical Resolution: 28 pressure levels
  • Parameters: T, P, H₂O, O₃, CO₂
  • Coverage: Global, twice daily
  • Accuracy: ±1 K (temperature), ±15% (humidity)
Use Cases:
  • Precise atmospheric property data
  • Regional atmospheric analysis
  • Flight planning
高分辨率大气剖面数据:
  • 空间分辨率:50公里
  • 垂直分辨率:28个压力层级
  • 参数:温度(T)、压力(P)、H₂O、O₃、CO₂
  • 覆盖范围:全球,每日两次
  • 精度:±1 K(温度)、±15%(湿度)
应用场景:
  • 高精度大气特性数据获取
  • 区域大气分析
  • 飞行规划

4. GEOS (Goddard Earth Observing System)

4. GEOS(戈达德地球观测系统)

Forward-looking atmospheric data:
  • Type: Forecast model (7-day ahead)
  • Resolution: 0.25° × 0.3125°
  • Temporal: 3-hourly
  • Parameters: T, P, winds, humidity, composition
Use Cases:
  • Mission planning
  • Launch forecasting
  • Flight operations
前瞻性大气数据:
  • 类型:预测模型(7天预报)
  • 分辨率:0.25° × 0.3125°
  • 时间分辨率:每3小时
  • 参数:温度(T)、压力(P)、风场、湿度、成分
应用场景:
  • 任务规划
  • 发射预报
  • 飞行操作

API Access Methods

API访问方法

Method 1: OPeNDAP (Open-source Project for Network Data Access Protocol)

方法1:OPeNDAP(开源网络数据访问协议)

Direct data subsetting and download:
python
from pydap.client import open_url
直接进行数据子集化与下载:
python
from pydap.client import open_url

Open MERRA-2 dataset via OPeNDAP

Open MERRA-2 dataset via OPeNDAP

dataset = open_url(url, username="your_username", password="your_password")
dataset = open_url(url, username="your_username", password="your_password")

Access variables

Access variables

temperature = dataset['T'] # Temperature [K] pressure = dataset['PL'] # Pressure levels [Pa] density = dataset['RHO'] # Density [kg/m³]
temperature = dataset['T'] # Temperature [K] pressure = dataset['PL'] # Pressure levels [Pa] density = dataset['RHO'] # Density [kg/m³]

Subset data (e.g., specific altitude and location)

Subset data (e.g., specific altitude and location)

T_subset = temperature[0, :, 100, 200] # time, level, lat, lon
undefined
T_subset = temperature[0, :, 100, 200] # time, level, lat, lon
undefined

Method 2: NASA CMR (Common Metadata Repository)

方法2:NASA CMR(通用元数据存储库)

Search and discover datasets:
python
import requests
搜索与发现数据集:
python
import requests

Search for atmospheric data

Search for atmospheric data

cmr_url = "https://cmr.earthdata.nasa.gov/search/granules.json" params = { 'short_name': 'M2I3NPASM', # MERRA-2 3D atmospheric data 'temporal': '2023-01-01T00:00:00Z,2023-01-31T23:59:59Z', 'bounding_box': '-180,-90,180,90' # Global }
response = requests.get(cmr_url, params=params) granules = response.json()['feed']['entry']
cmr_url = "https://cmr.earthdata.nasa.gov/search/granules.json" params = { 'short_name': 'M2I3NPASM', # MERRA-2 3D atmospheric data 'temporal': '2023-01-01T00:00:00Z,2023-01-31T23:59:59Z', 'bounding_box': '-180,-90,180,90' # Global }
response = requests.get(cmr_url, params=params) granules = response.json()['feed']['entry']

Download URLs

Download URLs

for granule in granules: print(granule['title']) print(granule['links'][0]['href']) # Data URL
undefined
for granule in granules: print(granule['title']) print(granule['links'][0]['href']) # Data URL
undefined

Method 3: Direct HTTP Download

方法3:直接HTTP下载

Download files directly:
python
import requests
from requests.auth import HTTPBasicAuth

username = "your_username"
password = "your_password"
直接下载文件:
python
import requests
from requests.auth import HTTPBasicAuth

username = "your_username"
password = "your_password"

MERRA-2 file URL

MERRA-2 file URL

Download with authentication

Download with authentication

response = requests.get(url, auth=HTTPBasicAuth(username, password), stream=True)
with open("merra2_data.nc4", "wb") as f: for chunk in response.iter_content(chunk_size=8192): f.write(chunk)
print("Download complete")
undefined
response = requests.get(url, auth=HTTPBasicAuth(username, password), stream=True)
with open("merra2_data.nc4", "wb") as f: for chunk in response.iter_content(chunk_size=8192): f.write(chunk)
print("Download complete")
undefined

Method 4: Python earthaccess Library

方法4:Python earthaccess库

Simplified access to NASA Earthdata:
bash
pip install earthaccess
python
import earthaccess
简化访问NASA Earthdata:
bash
pip install earthaccess
python
import earthaccess

Login (uses .netrc or prompts for credentials)

Login (uses .netrc or prompts for credentials)

earthaccess.login()
earthaccess.login()

Search for MERRA-2 data

Search for MERRA-2 data

results = earthaccess.search_data( short_name='M2I3NPASM', cloud_hosted=True, temporal=('2023-01-01', '2023-01-31') )
results = earthaccess.search_data( short_name='M2I3NPASM', cloud_hosted=True, temporal=('2023-01-01', '2023-01-31') )

Download data

Download data

files = earthaccess.download(results[0:5], "./data")
undefined
files = earthaccess.download(results[0:5], "./data")
undefined

Standard Atmosphere Calculation Example

标准大气计算示例

python
import numpy as np

def us_standard_atmosphere_1976(altitude_m):
    """
    Calculate atmospheric properties using US Standard Atmosphere (1976)

    Parameters:
    -----------
    altitude_m : float
        Geometric altitude [m] (0 to 86000 m)

    Returns:
    --------
    dict: {'T': temperature [K],
           'P': pressure [Pa],
           'rho': density [kg/m³],
           'a': speed of sound [m/s]}
    """
    # Constants
    g0 = 9.80665  # Standard gravity [m/s²]
    R = 287.05    # Gas constant for air [J/kg/K]
    gamma = 1.4   # Specific heat ratio

    # Layer definitions [altitude_base, T_base, lapse_rate]
    layers = [
        (0,     288.15, -0.0065),  # Troposphere
        (11000, 216.65,  0.0),     # Tropopause
        (20000, 216.65,  0.001),   # Stratosphere 1
        (32000, 228.65,  0.0028),  # Stratosphere 2
        (47000, 270.65,  0.0),     # Stratopause
        (51000, 270.65, -0.0028),  # Mesosphere 1
        (71000, 214.65, -0.002),   # Mesosphere 2
    ]

    # Find appropriate layer
    h = altitude_m
    for i, (h_base, T_base, L) in enumerate(layers):
        if i + 1 < len(layers):
            h_next = layers[i + 1][0]
            if h >= h_base and h < h_next:
                break
        else:
            if h >= h_base:
                break

    # Base pressure (sea level)
    P_base = 101325  # Pa

    # Calculate pressure at each layer base
    for j, (hb, Tb, Lb) in enumerate(layers[:i+1]):
        if j == 0:
            P_base = 101325
        else:
            h_prev, T_prev, L_prev = layers[j-1]
            if abs(L_prev) < 1e-10:  # Isothermal
                P_base = P_base * np.exp(-g0 * (hb - h_prev) / (R * T_prev))
            else:  # Gradient
                P_base = P_base * (T_prev / (T_prev + L_prev * (hb - h_prev))) ** (g0 / (R * L_prev))

    # Calculate temperature at altitude
    T = T_base + L * (h - h_base)

    # Calculate pressure at altitude
    if abs(L) < 1e-10:  # Isothermal layer
        P = P_base * np.exp(-g0 * (h - h_base) / (R * T_base))
    else:  # Gradient layer
        P = P_base * (T_base / T) ** (g0 / (R * L))

    # Calculate density
    rho = P / (R * T)

    # Speed of sound
    a = np.sqrt(gamma * R * T)

    return {
        'T': T,
        'P': P,
        'rho': rho,
        'a': a
    }
python
import numpy as np

def us_standard_atmosphere_1976(altitude_m):
    """
    Calculate atmospheric properties using US Standard Atmosphere (1976)

    Parameters:
    -----------
    altitude_m : float
        Geometric altitude [m] (0 to 86000 m)

    Returns:
    --------
    dict: {'T': temperature [K],
           'P': pressure [Pa],
           'rho': density [kg/m³],
           'a': speed of sound [m/s]}
    """
    # Constants
    g0 = 9.80665  # Standard gravity [m/s²]
    R = 287.05    # Gas constant for air [J/kg/K]
    gamma = 1.4   # Specific heat ratio

    # Layer definitions [altitude_base, T_base, lapse_rate]
    layers = [
        (0,     288.15, -0.0065),  # Troposphere
        (11000, 216.65,  0.0),     # Tropopause
        (20000, 216.65,  0.001),   # Stratosphere 1
        (32000, 228.65,  0.0028),  # Stratosphere 2
        (47000, 270.65,  0.0),     # Stratopause
        (51000, 270.65, -0.0028),  # Mesosphere 1
        (71000, 214.65, -0.002),   # Mesosphere 2
    ]

    # Find appropriate layer
    h = altitude_m
    for i, (h_base, T_base, L) in enumerate(layers):
        if i + 1 < len(layers):
            h_next = layers[i + 1][0]
            if h >= h_base and h < h_next:
                break
        else:
            if h >= h_base:
                break

    # Base pressure (sea level)
    P_base = 101325  # Pa

    # Calculate pressure at each layer base
    for j, (hb, Tb, Lb) in enumerate(layers[:i+1]):
        if j == 0:
            P_base = 101325
        else:
            h_prev, T_prev, L_prev = layers[j-1]
            if abs(L_prev) < 1e-10:  # Isothermal
                P_base = P_base * np.exp(-g0 * (hb - h_prev) / (R * T_prev))
            else:  # Gradient
                P_base = P_base * (T_prev / (T_prev + L_prev * (hb - h_prev))) ** (g0 / (R * L_prev))

    # Calculate temperature at altitude
    T = T_base + L * (h - h_base)

    # Calculate pressure at altitude
    if abs(L) < 1e-10:  # Isothermal layer
        P = P_base * np.exp(-g0 * (h - h_base) / (R * T_base))
    else:  # Gradient layer
        P = P_base * (T_base / T) ** (g0 / (R * L))

    # Calculate density
    rho = P / (R * T)

    # Speed of sound
    a = np.sqrt(gamma * R * T)

    return {
        'T': T,
        'P': P,
        'rho': rho,
        'a': a
    }

Example usage

Example usage

altitudes = [0, 5000, 10000, 15000, 20000, 30000, 40000] # meters
print("Altitude [m] | T [K] | P [Pa] | ρ [kg/m³] | a [m/s]") print("-" * 65) for h in altitudes: props = us_standard_atmosphere_1976(h) print(f"{h:12.0f} | {props['T']:5.2f} | {props['P']:8.1f} | {props['rho']:9.6f} | {props['a']:6.2f}")
undefined
altitudes = [0, 5000, 10000, 15000, 20000, 30000, 40000] # meters
print("Altitude [m] | T [K] | P [Pa] | ρ [kg/m³] | a [m/s]") print("-" * 65) for h in altitudes: props = us_standard_atmosphere_1976(h) print(f"{h:12.0f} | {props['T']:5.2f} | {props['P']:8.1f} | {props['rho']:9.6f} | {props['a']:6.2f}")
undefined

Applications to Aerospace Pumps and High-Altitude Systems

航空航天泵与高空系统的应用

1. Pump Inlet Conditions

1. 泵入口条件

Altitude effect on pump performance:
python
undefined
海拔对泵性能的影响:
python
undefined

Calculate NPSH available at different altitudes

Calculate NPSH available at different altitudes

def npsh_available(altitude_m, fluid='water', T_fluid=293.15): """ Calculate Net Positive Suction Head Available at altitude
NPSH_a = (P_atm - P_vapor) / (ρ * g) + elevation_head - friction_losses
"""
atm = us_standard_atmosphere_1976(altitude_m)
P_atm = atm['P']  # Atmospheric pressure at altitude

# Water vapor pressure (Antoine equation, simplified)
P_vapor = 611.2 * np.exp(17.67 * (T_fluid - 273.15) / (T_fluid - 29.65))

# Water density (approximate)
rho_water = 1000  # kg/m³
g = 9.81  # m/s²

NPSH_a = (P_atm - P_vapor) / (rho_water * g)

return NPSH_a, P_atm
def npsh_available(altitude_m, fluid='water', T_fluid=293.15): """ Calculate Net Positive Suction Head Available at altitude
NPSH_a = (P_atm - P_vapor) / (ρ * g) + elevation_head - friction_losses
"""
atm = us_standard_atmosphere_1976(altitude_m)
P_atm = atm['P']  # Atmospheric pressure at altitude

# Water vapor pressure (Antoine equation, simplified)
P_vapor = 611.2 * np.exp(17.67 * (T_fluid - 273.15) / (T_fluid - 29.65))

# Water density (approximate)
rho_water = 1000  # kg/m³
g = 9.81  # m/s²

NPSH_a = (P_atm - P_vapor) / (rho_water * g)

return NPSH_a, P_atm

Example: NPSH at various altitudes

Example: NPSH at various altitudes

print("Altitude [m] | P_atm [kPa] | NPSH_a [m]") print("-" * 45) for h in [0, 1000, 2000, 3000, 5000]: npsh, p_atm = npsh_available(h) print(f"{h:12.0f} | {p_atm/1000:11.2f} | {npsh:10.2f}")

**Output:**

Altitude [m] | P_atm [kPa] | NPSH_a [m]

       0 |      101.33 |      10.12
    1000 |       89.88 |       8.96
    2000 |       79.50 |       7.88
    3000 |       70.12 |       6.88
    5000 |       54.05 |       5.12
undefined
print("Altitude [m] | P_atm [kPa] | NPSH_a [m]") print("-" * 45) for h in [0, 1000, 2000, 3000, 5000]: npsh, p_atm = npsh_available(h) print(f"{h:12.0f} | {p_atm/1000:11.2f} | {npsh:10.2f}")

**输出:**

Altitude [m] | P_atm [kPa] | NPSH_a [m]

       0 |      101.33 |      10.12
    1000 |       89.88 |       8.96
    2000 |       79.50 |       7.88
    3000 |       70.12 |       6.88
    5000 |       54.05 |       5.12
undefined

2. High-Altitude Compressor Design

2. 高空压缩机设计

Density variation impacts:
python
undefined
密度变化的影响:
python
undefined

Compressor power requirement vs altitude

Compressor power requirement vs altitude

def compressor_power(mass_flow_kg_s, pressure_ratio, altitude_m, eta_c=0.85): """ Calculate compressor power at different altitudes """ atm = us_standard_atmosphere_1976(altitude_m) T_in = atm['T'] P_in = atm['P'] rho_in = atm['rho']
gamma = 1.4
R = 287.05  # J/kg/K

# Isentropic temperature ratio
T_ratio = pressure_ratio ** ((gamma - 1) / gamma)

# Actual temperature rise
T_out = T_in * (1 + (T_ratio - 1) / eta_c)

# Specific work
w_c = R * (T_out - T_in) / (gamma - 1)

# Power
Power = mass_flow_kg_s * w_c / 1000  # kW

return Power, rho_in, T_in
def compressor_power(mass_flow_kg_s, pressure_ratio, altitude_m, eta_c=0.85): """ Calculate compressor power at different altitudes """ atm = us_standard_atmosphere_1976(altitude_m) T_in = atm['T'] P_in = atm['P'] rho_in = atm['rho']
gamma = 1.4
R = 287.05  # J/kg/K

# Isentropic temperature ratio
T_ratio = pressure_ratio ** ((gamma - 1) / gamma)

# Actual temperature rise
T_out = T_in * (1 + (T_ratio - 1) / eta_c)

# Specific work
w_c = R * (T_out - T_in) / (gamma - 1)

# Power
Power = mass_flow_kg_s * w_c / 1000  # kW

return Power, rho_in, T_in

Example: Compressor at sea level vs high altitude

Example: Compressor at sea level vs high altitude

m_dot = 1.0 # kg/s PR = 3.0 # Pressure ratio
print(f"Compressor Performance (m_dot = {m_dot} kg/s, PR = {PR})") print("Altitude [m] | ρ [kg/m³] | T_in [K] | Power [kW]") print("-" * 60) for h in [0, 5000, 10000, 15000]: P, rho, T = compressor_power(m_dot, PR, h) print(f"{h:12.0f} | {rho:9.4f} | {T:8.2f} | {P:10.2f}")
undefined
m_dot = 1.0 # kg/s PR = 3.0 # Pressure ratio
print(f"Compressor Performance (m_dot = {m_dot} kg/s, PR = {PR})") print("Altitude [m] | ρ [kg/m³] | T_in [K] | Power [kW]") print("-" * 60) for h in [0, 5000, 10000, 15000]: P, rho, T = compressor_power(m_dot, PR, h) print(f"{h:12.0f} | {rho:9.4f} | {T:8.2f} | {P:10.2f}")
undefined

3. Thermal Control Systems

3. 热控系统

Ambient temperature for radiator/heat exchanger design:
python
undefined
散热器/热交换器设计的环境温度:
python
undefined

Heat rejection at altitude

Heat rejection at altitude

def heat_rejection_altitude(Q_reject_W, altitude_m): """ Calculate required radiator area for heat rejection at altitude Assuming natural convection to ambient air """ atm = us_standard_atmosphere_1976(altitude_m) T_amb = atm['T'] rho_amb = atm['rho']
# Simplified convection coefficient (natural convection)
# h ~ ρ^0.5 (density effect)
h_sea_level = 10  # W/m²/K (typical natural convection)
h = h_sea_level * (rho_amb / 1.225) ** 0.5

# Assume radiator surface temperature
T_surface = 350  # K (example: electronics cooling)

# Required area: Q = h * A * ΔT
delta_T = T_surface - T_amb
A_required = Q_reject_W / (h * delta_T)

return A_required, h, T_amb
def heat_rejection_altitude(Q_reject_W, altitude_m): """ Calculate required radiator area for heat rejection at altitude Assuming natural convection to ambient air """ atm = us_standard_atmosphere_1976(altitude_m) T_amb = atm['T'] rho_amb = atm['rho']
# Simplified convection coefficient (natural convection)
# h ~ ρ^0.5 (density effect)
h_sea_level = 10  # W/m²/K (typical natural convection)
h = h_sea_level * (rho_amb / 1.225) ** 0.5

# Assume radiator surface temperature
T_surface = 350  # K (example: electronics cooling)

# Required area: Q = h * A * ΔT
delta_T = T_surface - T_amb
A_required = Q_reject_W / (h * delta_T)

return A_required, h, T_amb

Example

Example

Q = 1000 # W heat rejection print(f"Radiator Area Required for {Q} W Heat Rejection") print("Altitude [m] | T_amb [K] | h [W/m²K] | Area [m²]") print("-" * 60) for h in [0, 5000, 10000, 15000]: A, h_conv, T_amb = heat_rejection_altitude(Q, h) print(f"{h:12.0f} | {T_amb:9.2f} | {h_conv:9.2f} | {A:9.4f}")
undefined
Q = 1000 # W heat rejection print(f"Radiator Area Required for {Q} W Heat Rejection") print("Altitude [m] | T_amb [K] | h [W/m²K] | Area [m²]") print("-" * 60) for h in [0, 5000, 10000, 15000]: A, h_conv, T_amb = heat_rejection_altitude(Q, h) print(f"{h:12.0f} | {T_amb:9.2f} | {h_conv:9.2f} | {A:9.4f}")
undefined

4. Fluid Properties at Altitude

4. 高空流体特性

Cavitation and boiling point considerations:
python
def boiling_point_altitude(fluid='water'):
    """
    Calculate boiling point of water at different altitudes
    """
    print("Boiling Point vs Altitude (Water)")
    print("Altitude [m] | P_atm [kPa] | T_boil [°C]")
    print("-" * 50)

    for h in [0, 1000, 2000, 3000, 4000, 5000]:
        atm = us_standard_atmosphere_1976(h)
        P_atm = atm['P'] / 1000  # kPa

        # Approximate boiling point from pressure (Antoine equation)
        # log10(P) = A - B / (C + T)
        # Rearranged: T = B / (A - log10(P)) - C
        A, B, C = 8.07131, 1730.63, 233.426  # Antoine constants (water, T in °C, P in mmHg)
        P_mmHg = P_atm * 7.50062  # Convert kPa to mmHg
        T_boil = B / (A - np.log10(P_mmHg)) - C

        print(f"{h:12.0f} | {P_atm:11.2f} | {T_boil:11.2f}")

boiling_point_altitude()
空化与沸点考量:
python
def boiling_point_altitude(fluid='water'):
    """
    Calculate boiling point of water at different altitudes
    """
    print("Boiling Point vs Altitude (Water)")
    print("Altitude [m] | P_atm [kPa] | T_boil [°C]")
    print("-" * 50)

    for h in [0, 1000, 2000, 3000, 4000, 5000]:
        atm = us_standard_atmosphere_1976(h)
        P_atm = atm['P'] / 1000  # kPa

        # Approximate boiling point from pressure (Antoine equation)
        # log10(P) = A - B / (C + T)
        # Rearranged: T = B / (A - log10(P)) - C
        A, B, C = 8.07131, 1730.63, 233.426  # Antoine constants (water, T in °C, P in mmHg)
        P_mmHg = P_atm * 7.50062  # Convert kPa to mmHg
        T_boil = B / (A - np.log10(P_mmHg)) - C

        print(f"{h:12.0f} | {P_atm:11.2f} | {T_boil:11.2f}")

boiling_point_altitude()

Data Processing Workflow

数据处理流程

Complete Example: Extract Atmospheric Profile

完整示例:提取大气剖面

python
import netCDF4 as nc
import numpy as np
import matplotlib.pyplot as plt
python
import netCDF4 as nc
import numpy as np
import matplotlib.pyplot as plt

Read MERRA-2 NetCDF file

Read MERRA-2 NetCDF file

filename = "MERRA2_400.inst3_3d_asm_Np.20230101.nc4" dataset = nc.Dataset(filename)
filename = "MERRA2_400.inst3_3d_asm_Np.20230101.nc4" dataset = nc.Dataset(filename)

Extract variables

Extract variables

lat = dataset.variables['lat'][:] # Latitude lon = dataset.variables['lon'][:] # Longitude lev = dataset.variables['lev'][:] # Pressure levels [Pa] T = dataset.variables['T'][:] # Temperature [K] H = dataset.variables['H'][:] # Geopotential height [m]
lat = dataset.variables['lat'][:] # Latitude lon = dataset.variables['lon'][:] # Longitude lev = dataset.variables['lev'][:] # Pressure levels [Pa] T = dataset.variables['T'][:] # Temperature [K] H = dataset.variables['H'][:] # Geopotential height [m]

Select location (e.g., lat=40°N, lon=105°W - Colorado)

Select location (e.g., lat=40°N, lon=105°W - Colorado)

lat_idx = np.argmin(np.abs(lat - 40)) lon_idx = np.argmin(np.abs(lon - 255)) # -105° = 255° East
lat_idx = np.argmin(np.abs(lat - 40)) lon_idx = np.argmin(np.abs(lon - 255)) # -105° = 255° East

Extract vertical profile at location

Extract vertical profile at location

T_profile = T[0, :, lat_idx, lon_idx] # time=0, all levels H_profile = H[0, :, lat_idx, lon_idx]
T_profile = T[0, :, lat_idx, lon_idx] # time=0, all levels H_profile = H[0, :, lat_idx, lon_idx]

Convert to altitude (geopotential to geometric)

Convert to altitude (geopotential to geometric)

altitude_km = H_profile / 1000
altitude_km = H_profile / 1000

Plot temperature profile

Plot temperature profile

plt.figure(figsize=(8, 10)) plt.plot(T_profile - 273.15, altitude_km) plt.xlabel('Temperature [°C]') plt.ylabel('Altitude [km]') plt.title('Atmospheric Temperature Profile\n(40°N, 105°W)') plt.grid(True) plt.show()
dataset.close()
undefined
plt.figure(figsize=(8, 10)) plt.plot(T_profile - 273.15, altitude_km) plt.xlabel('Temperature [°C]') plt.ylabel('Altitude [km]') plt.title('Atmospheric Temperature Profile\n(40°N, 105°W)') plt.grid(True) plt.show()
dataset.close()
undefined

Best Practices

最佳实践

  1. Cache Downloaded Data: NASA datasets are large; download once and process locally
  2. Use OPeNDAP for Subsetting: Only download needed spatial/temporal regions
  3. Check Data Version: MERRA-2 has multiple collections; use latest (M2I3NPASM.5.12.4)
  4. Respect Download Limits: NASA may throttle excessive requests
  5. Use Standard Atmosphere for Design: Real data for analysis; standard atmosphere for conservative design
  6. Validate Results: Cross-check with published data (ICAO, ISO 2533)
  7. Units Awareness: NASA data uses SI units (K, Pa, kg/m³); convert as needed
  8. Time Zones: NASA data in UTC; adjust for local analysis
  1. 缓存下载的数据:NASA数据集体积较大,下载一次后本地处理
  2. 使用OPeNDAP进行子集化:仅下载所需的空间/时间区域
  3. 检查数据版本:MERRA-2有多个版本,使用最新版本(M2I3NPASM.5.12.4)
  4. 遵守下载限制:NASA可能会限制过度请求
  5. 设计时使用标准大气:真实数据用于分析,标准大气用于保守设计
  6. 验证结果:与公开数据交叉核对(ICAO、ISO 2533)
  7. 注意单位:NASA数据使用国际单位制(K、Pa、kg/m³),按需转换
  8. 时区转换:NASA数据采用UTC时间,分析时需调整为当地时间

References

参考资料

Official NASA Resources

官方NASA资源

  1. NASA Earthdata Portal
  2. Earthdata Search
  3. GES DISC (Goddard Earth Sciences Data and Information Services Center)
  4. MERRA-2 Documentation
  1. NASA Earthdata门户
  2. Earthdata搜索工具
  3. GES DISC(戈达德地球科学数据与信息服务中心)
  4. MERRA-2文档

API and Tools

API与工具

  1. earthaccess Python Library
  2. OPeNDAP Protocol
  3. CMR (Common Metadata Repository)
  1. earthaccess Python库
  2. OPeNDAP协议
  3. CMR(通用元数据存储库)

Atmospheric Models

大气模型

  1. US Standard Atmosphere (1976)
    • NOAA-S/T-76-1562
    • Free download from NOAA
  2. NRLMSISE-00
  3. ISO 2533:1975
    • Standard Atmosphere reference
    • Available from ISO
  1. 美国标准大气(1976)
    • NOAA-S/T-76-1562
    • 可从NOAA免费下载
  2. NRLMSISE-00
  3. ISO 2533:1975
    • 标准大气参考标准
    • 可从ISO获取

Aerospace Applications

航空航天应用

  1. AIAA Standards
    • Atmospheric models for aerospace design
    • Available from AIAA
  2. ICAO Standard Atmosphere
    • International Civil Aviation Organization
    • Doc 7488/3

NASA Earthdata provides free, comprehensive atmospheric data essential for aerospace engineering analysis. Combined with standard atmosphere models, it enables accurate design and analysis of high-altitude pumps, compressors, thermal systems, and aerospace fluid applications.
  1. AIAA标准
    • 航空航天设计用大气模型
    • 可从AIAA获取
  2. ICAO标准大气
    • 国际民用航空组织
    • Doc 7488/3

NASA Earthdata提供免费、全面的大气数据,是航空航天工程分析的关键资源。结合标准大气模型,它能实现高空泵、压缩机、热控系统及航空航天流体应用的精准设计与分析。