BCDA-APS / bdp_controls

APS-U Beam line Data Pipelines - experiment controls with EPICS and Bluesky
Other
0 stars 1 forks source link

analysis procedures for workflow4 #41

Closed prjemian closed 1 year ago

prjemian commented 2 years ago

https://github.com/BCDA-APS/bdp_controls/blob/4d03dc272e584dabe8d5b079f4335cbe59d7ea31/qserver/instrument/plans/trajectories.py#L9-L13

prjemian commented 2 years ago

Concept for Analytical plan for Workflow 4

Comments? @keenanlang @tguruswamy @sveseli @tekinbicer

prjemian commented 2 years ago

Acquisition would move the fine positioners over a set of (x,y) points that fills a designated ROI, such as this 247-point map created by create_xy_positions(100, 900, 100, 900, 247, True):

Python code ```py import math import numpy as np def chunks(lst, n): """Yield successive n-sized chunks from lst.""" for i in range(0, len(lst), n): yield lst[i:i + n] def is_odd(n): return n % 2 == 1 def create_xy_positions(x0, x1, y0, y1, n=25, snake=True): """ Create a sorted list of random X,Y positions within a region of interest. Sort the list: - sort on X (first positioner) - if n>8, sort by sections (of size sqrt(n)) - sort each section on Y according to snake term """ coords = sorted( zip( x0 + (x1 - x0) * np.random.rand(n), y0 + (y1 - y0) * np.random.rand(n) ) ) if n > 8: # sort by sections num_in_section = int(math.sqrt(n)) arr = [] for row, chunk in enumerate(chunks(coords, num_in_section)): if snake: def sort_by_y(xy): return xy[1] chunk = sorted(chunk, key=sort_by_y, reverse=is_odd(row)) arr += chunk coords = arr return list(coords) ```

Here's an example set of 249 such (x,y) points, connected by lines: snake-249

Images would be generated at a fixed rate (acquisition period) and streamed by PVA. Current X&Y positions would be added as NDattribute metadata with each image.