Skip to main content

TempEst 2 estimates stream water temperature at a point, for streams of any size, using a data-driven model based on satellite remote sensing data. This is the Python implementation.

Project description

TempEst 2

TempEst 2/SCHEMA is "TEMPerature ESTimation, version 2, using Seasonal Conditions Historical Expectation with Modeled daily Anomaly". It estimates stream water temperature, for streams of any size, using a data-driven model based on satellite remote sensing data. This is the Python implementation with some additional data processing features.

Note that the geostatistical implementation is similar but not identical to the original (R) impementation described in Philippus et al., 2025 because PyKrige does not have the same spatial covariance functions available as fields and does not have MLE-based covariance function parameter estimation.

Usage Guide

Full documentation is available at RiverTempest.org.

Generating Predictions

TempEst 2 will return:

  • temp.mod (modeled daily mean temperature; Celsius)
  • temp.doy (modeled day-of-year mean temperature; Celsius)
  • temp.anom (modeled temperature anomaly relative to day-of-year mean; Celsius)

temp.mod = temp.doy + temp.anom.

These three variables are the final output, and can be used to assess actual estimated temperature (temp.mod); typical seasonal conditions (temp.doy), such as to assess general long-term behavior; and departure from typical seasonal conditions (temp.anom), such as to assess heat waves or other extremes.

  1. Install TempEst 2: pip install TempEst2
  2. Download pre-trained model pickle from GitHub Releases as model.pkl
  3. Download prediction data by any suitable means, such as the reference implementation's Google Earth Engine data retrieval script, as data.csv. Required columns: id, date, lst, humidity, lat, lon, elevation, grassland, shrubland, barren, water.
  4. predictions = tempest2.predict('model.pkl', 'data.csv')

Relevant Functionality

The above-described predict function handles the entire prediction process. There are several key functions that may be relevant on their own and to fitting a model:

  • Spatial prediction:
    • tempest2.spatial.to_pickle and .from_pickle: store and retrieve geospatial models in Pickle format.
    • tempest2.build_model: train a geospatial model from timeseries data.
    • tempest2.predict_coefs and .predict_timeseries: predict site coefficients and full timeseries, respectively. predict_coefs requires summarized inputs, while .predict_timeseries uses a full timeseries input.
  • Single site:
    • tempest2.full_fit: fit TempEst 2 coefficients from a site timeseries. Unlike the reference implementation, this begins with a direct solution, then iteratively optimizes.
    • tempest2.timeseries: predict a timeseries for a single site using a timeseries input and specified coefficients.
    • tempest2.Model: LibSCHEMA model implementation
  • tempest2.full_summary: generate prediction data from an input timeseries.

Citation and More Information

If you use this model in your research, please cite TempEst 2 (Philippus et al., 2025).

Reference implementation in R and data retrieval tools for Google Earth Engine: https://github.com/mines-ciroh/tempest2

The model design is based on Philippus, Corona, Schneider, Rust, and Hogue, 2025, "Satellite-Based Spatial-Statistical Modeling of Daily Stream Water Temperatures at the CONUS Scale", Journal of Hydrology, https://doi.org/10.1016/j.jhydrol.2025.133321. This paper also contains a detailed description of model design and performance characteristics.

The seasonality component is based on the "three-sine" stream annual temperature cycle function described in: Philippus, Corona, and Hogue, 2024, "Improved annual temperature cycle function for stream seasonal thermal regimes", JAWRA, https://doi.org/10.1111/1752-1688.13228.

Full training datasets, pre-trained models, and a knitted model validation notebook PDF are available in CUAHSI HydroShare: TempEst 2 Development Data: Observed Stream Temperature, Covariates, Performance Data, and Analysis Notebooks.

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

tempest2-0.1.1.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

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

tempest2-0.1.1-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file tempest2-0.1.1.tar.gz.

File metadata

  • Download URL: tempest2-0.1.1.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for tempest2-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b195d601263c7df98441d73df03543961c5748d39c35f282ce5d70bde1c42138
MD5 6e4315bd2a91ab8c9b092dae611fda8a
BLAKE2b-256 918e6b88eed1bec0cbd98950f4fd5dbfca77d8448452b8186246bcabd129b17c

See more details on using hashes here.

File details

Details for the file tempest2-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tempest2-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for tempest2-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d6102d19b64b6d2fba76254480e59eb1a95ee35ad76f5a827654184779156639
MD5 c67dcf7963c2c33ff216e0d142ecb209
BLAKE2b-256 0bcbc58567f1c2db824f986c1ce10739567be4a9b9d3609fcaf949f6f9c6319a

See more details on using hashes here.

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