Skip to main content

Calibration library

Project description

Xcalibu

author: Cyril Guilloud ESRF BCU 2013-2023

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 deal with undulators calibrations 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

Examples

TABLE + INTERPOL

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.plot()
calib.save()  # create a file named `mycalib.calib` in your current directory.

TABLE + POLYFIT

import numpy
import xcalibu
calib = xcalibu.Xcalibu()
calib.set_calib_file_name("mycalib.calib")
calib.set_calib_type("TABLE")
calib.set_reconstruction_method("POLYFIT")
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, 15))
calib.set_raw_y(numpy.array([4.1, 3.5, 3.6, 4.2, 4.5, 4, 3.9, 3.8, 4.5, 4.6, 6, 6.2, 4.7, 5, 4]))
calib.set_fit_order(6)
calib.fit()
calib.plot()

POLY


% 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

command line usage

Options: -h: help -p: plot -d: debug

-t type -r reconstruction_method -k kind of interpolation -n name

example: ./xcalibu.py -n calinou -t TABLE -r INTERPOLATION -k cubic examples/U32a_1_table.dat -p

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.9.tar.gz (56.9 kB view details)

Uploaded Source

Built Distribution

xcalibu-0.9.9-py3-none-any.whl (73.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xcalibu-0.9.9.tar.gz
  • Upload date:
  • Size: 56.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for xcalibu-0.9.9.tar.gz
Algorithm Hash digest
SHA256 5d40786312ec2ca2a5ac57f45e8c1d42f00b3bb1a729e287599e307d457d8eab
MD5 ba5bbc3a63a32def7291e3ec3d88a332
BLAKE2b-256 f1bed17f759d0290a6719b3323a7767e33a8fca04c5cc8cbab93cab7c6742cd5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xcalibu-0.9.9-py3-none-any.whl
  • Upload date:
  • Size: 73.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for xcalibu-0.9.9-py3-none-any.whl
Algorithm Hash digest
SHA256 96119cd9ea5ee550ab2e56de89699eeeadf45e4824e08e1d735668ad7fe68bfb
MD5 4c125e8d4e14bd264c0c85d4ac9d81c3
BLAKE2b-256 bb117d33d40ff3883202b7fe84d5b246852177ea469eba36676887ccb37ee612

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