Skip to content

Commit

Permalink
TST #884
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Nov 16, 2023
1 parent 6e4e248 commit f98fbc0
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions apstools/plans/tests/test_alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,33 @@ def test_lineup(signals, mover, start, finish, npts, feature, rescan):
# # assert lo <= position <= hi, f"{bec=} {bec.peaks=} {position=} {center=} {width=}"


@pytest.mark.parametrize(
"signals, mover, start, finish, npts, feature, nscans",
[
[noisy, m1, -1.2, 1.2, 11, "max", 2], # slower, is motor
[pvoigt, axis, -1.2, 1.2, 11, "cen", 2], # faster, is ao (float)
[pvoigt, axis, -1.2, 1.2, 11, "max", 2],
[[pvoigt], axis, -1.2, 1.2, 11, "max", 2], # list
[[pvoigt, noisy, scaler1], axis, -1.2, 1.2, 11, "max", 2], # more than one detector
[(pvoigt), axis, -1.2, 1.2, 11, "max", 2], # tuple
[pvoigt, axis, -1.2, 1.2, 11, "cen", 1],
[pvoigt, axis, -1.2, 1.2, 11, "com", 1],
[pvoigt, axis, -1.2, 1.2, 11, "max", 1],
[pvoigt, axis, -1.2, 1.2, 11, "min", 1], # pathological
],
)
def test_lineup2(signals, mover, start, finish, npts, feature, nscans):
if isinstance(signals, SynPseudoVoigt):
signals.randomize_parameters(scale=250_000, bkg=0.000_000_000_1)
else:
change_noisy_parameters()

RE(bps.mv(mover, 0))
assert get_position(mover) == 0.0

RE(alignment.lineup2(signals, mover, start, finish, npts, feature=feature, nscans=nscans))


def test_TuneAxis():
signal = SynPseudoVoigt(name="signal", motor=m1, motor_field=m1.name)
signal.kind = "hinted"
Expand Down

0 comments on commit f98fbc0

Please sign in to comment.