Skip to main content

API for b22 adaptive optics 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.1.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

b22ao-0.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file b22ao-0.1.0.tar.gz.

File metadata

  • Download URL: b22ao-0.1.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for b22ao-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5b1b13df0815648607b6a5536cbe71d30195452bbcdeb38b274cc2402fd79a9a
MD5 2874a09608356adc149085f9ddfa0454
BLAKE2b-256 a1706992afce0b9bb3ad0c7507d2d0017e8bda5bd10bfd9e9df5c71ff7e42e09

See more details on using hashes here.

File details

Details for the file b22ao-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: b22ao-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for b22ao-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e27bb5582cdb49308bb835506b46c13a0edad97e4e1b2ddec1bf7f2533946991
MD5 8f68248b9312fdf20d58c440f06e581e
BLAKE2b-256 517faa4c3b3af8c83d306510b70ad6eb93fa71c39b62b915b08ef9af65fdbb07

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