Skip to main content

OptiCalib : python framework for OPTical CALibration of deformable mirrors and AO experimentation

GitHub Actions Workflow Status PyPI version Python versions License: MIT

Adaptive Optics Group, INAF - Osservatorio Astrofisico di Arcetri

OptiCalib is a python package which first goal is to make easy deformable mirror's calibration in the laboratory (and not only).

It was born as a general extrapolation of the software built for the control and calibration of the ELT @ M4 adaptive mirror and it's calibration tower, OTT (Optical Test Tower).

Note: to cite this package check CITATION.bib

Description

The OPTICALIB package serves two main purposes:

  • Making connection to the hardware (interferometers, DMs, ...) easy;

  • Providing routines for Deformable Mirrors calibrations.

The latests, stable, version can be installed from pypi:

pip install opticalib

The base install contains everything needed to talk to the hardware, run the simulators and the calibration routines, and use the calpy shell. Two optional extras add the rest:

pip install "opticalib[gui]"      # the graphical interface (calpy --gui / OptiCalib)
pip install "opticalib[cuda13]"   # GPU backend (CuPy, via xupy); use cuda12 for CUDA 12.x
pip install "opticalib[gui,cuda13]"  # extras can be combined

The in-development version can be installed directly from this repository:

pip install git+"https://github.com/ArcetriAdaptiveOptics/opticalib.git"

But do expect some bugs!

Upon installation, the software will create an entry point script called calpy, which is usefull to set up a specific experiment's environment. Let's say we have an optical bench composed of an interferometer 4D PhaseCam6110 and an Alpao Deformable mirror, say DM820. We can create the experiment's environment just like:

calpy -f ~/alpao_experiment --create

This will create, in the ~/alpao_experiment folder, the package's data folder tree, together with a configuration file in the SysConfig folder. The configuration file, documented in configuration documentation, is where all devices must be specified.

Example usage

Once done with the configuration, we can then start using out instruments:

calpy -f ~/alpao_experiment
# The `calpy` function will automatically import opticalib (with `opt` 
# as alias), as well as the `opticalib.dmutils` as dmutils

interf = opt.PhaseCam(6110) # set in the configuration file
dm = opt.AlpaoDm(820)       # set in the configuration file

# Having the bench set up and the configuration file set, we can acquire
# an Influence Function by just doing

tn = dmutils.iff_module.iffDataAcquisition(dm, interf) # Optional paramenters
# are `modeslist, modesAmplitude, template`, which if not specified are 
# read from the configuration file

Documentation

For the API references, check Opticalib API PDF (work in progress...), while for configuration details check configuration documentation.

Simulator data

Simulator data is no longer shipped inside the repository or Python package. All files used by the simulator are fetched on demand and cached locally.

You can pre-download all known simulator files:

from opticalib.simulator import prefetch_simdata

prefetch_simdata()

This avoids runtime downloads when simulators are instantiated.

The repository intentionally does not include the opticalib/simulator/_API/SimData payload anymore.

Metadata

Release files for opticalib 2.4.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 opticalib 2.4.0
File Size Uploaded Provenance Actions
opticalib-2.4.0.tar.gz 535.8 kB Without provenance Details for opticalib-2.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for opticalib 2.4.0
File Interpreter ABI Platform Actions
opticalib-2.4.0-py3-none-any.whl Python 3 none any Details for opticalib-2.4.0-py3-none-any.whl

Total release size: 1.0 MB

Release files / opticalib-2.4.0.tar.gz

Download URL opticalib-2.4.0.tar.gz
Size 535.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c3309b6b230efc72f970fae2bbbfa70028e1196f7884d4c9a839b8b26e63195c
BLAKE2b-256 checksum
How to use checksums
e1b51aa82a7df43efe33da0eb5de25dc249690f338db3edaf9d452c4f0a7dd8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / opticalib-2.4.0-py3-none-any.whl

Download URL opticalib-2.4.0-py3-none-any.whl
Size 465.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cbab1e5ce7eb41b44b0c433c231d74a6778fc9548a42237a42682aa649aca4c9
BLAKE2b-256 checksum
How to use checksums
9a7e3b8ffe946b8fbcba8ef0de0b6f9dea90a9f65448ae91b981ba9ab3967cf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for opticalib 2.4.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