nasa-earthdata について
航空宇宙エンジニア向けに、NASA Earthdataの大気データと標準大気モデルを解析に使う方法をまとめたスキルです。データセットの検索や認証アクセス、ポンプや飛行環境の計算例を扱います。
主な機能
- 01大気特性とモデル
- 02MERRA-2、AIRS、GEOSのデータ
- 03Earthdataの認証方法
- 04データセット検索と取得の案内
- 05航空宇宙計算の例
活用シーン
- 01高度別のポンプ入口条件の評価
- 02飛行時の風と温度の分析
- 03打ち上げ・飛行条件の計画
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ soljourner/ claude-engineering-skills --skill nasa-earthdataインストール後、Claude Code で/nasa-earthdataを入力して読み込まれたか確認します。
同梱ファイルreference.md
詳細
NASA Earthdata データベーススキル
航空宇宙用ポンプの設計、高高度システム、大気圏飛行解析向けに、NASA Earthdata プラットフォームから大気特性、標準大気モデル、航空宇宙環境データにアクセスします。
概要
NASA Earthdata は、複数の NASA ミッションや観測機器による地球科学データへの無料アクセスを提供しています。航空宇宙工学の用途では、次のデータを利用できます。
- 大気特性:高度に対する温度、圧力、密度のプロファイル
- 標準大気モデル:米国標準大気(1976)、MSIS、NRLMSISE-00
- 風データ:全球の風プロファイル、ジェット気流、季節変動
- 温度プロファイル:対流圏から熱圏まで
- 圧力プロファイル:海面から外気圏まで
- ジオポテンシャル高度:標準大気の基準
- 組成データ:高度別の大気ガス組成
- 環境条件:湿度、降水量、雲量
主な用途:
- 高高度ポンプおよび圧縮機の設計
- 航空機およびロケットの環境条件
- 航空宇宙流体システムの解析
- 熱制御システムの設計
- 空力加熱の計算
- 打ち上げウィンドウの計画
無料登録が必要です
NASA Earthdata は無料ですが、ユーザー登録が必要です。
登録手順
-
Earthdata アカウントを作成する
- URL:https://urs.earthdata.nasa.gov/users/new
- 必要な情報:氏名、メールアドレス、所属機関
- すべてのユーザー(学術、商用、個人)が無料で利用できます
- 即時承認
-
アプリケーションを承認する
- 一部のデータセットでは、アプリケーションの承認が必要です
- 次のページに移動します:https://urs.earthdata.nasa.gov/home
- 「My Applications」→「Approve More Applications」をクリックします
- 必要なデータサービス(例:GES DISC、ASDC)を承認します
-
認証情報を保存する
- ユーザー名:メールアドレスまたは選択したユーザー名
- パスワード:アカウントのパスワード
- 安全に保管します(API アクセスに必要です)
認証の設定
方法 1:ユーザー名/パスワード認証
import requests
from requests.auth import HTTPBasicAuth
# Your Earthdata credentials
username = "your_earthdata_username"
password = "your_earthdata_password"
# Example: Access data with authentication
url = "https://goldsmr4.gesdisc.eosdis.nasa.gov/data/MERRA2/..."
response = requests.get(url, auth=HTTPBasicAuth(username, password))
方法 2:.netrc ファイル(推奨)
自動認証用に .netrc ファイルを作成します。
Linux/Mac(~/.netrc):
machine urs.earthdata.nasa.gov
login your_username
password your_password
アクセス権を設定します。
chmod 600 ~/.netrc
Windows(C:\Users\YourName\_netrc):
machine urs.earthdata.nasa.gov
login your_username
password your_password
.netrc を使用する Python:
import requests
# Authentication automatically used from .netrc
url = "https://goldsmr4.gesdisc.eosdis.nasa.gov/data/..."
response = requests.get(url)
方法 3:トークンベース認証
プログラムからのアクセス用にトークンを生成します。
- Earthdata にログインします:https://urs.earthdata.nasa.gov/
- 「My Profile」→「Generate Token」に移動します
- トークンをコピーします
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. 標準大気モデル
MSIS(質量分析計・非干渉性散乱)
- 説明:経験的大気モデル
- 高度範囲:0 km~1000 km
- パラメーター:温度、密度、組成
- 時間依存性:時間に依存(太陽活動、季節)
- 用途:高高度航空機、ロケット、衛星
NRLMSISE-00(米国海軍研究試験所 MSIS 拡張版)
- 説明:熱圏までを対象とする拡張大気モデル
- 高度範囲:0 km~2000 km
- パラメーター:T、P、ρ、組成(N₂、O₂、O、He、H、Ar、N)
- 入力値:高度、緯度、経度、日付、時刻、太陽活動
- 用途:宇宙機の抗力、上層大気の解析
米国標準大気(1976)
- 説明:静的な大気モデル
- 高度範囲:0 km~1000 km
- 層:対流圏、成層圏、中間圏、熱圏
- パラメーター:T、P、ρ、音速
- 用途:基準設計、標準化試験
2. MERRA-2(Modern-Era Retrospective analysis)
NASA の再解析による実際の大気データです。
- 空間分解能:0.5° × 0.625°(緯度 × 経度)
- 時間分解能:毎時、3時間ごと、日次、月次
- 高度レベル:地表から 0.01 hPa(約 80 km)まで
- 対象期間:1980 年から現在まで(継続的に更新)
利用可能なパラメーター:
- 温度(T)[K]
- 圧力(P)[Pa]
- 密度(ρ)[kg/m³]
- 風の成分(U、V、W)[m/s]
- ジオポテンシャル高度 [m]
- 相対湿度 [%]
- 比湿 [kg/kg]
航空宇宙分野での用途:
- 飛行エンベロープ解析
- ウィンドシア評価
- 熱環境モデリング
- 打ち上げ軌道計画
3. AIRS(Atmospheric Infrared Sounder)
高解像度の大気プロファイルです。
- 空間分解能:50 km
- 鉛直分解能:28 の気圧レベル
- パラメーター:T、P、H₂O、O₃、CO₂
- カバレッジ:全球、1 日 2 回
- 精度:±1 K(温度)、±15%(湿度)
用途:
- 高精度な大気特性データ
- 地域大気の解析
- 飛行計画
4. GEOS(Goddard Earth Observing System)
将来予測向けの大気データです。
- 種類:予報モデル(7 日先まで)
- 分解能:0.25° × 0.3125°
- 時間間隔:3 時間ごと
- パラメーター:T、P、風、湿度、組成
用途:
- ミッション計画
- 打ち上げ予報
- 飛行運用
API アクセス方法
方法 1:OPeNDAP(Open-source Project for Network Data Access Protocol)
データを直接サブセット化してダウンロードします。
from pydap.client import open_url
# Open MERRA-2 dataset via OPeNDAP
url = "https://goldsmr4.gesdisc.eosdis.nasa.gov/opendap/MERRA2/M2I3NPASM.5.12.4/2023/01/MERRA2_400.inst3_3d_asm_Np.20230101.nc4"
dataset = open_url(url, username="your_username", password="your_password")
# Access variables
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)
T_subset = temperature[0, :, 100, 200] # time, level, lat, lon
方法 2:NASA CMR(Common Metadata Repository)
データセットを検索して見つけます。
import requests
# 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']
# Download URLs
for granule in granules:
print(granule['title'])
print(granule['links'][0]['href']) # Data URL
方法 3:直接 HTTP ダウンロード
ファイルを直接ダウンロードします。
import requests
from requests.auth import HTTPBasicAuth
username = "your_username"
password = "your_password"
# MERRA-2 file URL
url = "https://goldsmr4.gesdisc.eosdis.nasa.gov/data/MERRA2/M2I3NPASM.5.12.4/2023/01/MERRA2_400.inst3_3d_asm_Np.20230101.nc4"
# 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")
方法 4:Python の earthaccess ライブラリ
NASA Earthdata に簡単にアクセスできます。
pip install earthaccess
import earthaccess
# Login (uses .netrc or prompts for credentials)
earthaccess.login()
# Search for MERRA-2 data
results = earthaccess.search_data(
short_name='M2I3NPASM',
cloud_hosted=True,
temporal=('2023-01-01', '2023-01-31')
)
# Download data
files = earthaccess.download(results[0:5], "./data")
標準大気の計算例
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
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}")
航空宇宙用ポンプおよび高高度システムへの応用
1. ポンプ入口条件
高度がポンプ性能に及ぼす影響:
# 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
# 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}")
出力:
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
2. 高高度コンプレッサーの設計
密度の変化による影響:
# 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
# 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}")
3. 熱制御システム
ラジエーター/熱交換器の設計に用いる周囲温度:
# 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
# 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}")
4. 高度における流体特性
キャビテーションおよび沸点に関する考慮事項:
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()
データ処理ワークフロー
完全な例:大気プロファイルの抽出
import netCDF4 as nc
import numpy as np
import matplotlib.pyplot as plt
# Read MERRA-2 NetCDF file
filename = "MERRA2_400.inst3_3d_asm_Np.20230101.nc4"
dataset = nc.Dataset(filename)
# 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]
# 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
# 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]
# Convert to altitude (geopotential to geometric)
altitude_km = H_profile / 1000
# 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()
ベストプラクティス
- ダウンロードしたデータをキャッシュする:NASA のデータセットはサイズが大きいため、一度ダウンロードしてローカルで処理します
- サブセット化には OPeNDAP を使用する:必要な空間領域と時間範囲のデータのみをダウンロードします
- データのバージョンを確認する:MERRA-2 には複数のコレクションがあります。最新のもの(M2I3NPASM.5.12.4)を使用します
- ダウンロード制限を守る:NASA は過剰なリクエストを制限する場合があります
- 設計には標準大気を使用する:解析には実データを、保守的な設計には標準大気を使用します
- 結果を検証する:公開データ(ICAO、ISO 2533)と照合します
- 単位に注意する:NASA のデータは SI 単位(K、Pa、kg/m³)を使用します。必要に応じて変換してください
- タイムゾーン:NASA のデータは UTC です。現地での解析に合わせて調整してください
参考資料
NASA 公式リソース
-
NASA Earthdata ポータル
- URL:https://www.earthdata.nasa.gov/
- あらゆる地球科学データのメインポータル
-
Earthdata Search
- URL:https://search.earthdata.nasa.gov/
- 視覚的な検索・データ発見ツール
-
GES DISC(Goddard Earth Sciences Data and Information Services Center)
- URL:https://disc.gsfc.nasa.gov/
- 大気データの主要な提供元
-
MERRA-2 のドキュメント
- URL:https://gmao.gsfc.nasa.gov/reanalysis/MERRA-2/
- 再解析の手法に関する詳細
API とツール
-
earthaccess Python ライブラリ
- GitHub:https://github.com/nsidc/earthaccess
- PyPI:
pip install earthaccess
-
OPeNDAP プロトコル
- URL:https://www.opendap.org/
- データアクセスプロトコルのドキュメント
-
CMR(Common Metadata Repository)
- URL:https://cmr.earthdata.nasa.gov/search/
- プログラムによるデータ検索
大気モデル
-
US Standard Atmosphere (1976)
- NOAA-S/T-76-1562
- NOAA から無料でダウンロードできます
-
NRLMSISE-00
- URL: https://ccmc.gsfc.nasa.gov/modelweb/models/nrlmsise00.php
- モデルコードとドキュメント
-
ISO 2533:1975
- 標準大気の参考資料
- ISO から入手できます
航空宇宙分野での用途
-
AIAA Standards
- 航空宇宙設計向けの大気モデル
- AIAA から入手できます
-
ICAO Standard Atmosphere
- 国際民間航空機関
- Doc 7488/3
NASA Earthdata は、航空宇宙工学の解析に不可欠な包括的な大気データを無料で提供しています。標準大気モデルと組み合わせることで、高高度ポンプ、圧縮機、熱システム、航空宇宙分野の流体応用を正確に設計・解析できます。