Map a battery cell with a mesh scan¶
Raster the cell point by point and replay the raster while it charges, so that
medved can fold the patterns into a movie of maps.
The helper names every point after the BM01 mesh contract and writes the
mesh.json marker medved recognises the dataset by.
from bm01macros import Mesh
m = Mesh(cell='IFE-135',
slow=('prhor', -1.0, 0.1, 11),
fast=('battz', -0.5, 0.1, 11),
repeats=200,
exposure=1.0,
extension='xye',
integrated_dir='xye')
for series in m.scan():
for row in m.rows():
row.move()
for point in row.points():
point.move()
point.measure()
The axes are (motor, begin, step, count) in millimetres, the slow one being
the outer loop of the raster and the fast one the inner. repeats is how many
times the raster is replayed, exposure is seconds per point. Set
integrated_dir to the subdirectory bubble writes the integrated patterns into,
or to '' when it writes them next to the frames, and extension to their
extension. The files come out as
IFE-135_<series>_<slow>_<fast>, all counters five digits wide from zero.
Add dry_run=True to print the moves and the names without measuring anything,
which is the fastest way to check a mesh before the beam is on.
Restarting into the same folder after an interruption needs an explicit signature:
m = Mesh(cell='IFE-135', ..., resume=True)
The helper then checks the geometry against the marker on disk, continues from the first free series, and leaves the interrupted series as a hole. A geometry that does not match is refused: the old points would be laid out by the new one and the maps would silently lie.