Skip to content

Fix #1935 - corrections of discrepancies / inconsistencies in motors#1936

Open
CoePaul wants to merge 3 commits intomainfrom
dodal1935
Open

Fix #1935 - corrections of discrepancies / inconsistencies in motors#1936
CoePaul wants to merge 3 commits intomainfrom
dodal1935

Conversation

@CoePaul
Copy link
Contributor

@CoePaul CoePaul commented Feb 23, 2026

  • dodal devices motors script hereby has corrections applied to: YXStage class now lists relevant motor axes as Y and X

  • motor stage with 3 linear axes and 3 rotations is hereby labelled as a six-axis ( rather than five ) stage

  • inconsistencies in the layout of axes constants are thrashed out (previously linear motors were all in a line, rotation axes isolated perhaps it was a poetic metaphor ? )

  • Grammar corrected when spelling out motors as a set of motors rather than as one or more letters and a letter labelled motor

  • Replaces cross product symbol ( which was not rendering on github - nor in simple text editor )
    with the phrase "cross product of y with z" ( in the description of the x axis direction definition )

Fixes #1935

Instructions to reviewer on how to test:

  1. Check corrections made to motors script
  2. Confirm no new discrepancies added to documentation etc
  3. Confirm CI doesn't fall over due to any spurious typos

Checks for reviewer

  • Would the PR title make sense to a scientist on a set of release notes
  • If a new device has been added does it follow the standards
  • If changing the API for a pre-existing device, ensure that any beamlines using this device have updated their Bluesky plans accordingly
  • Have the connection tests for the relevant beamline(s) been run via dodal connect ${BEAMLINE}

@CoePaul CoePaul requested a review from a team as a code owner February 23, 2026 22:01
@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.08%. Comparing base (36d3bf0) to head (8ba521d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1936   +/-   ##
=======================================
  Coverage   99.08%   99.08%           
=======================================
  Files         314      314           
  Lines       11802    11804    +2     
=======================================
+ Hits        11694    11696    +2     
  Misses        108      108           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

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

Thanks, couple of points. Only one blocking.

class Stage(StandardReadable, ABC):
"""For these devices, the following co-ordinates are typical but not enforced:
- z is horizontal & parallel to the direction of beam travel
- z is horizontal & parallel to the direction of synchrotron particle travel (whence the x-rays direction)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Whence isn't a very commonly used word, particularly for people with English as a second language, I would just say (the x-rays direction)

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't know that it is related to the direction of synchrotron particle - do you mean electrons? then it's quite unclear on which part of the ring - undulator? but then there are many mirrors that change photon light direction so final x-ray direction on the endstation is not necessarily same direction as electrons in undulator (also electrons in undulator have quite a jiggle). I would just leave x-ray beam direction.
P.S. I confirm I see "whence" probably second time in my life - had to google that.

Copy link
Contributor

Choose a reason for hiding this comment

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

I also agree that beam direction makes more sense to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I accept that ambiguous documentation is probably not the place to unpack the axis definition facility.
The basic point was: Particle accelerators usually take the accelerator physics definitions of z along the particle beam ( be they electrons, protons ... other particles are accelerated - eg pions etc ), then y is made to point up and x falls wherever it needs to to get the right handed cross product. In the case of a ring shaped accelerator this usually makes the x axis point away from the centre of the ring.
Therefore the axis direction convention for the facility comes from the particle beam not the x-ray beam.
( It just happens that the prevailing x ray direction followed the tangent from the electrons orbit )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's true whence / whither / wherefore are from the Germanic roots of English and used rarely.
But we didn't replace them with any shorter / more recognisable words and Romance / Germanic languages have a single word for the same concept - even if those languages have also followed the modern trend of replacing a single word with several. Whence = German woher, woraus Latin unde -> Italian donde but also da dove, da cui

I'm more inclined to agree with removing a flowery unusual word with a simpler more common alternative - when this is a single word.

Here I agreed to scrap whence and go with a sentence

Copy link
Contributor

@Villtord Villtord Feb 25, 2026

Choose a reason for hiding this comment

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

I accept that ambiguous documentation is probably not the place to unpack the axis definition facility. The basic point was: Particle accelerators usually take the accelerator physics definitions of z along the particle beam ( be they electrons, protons ... other particles are accelerated - eg pions etc ), then y is made to point up and x falls wherever it needs to to get the right handed cross product. In the case of a ring shaped accelerator this usually makes the x axis point away from the centre of the ring. Therefore the axis direction convention for the facility comes from the particle beam not the x-ray beam. ( It just happens that the prevailing x ray direction followed the tangent from the electrons orbit )

Thanks for clarifying this. I was absolutely sure scientists care about aligning with x-ray beam in stage coordinate system, so while you are correct in strict definition of accelerator coordinate system maybe in reality on the beamlines it is often aligned with x-ray beam first (irrelevant whether it is aligned with electron momentum or not)?

Copy link
Contributor

Choose a reason for hiding this comment

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

Would tangent to the electron orbit be a easier to understand description than "horizontal & parallel to the direction of synchrotron particle travel"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would tangent to the electron orbit be a easier to understand description than "horizontal & parallel to the direction of synchrotron particle travel"?

I'm inclined to strong agree with You - we already have ( for the Y direction ) the highly pedantic language about being anti-parallel to gravity ( when "pointing up" would have been fine IMHO )

x-rays are particles too - it can get quite messy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

scientists care about aligning with x-ray beam
True for a team on a given beamline
but the x,y,z are facility ( ie diamond light source ) definitions first -
which arose from accelerator physics conventions
( and dodal is - I assumed - trying to provide facility level definitions )

Within a beamline they are free to rename x,y,z --> u,v,w if they want to
( provided it only covers their own beamline )
But given that the rest of the documentation was unpacking the facility definitions of x,y,z I continued in that vein


class YZStage(Stage):
"""Two-axis stage with an x and a z motor."""
"""Two-axis stage with an x motor and a y motor."""
Copy link
Contributor

Choose a reason for hiding this comment

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

Should: Shouldn't this be Y and Z?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Darn!

@CoePaul CoePaul force-pushed the dodal1935 branch 2 times, most recently from 825f8d3 to 73abf30 Compare February 26, 2026 18:35
* dodal devices motors script hereby has corrections applied to:
  YXStage class now lists relevant motor axes as Y and X

* motor stage with 3 linear axes and 3 rotations is hereby labelled as
   a six-axis ( rather than five ) stage

* inconsistencies in the layout of axes constants are thrashed out
  (previously linear motors were all in a line, rotation axes isolated
    perhaps it was a poetic metaphor ? )

* Grammar corrected when spelling out motors as a set of motors
    rather than as one or more letters and a letter labelled motor
* dodal devices motors script hereby has corrections applied to:
  YZStage class now lists relevant motor axes as Y and Z

* replaced whence with longer explanation
* Amend documentation as per CR requests
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

Successfully merging this pull request may close these issues.

Fix minor mistakes in motors documentation

4 participants