This is an example using scopyon
(https://scopyon.readthedocs.io/).
In [1]:
import scopyon
Set the configuration first.
In [2]:
config = scopyon.DefaultConfiguration()
config.default.detector.exposure_time = 33.0e-3 # second
In [3]:
config.default.detector
Out[3]:
You can also set parameters with units using pint
(See https://pint.readthedocs.io/):
In [4]:
from scopyon.constants import ureg
config.default.detector.exposure_time = 33.0 * ureg.millisecond
A field of microscopic view could be calculated as follows:
In [5]:
pixel_length = config.default.detector.pixel_length / config.default.magnification
L_2 = config.default.detector.image_size[0] * pixel_length * 0.5
Randomly generate positions of 100 molecules in two dimensions.
In [6]:
import numpy.random
rng = numpy.random.RandomState(123)
N = 100
inputs = rng.uniform(-L_2, +L_2, size=(N, 2))
scopyon.form_image
generates a single image from the given inputs.
In [7]:
img = scopyon.form_image(inputs, config=config, rng=rng)
In [8]:
img
You can also save an image.
In [9]:
img.save("tirf_000.png")
In [10]:
from IPython.display import Image
Image("tirf_000.png")
Out[10]: