Skip to main content

thermocouple-its90

thermocouple-its90: NIST ITS-90 thermocouple conversion for Python. The eight reference functions fan out from the ice point; type K leads in blue.

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 and Seebeck coefficients. The test suite verifies every one of the 12,026 tabulated points of the NIST reference tables on every run.

Tests PyPI Python License: MIT DOI

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

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

All eight ITS-90 reference functions plotted from -270 to 1820 C, each labeled at its end point, computed by this library.
  • 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. 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.
Type B EMF from 0 to 400 C. The curve dips below zero near 21 C, and a dashed line marks 0.291 mV where inversion becomes single-valued.

MCP server for AI agents

Language models mis-remember thermocouple polynomials. The 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. All three are annotated read-only and idempotent with no outside effects, so a host can tell a user what a call will do before it runs.

The extra needs Python 3.10 or newer and works with either line of the MCP SDK, 1.7 and later or 2.x. CI builds the server against both on every push.

Data provenance and licensing

Coefficients were machine-parsed, never hand-typed, from the NIST ITS-90 Thermocouple Database (SRD 60, https://its90.nist.gov/). The database 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.

Citation

If this library is useful in published work, please cite it via the concept DOI https://doi.org/10.5281/zenodo.22036393, which always resolves to the latest release (see CITATION.cff). Please also cite 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.

Metadata

Release files for thermocouple-its90 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for thermocouple-its90 1.0.2
File Size Uploaded
thermocouple_its90-1.0.2.tar.gz 698.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for thermocouple-its90 1.0.2
File Interpreter ABI Platform
thermocouple_its90-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 715.0 kB

Release files / thermocouple_its90-1.0.2.tar.gz

Download URL thermocouple_its90-1.0.2.tar.gz
Size 698.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e2e4aada258030a9f13535a45e77de9c30c098b80fff88afa317165e428a0fd1
BLAKE2b-256 checksum
How to use checksums
c814e8640b2f670786e553bf44e93a46098d0d0ff40e732b603b0fb2f3ed569f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.

Transparency log

Release files / thermocouple_its90-1.0.2-py3-none-any.whl

Download URL thermocouple_its90-1.0.2-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44cc04eade389fbad07c0abffa37a9357f6c1c22d5f2f8330a4e256d4a69ddf9
BLAKE2b-256 checksum
How to use checksums
f4bbc2cad37965a29b5cb1f1b85a85437843fad27218c45c83955d574dc5aa13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page