ISISComputingGroup / ibex_bluesky_core

Core bluesky plan stubs & devices for use at ISIS. Not instrument/technique specific.
https://isiscomputinggroup.github.io/ibex_bluesky_core/
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Slit scan guess #72

Open jackbdoughty opened 7 hours ago

jackbdoughty commented 7 hours ago

Slit scan guess was sometimes strugglnig to converge due to initial guesses outside of the data, this causes all differentials to go to zero for some parameters and hence optimizer cannot work.

Simplified heuristic guessing function that keeps all initial parameters within the bounds of the data seemed to work well to give the optimizer a good chance of converging to a decent fit:

            background = np.min(y)
            inflection0 = np.min(x) + (1/3) * (np.max(x) - np.min(x))
            inflections_diff = (1/3) * (np.max(x) - np.min(x))
            gradient = 2 * (np.max(y) - np.min(y)) / (np.max(x) - np.min(x))
            height_above_inflection1 = (np.max(y) - np.min(y)) / 5.0

Needs unit tests etc adding

jackbdoughty commented 7 hours ago

See https://github.com/ISISComputingGroup/ibex_bluesky_core/pull/76