Skip to main content

LSTNet: pure-Python land surface temperature library (ground truth LST production refactor).

Project description

lstnet

Pure-Python land surface temperature (LST) ground-validation library + GUI.

lstnet computes ground-truth LST from in-situ longwave radiation at SURFRAD / PKULSTNet / HiWATER validation sites and validates it against retrieved LST (your own algorithm or a satellite product) — bias / RMSE / R + scatter and time-series plots. Zero system GDAL; cross-platform (Windows / macOS incl. Apple Silicon / Linux); MIT-licensed.

Networks: SURFRAD (7 US sites, served online by NOAA — the default, works out of the box) is the primary network. PKULSTNet (7) and HiWATER (11) readers are also included for users who hold those local datasets (they are not publicly downloadable — point the reader at your data/ directory).

Install

pip install lstnet

That's it — core library, GUI (lstnet-gui), and MCP server (lstnet-mcp) are all included.

For MODIS / ASTER GED emissivity sources, set NASA Earthdata credentials (never hardcoded):

export EARTHDATA_USERNAME=you@example.com
export EARTHDATA_PASSWORD=********

Or enter them in the GUI: Settings → Earthdata Login (saved to ~/.lstnet/earthdata.json, chmod 600). Register at https://urs.earthdata.nasa.gov/users/new.

FixedEmissivity needs no credentials.

GUI usage

lstnet-gui        # launch the PySide6 desktop application

The GUI lets you:

  1. Select sites (multi-select, with lon/lat shown) from SURFRAD / PKULSTNet / HiWATER.
  2. Enter overpass times (12-digit YYYYMMDDHHMM, one per line, UTC).
  3. Pick an emissivity source — ASTER GED (default, recommended for validation), MODIS daily, or a manual fixed value.
  4. Compute ground LST — batch across all selected sites × times.
  5. Validate — load a retrieved-LST CSV (site, overpass_time_utc, lst_k), the tool auto-computes ground truth for each row, pairs, and shows bias / RMSE / R + an embedded scatter plot (retrieved vs ground, 1:1 line).
  6. Export the enriched CSV (retrieved LST + ground LST + diff + emissivity).

Sample data is in samples/:

  • retrieved_sample.csv — 9-site multi-network demo (SURFRAD ×7 + HiWATER ×2).
  • validation_template.csv — all 25 sites pre-filled (fill in time + your LST).

Linux note: the GUI needs libxcb-cursor0:

sudo apt install -y libxcb-cursor0 libegl1 libgl1

Library usage (script / notebook)

Compute ground-truth LST for one site/time:

from datetime import datetime, timezone
from lstnet import compute_ground_lst, FixedEmissivity
from lstnet.sites import get_site
from lstnet.io.surfrad import SurfradReader

site = get_site("psu")
t = datetime(2011, 2, 12, 14, 30, tzinfo=timezone.utc)
g = compute_ground_lst(site, t, FixedEmissivity(0.98), SurfradReader())
print(g.lst_k, g.qc_flag)   # e.g. 270.15 OK

Validate ground truth against your retrieved LST:

from lstnet import validate, TableRetrievedLST
from lstnet.plotting import scatter_plot

ground = [compute_ground_lst(s, t, FixedEmissivity(0.98), SurfradReader())
          for s, t in your_site_times]
result = validate(ground, TableRetrievedLST("your_retrieval.csv"))
print(result.stats.bias, result.stats.rmse, result.stats.r)
scatter_plot(result)   # retrieved-vs-ground with 1:1 line

your_retrieval.csv columns: site, overpass_time_utc, lst_k[, source] (overpass_time_utc = 12-digit YYYYMMDDHHMM or ISO 8601, UTC).

MCP server (AI agent integration)

lstnet-mcp        # start the FastMCP server

Exposes three tools that an AI agent (Claude Desktop, etc.) can call: list_sites, compute_lst, validate_csv.

Features

  • Ground-truth LST from SURFRAD (NOAA, HTTPS) / PKULSTNet / HiWATER station data, at satellite overpass times (Stefan–Boltzmann radiance inversion).
  • Emissivity sources: FixedEmissivity (offline), ModisDailyEmissivity (MYD21A1D/A1N C6.1, Ogawa 2004 broadband), AsterGEDEmissivity (AG100 V003 climatological, Cheng & Liang 2014 broadband — recommended for sub-K validation).
  • Validation engine: pair ground-truth + retrieved LST by (site, overpass time) within a tolerance; bias / RMSE / Pearson R / regression; scatter + time-series plots.
  • GDAL-free: MODIS HDF4 via pyhdf, ASTER GED HDF5 via h5py, GeoTIFF via rasterio — all ship pip wheels, no system GDAL install.
  • Quality control (configurable strict), day/night (astral), credential externalization, CWD-independent paths.
  • Cross-platform: tested on Windows / macOS / Linux via GitHub Actions CI.

Platform notes

Platform Status Notes
Linux ✅ Full GUI needs libxcb-cursor0 libegl1 libgl1 (apt install)
macOS (Intel + Apple Silicon) ✅ CI green Native Qt backend; no extra libs
Windows ✅ CI green Native Qt backend; no extra libs

All binary dependencies (pyhdf, h5py, rasterio, PySide6) ship pip wheels for all three platforms — no compilation needed.

Citing

See CITATION.cff.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lstnet-0.1.0.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lstnet-0.1.0-py3-none-any.whl (50.9 kB view details)

Uploaded Python 3

File details

Details for the file lstnet-0.1.0.tar.gz.

File metadata

  • Download URL: lstnet-0.1.0.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lstnet-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8ef08e0f7fa1ebb34bb34df590204eebf720fefd46649448c52bfc060307fd43
MD5 8700303adb98d98619d82c7f48984302
BLAKE2b-256 78463ce4244f154a44b29af99793790cf8a9a9ffec1337e30c1599e5b20ad36c

See more details on using hashes here.

Provenance

The following attestation bundles were made for lstnet-0.1.0.tar.gz:

Publisher: publish.yml on veniai/lstnet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lstnet-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lstnet-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 50.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lstnet-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 636c565144623386c22c1d24fc0dbf218c3cf3381aa6f970092b00ebfbc65771
MD5 9a74bbce939932741075bd8d02b74236
BLAKE2b-256 54ad3b298747fec211900f9af973bf0f0f8207f3ddb8043163d58c915d847150

See more details on using hashes here.

Provenance

The following attestation bundles were made for lstnet-0.1.0-py3-none-any.whl:

Publisher: publish.yml on veniai/lstnet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page