Skip to content

Request: Scan parsers read motor motion units (new, only at FMB for now) from SPEC file header #259

@arwoll

Description

@arwoll

I have added a utility at FMB to print the units of each motor as part of the file header. I am requesting that if present, map processer (scan parser) should make use of that section to associate units with any scan motor positions read in.

Below is an example file header that includes such information. The code that created it is also appended below. The location of the header (prior to motors) is fixed. Note too that if the config file is changed and a motor added/subtracted, this header is NOT yet re-printed.

#F test_units3
#E 1774319653
#D Mon Mar 23 22:34:13 2026
#C spec User = chess_id3b
#U UNITS0 none deg mm deg mm mm mm mm
#U UNITS1 mm mm mm mm mm mm mm mm
#U UNITS2 mm mm mm mm mm mm mm mm
#U UNITS3 mm mm mm step mm mrad mm mm
#U UNITS4 mm mm mm mm mm mm mm mm
#U UNITS5 mm mm mm mm mm mm mm mm
#U UNITS6 mm mm mm mm mm none mm mm
#U UNITS7 mm mm mm mm mm mm mm mm
#U UNITS8 mm mm mm mm mm mm mm mm
#U UNITS9 mm mm mm mm mm mm mm mm
#U UNITS10 mm mm mm mm mm mm mm mm
#U UNITS11 mm mm mm mm mm mm mm mm
#U UNITS12 mm mm mm mm mm mm mm mm
#U UNITS13 mm mm mm mm mm mm mm mrad
#U UNITS14 mrad mrad mm mm mm mrad mrad mm
#U UNITS15 mm mrad mm mrad mrad mrad mm mm
#U UNITS16 mm mrad mrad mrad mm mm mm mrad
#U UNITS17 mrad mrad mm mm mm mrad mrad mrad
#U UNITS18 mm mm mm mrad mrad mrad mm mm
#U UNITS19 mm mrad mrad mm mm

#O0 KeepDummy0 mono monz mchi mony monx und_CL s0s
#O1 s0n s0t s0b s0x s0h s0z s0v mirzu
#O2 mirzd mirbu mirbd xu yu zu xd zld
#O3 zrd fpx ichx att mirz mirth s3b s3t
#O4 s3s s3n s3z s3v s3x s3h s1b s1t
#O5 s1s s1n s1z s1v s1x s1h xd2 zd2
#O6 zlu2 zru2 yd2 xu2 waxz waxtilt saxx saxz
#O7 andy andz yr9 xr9 zr9 yl9 zlu9 zld9
#O8 xd7 zd7 xu7 zu7 icvx icvz eigy eigz
#O9 xd11 zd11 xu11 zu11 camy camx camz s2b
#O10 s2t s2s s2n s2z s2v s2x s2h s4b
#O11 s4t s4s s4n s4z s4v s4x s4h samx
#O12 samz fmb_samy zd5 zru5 zlu5 yd5 xd5 xu5
#O13 tabx5 zr6 zlu6 zld6 yr6 yl6 xr6 txr
#O14 tyr tzr txt tyt tzt txr2 tzr2 txt2
#O15 tzt2 tyr2 tyt2 txr4 tyr4 tzr4 txt4 tyt4
#O16 tzt4 txr5 tyr5 tzr5 txt5 tyt5 tzt5 txr6
#O17 tyr6 tzr6 txt6 tyt6 tzt6 txr7 tyr7 tzr7
#O18 txt7 tyt7 tzt7 txr9 tyr9 tzr9 txt9 tyt9
#O19 tzt9 txr11 tzr11 txt11 tzt11


def chess_units_head() '{
local i, j, s, t, b

    for (i = 0, s = ""; i < MOTORS; i += 8) {
            s = s sprintf("#U UNITS%d ", i/8)
            for (j = i; j < i + 8 && j < MOTORS;) {
                    if (motor_name(mA[j]) != "unused") {
                            if ((t = motor_par(mA[j], "units")) == "" || t == 0 || t == -1)
                                    t = "none"
                            s = s sprintf("%s", t)
                    }
                    if (j%8 == 7)
                            break
                    s = s "  "
                    j++
            }
            s = s "\n"
            df_print(s)
            s = ""
    }

}'

def motor_units_on '
cdef("user_filehead", "chess_units_head();", "chess_units")
'
def motor_units_off '
cdef("", "", "chess_units", "delete")
'

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions