Skip to main content

METAS B LEAST

METAS B LEAST is a Python implementation of the B LEAST program of the ISO 6143:2001 norm. The derivations of the different fit functions have been explicitly programmed, see metas_b_lest.py. The program has been verified against METAS UncLib which is using automatic differentiation.

The following link will launch an interactive Python environment where you can you use METAS B LEAST:

Binder

Examples

Take a look at the following code example for the usage of the METAS B LEAST Python package:

from metas_b_least import *

# Calibration and measurement data
cal_data = b_read_cal_data(os.path.join(data_dir, 'b_least_1_data_cal.txt'))
meas_data = b_read_meas_data(os.path.join(data_dir, 'b_least_1_data_meas.txt'))
b_disp_cal_data(cal_data)

# Fit coefficients of the fit function using the calibration data
b, b_cov, b_res = b_least(cal_data, b_linear_func)
b_disp_cal_results(b, b_cov, b_res)

# Evaluate the fit function with the coefficients at the measurement data
x, x_cov = b_eval(meas_data, b, b_cov, b_linear_func)
b_disp_meas_results(x, x_cov, meas_data)

# Plot calibration data, measurement data and fit function
b_plot(cal_data, meas_data, b, b_cov, b_linear_func)

See as well the following Jupyter Notebooks:

Functions

Input Functions

b_read_cal_data reads calibration data from tabular separated text file where the first column are the x values, the second column are the standard uncertainties of x, the third column are the y values and the forth column are the standard uncertainties of y.

b_read_meas_data reads measurement data from tabular separated text file where the first column are the y values and the second column are the standard uncertainties of y.

Processing Functions

b_least fits the coefficients b of the fit function func using the calibration data cal_data.

b_eval evaluates the fit function func with the coefficients b at the measurement data meas_data.

The following fit functions are available:

Name Function
b_linear_func $$x = b_0 + b_1y$$
b_second_order_poly $$x = b_0 + b_1y + b_2y^2$$
b_third_order_poly $$x = b_0 + b_1y + b_2y^2 + b_3y^3$$
b_power_func $$x = b_0 + b_1y^{(1 + b_2)}$$
b_exp_func $$x = b_0 + b_1e^{b_2y}$$

Output Functions

b_disp_cal_data displays the calibration data cal_data.

b_disp_cal_results displays the coefficients b, the uncertainties of b, the covariance matrix of b, the residual and the maximum absolute value of weighted deviations.

b_disp_meas_results displays the measurement data x and meas_data.

b_plot plots the calibration data cal_data, the measurement data meas_data and the fit function using the coefficients b.

Source Code

https://github.com/wollmich/metas-b-least/

Releases

https://pypi.org/project/metas-b-least/

Requirements


Michael Wollensack METAS - 08.07.2025

Metadata

Release files for metas-b-least 0.6.0

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

Source distribution (sdist)

Source distribution for metas-b-least 0.6.0
File Size Uploaded Provenance Actions
metas_b_least-0.6.0.tar.gz 203.7 kB Without provenance Details for metas_b_least-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for metas-b-least 0.6.0
File Interpreter ABI Platform Actions
metas_b_least-0.6.0-py3-none-any.whl Python 3 none any Details for metas_b_least-0.6.0-py3-none-any.whl

Total release size: 412.5 kB

Release files / metas_b_least-0.6.0.tar.gz

Download URL metas_b_least-0.6.0.tar.gz
Size 203.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1e94dbdb179e5eef61a822bce9af37176e462e062d3f51c148a2ec236efec8bd
BLAKE2b-256 checksum
How to use checksums
26bc039523a20e8d35f001d3e3aaaba6d7704fbbe4e3f09d947c048ca4fa25a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6

Release files / metas_b_least-0.6.0-py3-none-any.whl

Download URL metas_b_least-0.6.0-py3-none-any.whl
Size 208.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d65f224dc6ee5e887f0eb9b3c7ad54d824e93ee142d0f6cca4366d0266b3b77a
BLAKE2b-256 checksum
How to use checksums
4f4a01bd3fd2dd3d1cecb7772d7925bfb3cba23f17d450e2bc8dfa55d8b34fef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6

Security for metas-b-least 0.6.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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