io.github.dfieser/thermocouple-its90
thermocouple-its90
Python向けNIST ITS-90熱電対変換ライブラリ:8種類すべての文字指定タイプ(B、E、J、K、N、R、S、T)について、電圧から温度へ、温度から電圧への変換を提供します。冷接点補償とゼーベック係数にも対応しています。テストスイートは、NIST参照テーブルの12,026すべての表記載点を毎回の実行で検証します。
純粋な標準ライブラリのみを使用し、依存関係はありません。完全に型付けされています。このエンジンのブラウザ版は、無料のオンライン熱電対計算機として動作しており、リリースのたびにこのリポジトリからベンダリングされています。
インストール
pip install thermocouple-its90Related MCP server: mcp-units
熱電対のミリボルトを温度に変換する
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)冷接点補償
熱電対は2つの接点間の差を測定します。参照テーブルは冷接点が0℃にあることを前提としています。メーターの端子が室温にある場合、テーブルを直接参照すると誤差が生じます:
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 answer8種類すべてのタイプが同じ方法で動作します:
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)精度:主張ではなく検証に基づく
順方向参照関数は、NIST参照テーブルの全12,026点の1度刻みの値を、0.001 mVの印刷丸め誤差内で再現します。完全な比較は、プッシュのたびにCIで実行されます(
tests/test_full_tables.py)。逆変換は、公開されているITS-90逆多項式を初期値として使用し、正確な順方向関数に対するニュートン反復法で精密化します。往復変換は、逆多項式の0.02〜0.06℃の誤差帯域ではなく、マイクロ度単位で一致します。
K、E、Tタイプは、低温全域(-270℃まで)で逆変換が可能です。これは公開されている逆多項式の適用範囲を超えています。
Bタイプは物理に基づいて処理されます:その起電力は室温付近で非単調であるため、0.291 mV未満(約250℃以下)での逆変換は、2つの可能な答えのいずれかを返すのではなく、説明付きで拒否されます。
AIエージェント向けMCPサーバー
言語モデルは熱電対多項式を誤って記憶することがあります。このパッケージにはModel Context Protocolサーバーが同梱されており、エージェントは記憶に頼る代わりに検証済みの実装を呼び出すことができます:
pip install "thermocouple-its90[mcp]"
claude mcp add thermocouple -- thermocouple-its90-mcpツール:thermocouple_to_temperature、thermocouple_to_emf、thermocouple_types。
データの出所とライセンス
係数は、NIST ITS-90熱電対データベース(SRD 60、https://its90.nist.gov/)から手入力ではなく機械的に解析されました。このデータベースは、NISTモノグラフ175(Burns、Scroger、Strouse、Croarkin、Guthrie、1993年)を再現したものです。これは米国政府の出版物であり、著作権の対象外です。正規のデータセットはdata/its90.jsonに格納されており、_data.pyはそこから生成されます。両者に乖離が生じた場合、CIが失敗します。コードはMITライセンスです。
関連情報
ライブ計算機:このエンジンのブラウザ版。計算例とFAQ付き
同じ作者による検証済み工学計算機:基準電極、合金組成、拡散、XRDツールを含む
lcf-strain-life:低サイクル疲労解析のための、同じライブラリ+MCPパターン
引用
このライブラリを学術研究で使用する場合は、コンセプトDOI https://doi.org/10.5281/zenodo.22036393 を通じて引用してください。このDOIは常に最新リリースに解決されます(CITATION.cffを参照)。また、基礎となる参考文献も併せて引用してください: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.
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for aerospace calculations: orbital mechanics, ephemeris, DSN operations, ...
Remote MCP server for deterministic educational practice-assessment score conversions.
QuLab MCP remote server (Streamable HTTP) for computational science and lab tools.
Engineering calculation MCP server for oil and gas engineering applications.
Related MCP Servers
- AlicenseAqualityFmaintenanceA universal MCP server that exposes all UTCP-registered tools to MCP clients while providing a web interface for tool management.714 npm205MIT
- AlicenseAqualityDmaintenanceMCP server for converting cooking measurements (volume, weight, temperature) between common units like ml, cup, g, oz, and Celsius/Fahrenheit.31MIT
- AlicenseBqualityBmaintenanceAn MCP server for controlling lab instruments (oscilloscopes, signal generators, etc.) via standardized interfaces like USBTMC, RS-232, and LAN.100MIT
- AlicenseAqualityCmaintenanceThis MCP server enables AI clients to calculate the boiling temperature of water at a given absolute pressure using the IAPWS-IF97 standard, separating natural-language reasoning from authoritative scientific computation.1MIT