Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to transform scan specs #84

Open
DominicOram opened this issue Mar 28, 2023 · 0 comments
Open

Add the ability to transform scan specs #84

DominicOram opened this issue Mar 28, 2023 · 0 comments

Comments

@DominicOram
Copy link

DominicOram commented Mar 28, 2023

It would be nice if scanspec had the ability to transform (particularly rotate) a whole scan. For example something like:

from scanspec import some_rotation_obj

my_rotation = some_rotation_obj(axis=x, deg=45)

# Something required to specify x, y and z are 90 deg from each other

original_grid = Line(y, 0.0, 1.0, 3) * ~Line(x, 0.0, 1.0, 3)
new_grid = original_grid * my_rotation
print(original_grid, new_grid)
...
# [{'y': 0.0, 'x': 0.0}, {'y': 0.0, 'x': 0.5}, {'y': 0.0, 'x': 1.0}, {'y': 0.5, 'x': 1.0} ...
# [{'y': 0.0, 'z': 0.0, 'x': 0.0}, {'y': 0.0, 'z': 0.0, 'x': 0.5}, {'y': 0.0, 'z': 0.0, 'x': 1.0}, {'y': 0.25, 'z': 0.25, 'x': 1.0} ...

I appreciate this would require scanspec having to know about the co-ordiante system it is in, which is a big addition so don't mind if it's outside of the scope for scanspec. However, it is something that we need to do some variation of a lot and can sometimes be a bit fiddly so having a central module do it would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant