Skip to main content

Calibration library

Project description

Xcalibu

author: Cyril Guilloud ESRF BCU 2013-2022

Xcalibu is a python library to manage calibrations tables or polynomia. It includes a PyTango device server in order to optionaly run it as a server.

xcalibu.py : python library Xcalibuds.py : PyTango device server

Xcalibu name comes from the first use of this library to calibrate undulators at ESRF.

installation

Available on PyPi or anaconda.org

usage

to plot: ./xcalibu.py -p

to debug:./xcalibu.py -d10

plot a file:./xcalibu.py -p examples/xcalibu_calib_poly.calib

import numpy
import xcalibu
calib = xcalibu.Xcalibu()
calib.set_calib_file_name("mycalib.calib")
calib.set_calib_type("TABLE")
calib.set_reconstruction_method("INTERPOLATION")
calib.set_calib_time("1234.5678")
calib.set_calib_name("CAL")
calib.set_calib_description("dynamic calibration created for demo")
calib.set_raw_x(numpy.linspace(1, 10, 10))
calib.set_raw_y(numpy.array([3, 6, 5, 4, 2, 5, 7, 3, 7, 4]))
calib.save()

This will create a file named mycalib.calib in your current directory.

% cat mycalib.calib
# XCALIBU CALIBRATION

CALIB_NAME=CAL
CALIB_TYPE=TABLE
CALIB_TIME=1234.5678
CALIB_DESC=dynamic calibration created for demo

CAL[1.000000] = 3.000000
CAL[2.000000] = 6.000000
CAL[3.000000] = 5.000000
CAL[4.000000] = 4.000000
CAL[5.000000] = 2.000000
CAL[6.000000] = 5.000000
CAL[7.000000] = 7.000000
CAL[8.000000] = 3.000000
CAL[9.000000] = 7.000000
CAL[10.000000] = 4.000000

That you can now use and plot for example:

% xcalibu ./mycalib.calib  -p

------------------------{ Xcalibu }----------------------------------
[xcalibu] - log level = INFO (20)
use "./mycalib.calib" argument as calib test file
XCALIBU - INFO - DATA lines read : 10
XCALIBU - INFO -  Ymin =          2  Ymax =          7  Nb points =   10
XCALIBU - INFO -  Xmin =          1  Xmax =         10  Nb points =   10
XCALIBU - INFO - TABLE + INTERPOLATION => NO FIT
XCALIBU - INFO - y value of 5.5 = 3.5 (3.361701965332031e-05)
XCALIBU - INFO - Calculation of 25 values of y. duration : 0.00021958351135253906
XCALIBU - INFO - Plotting

%

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

xcalibu-0.9.5.tar.gz (58.3 kB view details)

Uploaded Source

Built Distribution

xcalibu-0.9.5-py3-none-any.whl (62.8 kB view details)

Uploaded Python 3

File details

Details for the file xcalibu-0.9.5.tar.gz.

File metadata

  • Download URL: xcalibu-0.9.5.tar.gz
  • Upload date:
  • Size: 58.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.12

File hashes

Hashes for xcalibu-0.9.5.tar.gz
Algorithm Hash digest
SHA256 a8fd72d94de3bf8c2a1bff0048e5451db7a4a26f6b376c798164621340d11068
MD5 cb52a9019d91cb4fb4d098babfed6452
BLAKE2b-256 3c50258984bc65d635c6513979fe4cb4a2fb6808ac8fa9a0aeca97b3ee589bc0

See more details on using hashes here.

File details

Details for the file xcalibu-0.9.5-py3-none-any.whl.

File metadata

  • Download URL: xcalibu-0.9.5-py3-none-any.whl
  • Upload date:
  • Size: 62.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.12

File hashes

Hashes for xcalibu-0.9.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a0535034df25f4696b9cd07dfc91f0c97de6e8e6a91d4febe9d365c4c1f4f6c6
MD5 447d3656d8f2df1ce35ae21bbb347caf
BLAKE2b-256 8bedc4007d0ce6126e56f75a001d784a455c0dee4b6a9b998a67e6ada07f63a7

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