Example plans

Introduction

This is a collection of a couple sample plans, using simulated devices from the ophyd.sim module, along with a command-line interface useful for quick testing of runs.

Command-line

Executing python .../simulated_samples.py -h should bring up a help message specifying how to make a sample run, like so:

usage: simulated_samples.py [-h] [-n NUM] [--kafka-topic KAFKA_TOPIC] [--kafka-bootstrap KAFKA_BOOTSTRAP] {random-1d,gaussian-1d,random-2d,gaussian-2d}

positional arguments:
  {random-1d,gaussian-1d,random-2d,gaussian-2d}
                        Which program to run.

options:
  -h, --help            show this help message and exit
  -n NUM, --num NUM     Number of times to run the program. (Default: 1)
  --kafka-topic KAFKA_TOPIC
                        Kafka topic to connect to. (Default: swc-kafka-test)
  --kafka-bootstrap KAFKA_BOOTSTRAP
                        Kafka bootstrap server address to connect to. (Default: localhost:9092)

For instance, executing a plan that generates a gaussian bell over 32 points, and transmits the generated documents to a Kafka broker at IP 1.2.3.4, in the my_test topic, would look like this:

python .../simulated_samples.py --kafka-topic my_test --kafka-bootstrap 1.2.3.4 gaussian-1d

, and would generate something like that in a viewer monitoring that topic:

_images/sample_gaussian_1d.png

Plans

sophys.common.plans.simulated_samples.sample_random_1d(*, hw)[source]

Small test with a time-spaced random curve.

sophys.common.plans.simulated_samples.sample_gaussian_1d(*, hw)[source]

Small test with a bell curve.

sophys.common.plans.simulated_samples.sample_random_2d(*, hw)[source]

Small test with a random image.

sophys.common.plans.simulated_samples.sample_gaussian_2d(*, hw)[source]

Stress test with a big, fast grid scan