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.0.tar.gz (15.5 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.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tempest2-0.1.0.tar.gz
  • Upload date:
  • Size: 15.5 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.0.tar.gz
Algorithm Hash digest
SHA256 75ab5bf4a3b968207dc35414b70bf84c33f123e3a31d799172ce371108ef901a
MD5 dda2fe3d78d0bca5c2ffa4b5e7a655b8
BLAKE2b-256 e4989d34f7fae1b2ca44a2ddde46ac5e875a3583734a0e92b3d3702b2bf6e7f6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tempest2-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.4 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b119c7db1389751a612f44ebc3ae9f87c17a4d8bf186bf295a3bb0275362386
MD5 5a7f55c5dbc2fe767bddb80447bbd69d
BLAKE2b-256 f51d05d89e5a9fb0a691617eb22d004d1bab6a3a34a140833aedb943a206f8cc

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