13 """Create or verify a shared memory image (shmim) with the specified parameters.
15 Creates a new shared memory image if it does not exist, or verifies that an existing
16 image has the correct shape and data type. If an existing image has incompatible
17 parameters, it is destroyed and recreated.
20 name (str): The name of the shared memory image to create or access.
21 shape (tuple): The desired shape of the array as (height, width).
22 dtype (type, optional): The numpy data type for the array.
23 Defaults to np.float32 (FLOAT). Can also be np.float64 (DOUBLE).
29 This function closes the connection to the shmim after creation/verification.
30 Other processes can open the shmim by its name independently.
32 img = ImageStreamIOWrap.Image()
35 if img.open(name) == 40:
36 img.create(name, np.zeros(shape, dtype=dtype))
39 if not (img.md.size[0] == shape[0]
and img.md.size[1] == shape[1]
and img.md.datatype == (ImageStreamIOWrap.ImageStreamIODataType.FLOAT
if dtype == np.float32
else ImageStreamIOWrap.ImageStreamIODataType.DOUBLE)):
41 img.create(name, np.zeros(shape, dtype=dtype))
48 """Configuration for the aoSim application.
50 num_modes : int = xconf.field(default=2, help=
"Number of modes to simulate in the AO system.")
51 lag : int = xconf.field(default=1, help=
"Lag in timesteps for DM command updates.")
52 noise : float = xconf.field(default=0.0, help=
"Amplitude of noise to add to the wavefront sensor measurements.")
53 frequency : float = xconf.field(default=0.5, help=
"Frequency in Hz at which the AO simulation loop runs.")