Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

convert SPEC config to ophyd #7

Closed
prjemian opened this issue Jul 11, 2019 · 5 comments
Closed

convert SPEC config to ophyd #7

prjemian opened this issue Jul 11, 2019 · 5 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@prjemian
Copy link
Collaborator

Attempt a conversion of the 8-ID-I SPEC config file to ophyd using the spec2ophyd tool. The tool is experimental so it may not be successful for the entire configuration. Worth a try.

@prjemian prjemian added the enhancement New feature or request label Jul 11, 2019
@prjemian prjemian added this to the initial setup milestone Jul 11, 2019
@prjemian
Copy link
Collaborator Author

Where are they? Cannot find in ~8idiuser/spec

@prjemian
Copy link
Collaborator Author

Aha! Found it by examining the ~/bin directory: /home/beams/S8SPEC/spec/config

@prjemian
Copy link
Collaborator Author

The autoconversion script has a lot to learn. First problem:

(base) bash-4.2$ python ./spec2ophyd.py
['MOT000 ', ' EPICS_M2:6/1   2000  1  2000  200   50  125    0 0x003     flyz  flyz']
['MOT001 ', '    NONE:2/64   2000  1  2000  200   50  125    0 0x003  StrainN  StrainN']
['MOT002 ', ' EPICS_M2:2/16   2000  1  2000  200   50  125    0 0x003     ti3y  ti3y']
['MOT003 ', ' EPICS_M2:2/41   2000  1  2000  200   50  125    0 0x003     si6b  si6b']
['MOT004 ', ' EPICS_M2:2/42   2000  1  2000  200   50  125    0 0x003     si6t  si6t']
['MOT005 ', ' EPICS_M2:2/55   2000  1  2000  200   50  125    0 0x003     si5x  si5x']
['MOT006 ', ' EPICS_M2:2/56   2000  1  2000  200   50  125    0 0x003     si5z  si5z']
['MOT007 ', ' EPICS_M2:2/43   2000  1  2000  200   50  125    0 0x003     si6B  si6B']
['MOT008 ', ' EPICS_M2:2/44   2000  1  2000  200   50  125    0 0x003     si6T  si6T']
['MOT009 ', ' EPICS_M2:2/129   2000  1  2000  200   50  125    0 0x003      tth  tth']
['MOTPAR:misc_par_1 ', ' sm1']
Traceback (most recent call last):
  File "./spec2ophyd.py", line 229, in <module>
    main()
  File "./spec2ophyd.py", line 224, in main
    spec_cfg.read_config()
  File "./spec2ophyd.py", line 184, in read_config
    motor = SpecMotor(line)
  File "./spec2ophyd.py", line 58, in __init__
    self.index = int(lr[0].strip("MOT"))
ValueError: invalid literal for int() with base 10: 'PAR:misc_par_1 '

which comes from this part of the config file:

# Motor    cntrl steps sign slew base backl accel nada  flags   mne  name
MOT000 = EPICS_M2:6/1   2000  1  2000  200   50  125    0 0x003     flyz  flyz
MOT001 =    NONE:2/64   2000  1  2000  200   50  125    0 0x003  StrainN  StrainN
MOT002 = EPICS_M2:2/16   2000  1  2000  200   50  125    0 0x003     ti3y  ti3y
MOT003 = EPICS_M2:2/41   2000  1  2000  200   50  125    0 0x003     si6b  si6b
MOT004 = EPICS_M2:2/42   2000  1  2000  200   50  125    0 0x003     si6t  si6t
MOT005 = EPICS_M2:2/55   2000  1  2000  200   50  125    0 0x003     si5x  si5x
MOT006 = EPICS_M2:2/56   2000  1  2000  200   50  125    0 0x003     si5z  si5z
MOT007 = EPICS_M2:2/43   2000  1  2000  200   50  125    0 0x003     si6B  si6B
MOT008 = EPICS_M2:2/44   2000  1  2000  200   50  125    0 0x003     si6T  si6T
MOT009 = EPICS_M2:2/129   2000  1  2000  200   50  125    0 0x003      tth  tth
MOTPAR:misc_par_1 = sm1

@prjemian
Copy link
Collaborator Author

Config file attached here for improving the converter. Suggest reporting the unrecognized MOTPAR terms as comments marked TODO:

config.txt

@prjemian
Copy link
Collaborator Author

prjemian commented Jul 20, 2019

spec2ophyd tool ready to use from master branch, all lines from 8IDI config file handled

@prjemian prjemian assigned prjemian and unassigned jkirchman Jul 20, 2019
prjemian added a commit that referenced this issue Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants