Seamless NASA POWER access
Acts as a clean bridge to NASA POWER — hiding request construction, timeout handling, and payload checks behind a couple of simple calls.
AidWeather is a small Python library and command-line tool that pulls agroclimatic and solar-radiation data straight from NASA's POWER API — and hands it back as tidy, analysis-ready tables. You ask for a place and a date range; it deals with the requests, retries, caching, and units so you don't have to.
NASA POWER is a wonderful free dataset, but talking to it directly means building request URLs, babysitting timeouts, checking payload shapes, and reconciling units and grids. AidWeather quietly takes care of all of that, so what you get back is data you can actually start analyzing.
Acts as a clean bridge to NASA POWER — hiding request construction, timeout handling, and payload checks behind a couple of simple calls.
Fetch a single coordinate, sample along a 1D transect, or pull a 2D bounding box — with internal tuning so the spatial sampling stays accurate and consistent.
A built-in SQLite cache means the same query is never downloaded twice — saving bandwidth and respecting NASA POWER's rate limits and usage policy.
Two ways in: an intuitive Python API that fits data-science workflows, and a full command-line tool for quick, scriptable extractions.
Comprehensive activity logging and intelligent error catching give you readable insight into what a query did — instead of a raw stack trace.
Temperature, humidity, wind, precipitation, pressure, and solar irradiance / PAR — the meteorological and energy variables agritech work usually needs, side by side.
The same client fetches a single site, a line across a landscape, or a filled-in region — each respecting the native grid spacing of the parameters you ask for.
One latitude/longitude and a date range returns a clean daily or hourly series for that site — the everyday case for a field, a station, or a trial plot.
Give a start and end coordinate and a spacing in kilometres; AidWeather samples evenly along the line, respecting each parameter's real grid resolution.
Define a bounding box (up to 4.5° × 4.5°) and pull a gridded field over the whole area — one parameter per request, cached like everything else.
Whether you live in notebooks or the terminal, getting a table of weather and solar data is a short trip.
from aidweather import PowerClient, GeoCoordinate # Daily temporal resolution client = PowerClient(temporal_api="daily") # 1 · single-point weather + solar df = client.get_point_data( lat=-23.55, lon=-46.63, start="2023-01-01", end="2023-01-31", params=["T2M", "ALLSKY_SFC_SW_DWN", "PRECTOTCORR"], ) print(df.head()) # 2 · sample along a 1D transect a = GeoCoordinate.from_decimal(-25.0, -48.0) b = GeoCoordinate.from_decimal(-20.0, -48.0) df_t = client.get_transect_data( start_coord=a, end_coord=b, start="2023-01-01", end="2023-01-07", params=["T2M"], spacing_km=100.0, )
# single-point data → CSV aidweather fetch --lat -23.55 --lon -46.63 \ --start 2023-01-01 --end 2023-01-31 \ --params T2M,PRECTOTCORR --output point.csv # sample along a 1D transect aidweather fetch-transect \ --lat-start -25.0 --lon-start -48.0 \ --lat-end -20.0 --lon-end -48.0 \ --start 2023-01-01 --end 2023-01-31 \ --spacing-km 100.0 # regional box (max 4.5° × 4.5°, 1 param) aidweather fetch-regional --lat-min -23.5 --lat-max -20.0 \ --lon-min -47.0 --lon-max -44.0 \ --start 2023-01-01 --end 2023-01-31 \ --params T2M --output regional.csv # inspect metadata & local cache aidweather params list --group all aidweather params describe T2M aidweather cache info
Pick the line for your platform. The uv tool route works everywhere Python does.
# install script curl -fsSL https://raw.githubusercontent.com/\ matiollipt/aidweather/main/install.sh | bash # …or via uv tool (any platform) uv tool install \ git+https://github.com/matiollipt/aidweather.git
& ([scriptblock]::Create((irm https://raw\ .githubusercontent.com/matiollipt/aidweather/\ main/install.ps1))) -Yes
Each parameter ships with metadata, unit validation, and its native NASA source-grid resolution — so you always know what a value means and where it came from.
| Code | Parameter | Group | Source product | Native grid | Daily unit |
|---|---|---|---|---|---|
T2M | Temperature at 2 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | °C |
T2M_MAX | Maximum temperature at 2 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | °C |
T2M_MIN | Minimum temperature at 2 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | °C |
T2M_RANGE | Diurnal temperature range at 2 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | °C |
T2MWET | Wet-bulb temperature at 2 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | °C |
T2MDEW | Dew-point temperature at 2 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | °C |
TS | Surface skin temperature | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | °C |
RH2M | Relative humidity at 2 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | % |
PRECTOTCORR | Corrected total precipitation | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | mm/day |
ALLSKY_SFC_SW_DWN | Surface shortwave downward irradiance | Solar | CERES SYN1deg / SRB | 1.00° × 1.00° | kWh/m²/day |
ALLSKY_SFC_PAR_TOT | Surface PAR total | Solar | CERES SYN1deg / SRB | 1.00° × 1.00° | MJ/m²/day |
WS10M | Wind speed at 10 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | m/s |
WS10M_MAX | Maximum wind speed at 10 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | m/s |
WD10M | Wind direction at 10 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | degrees |
PS | Surface pressure | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | kPa |
A coordinate you submit resolves to a source-product grid cell — it isn't a point measurement at your exact latitude and longitude. Different parameters come from different source products (MERRA-2 at 0.5° × 0.625°, CERES solar radiation at 1.0° × 1.0°), so nearby coordinates that map to the same cell return identical series.
AidWeather keeps this provenance visible so your spatial interpretation stays honest.
The docs are split into focused guides — start with the user guide, dip into provenance and spatial interpretation when you need the details.
NASA POWER data are open access and free of charge. Work that uses AidWeather should cite the NASA POWER project and acknowledge the underlying MERRA-2 / GEOS-IT and CERES / FLASHFlux / SRB source products, per the NASA Earthdata Data Use and Attribution Policy.