Skip to content

Conversation

@jackbdoughty
Copy link
Contributor

@jackbdoughty jackbdoughty commented Jun 24, 2025

spin echo plan for larmor src/ibex_bluesky_core/larmor_jack_plan.py
not intending to merge

@jackbdoughty
Copy link
Contributor Author

A part of this file relies on #164. @Tom-Willemsen said happy to accept this and change later after 164 is merged

@jackbdoughty
Copy link
Contributor Author

Example of how could use this interface:

from typing import Generator
from bluesky.utils import Msg
from ibex_bluesky_core.fitting import Linear
from ibex_bluesky_core.larmor_jack_plan import auto_tune_ib, EchoScanConfig, AutoTuneConfig


def foo() -> Generator[Msg, None, None]:

    esconfig = EchoScanConfig(
        axis="bob",
        start=0.0,
        stop=10.0,
        flipper="TE:NDW2452:SIMPLE:VALUE:P3",
        wavelength_bounds=[[0, 999999999],[0,1]],
        num_points=3,
        detector=1
    )

    atconfig = AutoTuneConfig(
        model=Linear.fit(),
        param="c1"
    )

    yield from auto_tune_ib(esconfig, atconfig)

@jackbdoughty
Copy link
Contributor Author

Coverage issue expected as no unit tests for LARMOR inst script/plan

)

# Move the axis to the optimal value
bps.mv(scan_config.axis, optimal_param.value)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bps.mv takes a device rather than a string - you could just make the axis_dev at this level and then pass it into echoscan_axis_ib() though

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I know this won't be merged but just thinking before we copy and paste it onto LARMOR)

@rerpha
Copy link
Contributor

rerpha commented Jul 1, 2025

Another thing - I don't think this sets the number of periods yet - it should probably be num_points * 2 - I think we want to do it at this level. or by calling with_num_periods when #164 is merged?

@jackbdoughty
Copy link
Contributor Author

Another thing - I don't think this sets the number of periods yet - it should probably be num_points * 2 - I think we want to do it at this level. or by calling with_num_periods when #164 is merged?

i reckon waiting for #164 is a good idea for this

@Tom-Willemsen
Copy link
Member

We installed this on LARMOR (with a few modifications) and were able to get some spin-echo scans going.

Capture3

We now no longer need this PR to stay around now that we've installed on LARMOR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants