Skip to main content

thermocouple-its90

NIST ITS-90 thermocouple conversion for Python: voltage to temperature and temperature to voltage for all eight letter-designated types (B, E, J, K, N, R, S, T), with cold-junction compensation, Seebeck coefficients, and a test suite that verifies every one of the 12,026 tabulated points of the NIST reference tables on every run.

Tests PyPI Python License: MIT

Pure standard library, no dependencies, fully typed. A browser version of this engine runs as a free online thermocouple calculator, vendored from this repository on every release.

Install

pip install thermocouple-its90

Convert thermocouple millivolts to temperature

from thermocouple_its90 import TypeK

TypeK.emf(300.0)          # 12.209  (mV at 300 C, 0 C reference: the table value)
TypeK.temperature(12.209) # 300.0   (C, ice-bath reference)
TypeK.seebeck(300.0)      # 0.0416  (mV per C)
TypeK.range               # (-270.0, 1372.0)

Cold-junction compensation, done honestly

A thermocouple measures the difference between its junctions, and the reference tables assume the cold junction sits at 0 C. If your meter's terminals are at room temperature, a direct table lookup is wrong:

from thermocouple_its90 import TypeK

# Meter reads 4.096 mV, terminals at 25 C:
TypeK.temperature(4.096)                  # 100.0 C  <- naive lookup, wrong
TypeK.temperature(4.096, reference=25.0)  # 124.3 C  <- the actual answer

All eight types work the same way:

from thermocouple_its90 import get, letters

letters()                       # ['B', 'E', 'J', 'K', 'N', 'R', 'S', 'T']
get("s").emf(1400.0)            # 14.373 mV
get("t").temperature(-4.648)    # -149.98 C (cryogenic ranges included)

Accuracy, verified rather than asserted

  • The forward reference functions reproduce all 12,026 one-degree points of the NIST reference tables within their 0.001 mV print rounding; the full comparison runs in CI on every push (tests/test_full_tables.py).
  • Inversion seeds with the published ITS-90 inverse polynomials and refines by Newton iteration on the exact forward function, so round trips agree to microdegrees instead of the inverse polynomials' 0.02 to 0.06 C error bands.
  • Types K, E and T invert over their full cryogenic ranges (to -270 C), below where the published inverse polynomials stop.
  • Type B is handled with its physics: its EMF is non-monotonic near room temperature, so inversion below 0.291 mV (about 250 C) is refused with an explanation instead of returning one of two possible answers.

MCP server for AI agents

Language models mis-remember thermocouple polynomials with great confidence. This package ships a Model Context Protocol server so agents call the verified implementation instead:

pip install "thermocouple-its90[mcp]"
claude mcp add thermocouple -- thermocouple-its90-mcp

Tools: thermocouple_to_temperature, thermocouple_to_emf, thermocouple_types.

Data provenance and licensing

Coefficients were machine-parsed, never hand-typed, from the NIST ITS-90 Thermocouple Database (SRD 60, https://its90.nist.gov/), which reproduces NIST Monograph 175 (Burns, Scroger, Strouse, Croarkin, and Guthrie, 1993), a United States government publication not subject to copyright. The canonical dataset lives in data/its90.json; _data.py is generated from it and CI fails if they drift. Code is MIT licensed.

Related

Citation

If this library is useful in published work, please cite it (see CITATION.cff; a Zenodo DOI is minted per release) along with the underlying reference: Burns, G. W., Scroger, M. G., Strouse, G. F., Croarkin, M. C., & Guthrie, W. F. (1993). Temperature-electromotive force reference functions and tables for the letter-designated thermocouple types based on the ITS-90 (NIST Monograph 175). NIST.

Download files

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

Source Distribution

thermocouple_its90-1.0.0.tar.gz (70.0 kB view details)

Uploaded Source

Built Distribution

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

thermocouple_its90-1.0.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file thermocouple_its90-1.0.0.tar.gz.

File metadata

  • Download URL: thermocouple_its90-1.0.0.tar.gz
  • Upload date:
  • Size: 70.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for thermocouple_its90-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8f0b24aaceefa83a47cba1f78307230896081f7f8a71e3b926b76e8640e85050
MD5 05782ecbf0d9b7569ffce7023620134c
BLAKE2b-256 301a1b31540c6996e26adb75fe8ebf08211ae0cf2dc9365802a2ece47987c156

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermocouple_its90-1.0.0.tar.gz:

Publisher: publish.yml on dfieser/thermocouple-its90

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

File details

Details for the file thermocouple_its90-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for thermocouple_its90-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 168a7c2a03b3d2b6718043a35cf79a0d9b04cddc7f790d777f28098330c09afe
MD5 fb5b031982065c55bd9568de4f376621
BLAKE2b-256 907e33854fa026d2fe43f22a8c797555740f61f7d6ef94d9ed1f52a4499c6f7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermocouple_its90-1.0.0-py3-none-any.whl:

Publisher: publish.yml on dfieser/thermocouple-its90

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

Release history Release notifications | RSS feed

1.0.1

2 files

This release

1.0.0 This release

2 files

Supported by

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