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
}

Gotchas

1. The ZMQ_SERVER address

The ZMQ_SERVER global variable needs to point to the maching currently running pywincam, which will send the images over. When the workstation is changed/upgraded, the zmq server address needs to be updated too. It is currently using the b22-down-11 endstation (as of Jan. 26), thus the configuration is:

ZMQ_SERVER = "b22-down-11.diamond.ac.uk" 
ZMQ_DATA_PORT = 1515
ZMQ_CAMERA_TRIGGER_PORT = 1516

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

b22ao-0.2.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: b22ao-0.2.0.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for b22ao-0.2.0.tar.gz
Algorithm Hash digest
SHA256 081270d626756a6d461e17d0876c86b021e8a798075c2d03a23794e1d8d224f2
MD5 d2dbf46c4841f05c55319ee7b110f30a
BLAKE2b-256 d3e3609b90cc32d3b3d736d8683f3427c04825a032830efd8b9dd815bd6188f7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: b22ao-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for b22ao-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b8b8943182b8f3fa98e5f1f41a56da75a1273f94bb827cbfdff0dd7a4b6cb80
MD5 ac4674fad09489126be82964e12e7681
BLAKE2b-256 319b59048122c4df0151e7e2daacd1f84803451634c59ae1b2a3f205f71acc0c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page