Skip to main content

METAS B LEAST is a Python implementation of the B LEAST program of the ISO 6143:2001 norm

Project description

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.

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)

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.

Source Code

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

Releases

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

Requirements


Michael Wollensack METAS - 28.10.2024

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

metas_b_least-0.1.1.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

metas_b_least-0.1.1-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file metas_b_least-0.1.1.tar.gz.

File metadata

  • Download URL: metas_b_least-0.1.1.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for metas_b_least-0.1.1.tar.gz
Algorithm Hash digest
SHA256 309faa938f0b41008f40ec0db7c702976649f3887c042b03606a45ed37c44b07
MD5 2e211271997e94505fc9cb43062b3199
BLAKE2b-256 cffc510de2c64de6feaa24400b5b523837b0bea91aa46d639c7031be1a5b99b1

See more details on using hashes here.

File details

Details for the file metas_b_least-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: metas_b_least-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for metas_b_least-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 13c4f48cd548a1ffd33e8f2fe716eac2bf33097fbfae20c7a3b12cead9f3e6c6
MD5 5e95a7598ace4257be977a7076cf1da8
BLAKE2b-256 6360ebc8c078171420fba70b55c5ba23275a494378563032a1a042d594383869

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page