Skip to main content

API for B22 AO operations

Project description

b22ao: API for B22 adaptive optics operations

This package provides the basic API for Adaptive Optics scripts running at beamline B22 in Diamond Light Source.

Adaptive Optics operations must implement b22ao.base.BaseOperation, which provides methods for deforming mirrors and capturing images. The implementation is run by the AO manager which will inject any given JSON configuration file.

Example:

from b22ao.base import BaseOperation
import numpy

class MyAO(BaseOperation):
    def start(self):
        max_iter = self.config['max_iter']

        self.select_dm(self.config['mirror'])

        self.stopping = False
        for iter in range(max_iter):
            if self.stopping:
                self.stopping = False
                break
            self.deform(numpy.zeros(97))
            self.capture()

        print("Finished!")

    def stop(self):
        self.stopping = True

And the configuration file:

{
  "max_iter": 300,
  "mirror": 2
}

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

b22ao-0.0.13.tar.gz (4.1 kB view hashes)

Uploaded source

Built Distribution

b22ao-0.0.13-py3-none-any.whl (5.9 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page