2025-12-11 14:56:21 +01:00
2024-09-25 12:36:48 +02:00
2024-09-25 12:36:48 +02:00
2024-09-25 12:36:48 +02:00
2024-09-25 12:36:48 +02:00
2025-12-11 14:56:21 +01:00
2024-10-31 15:56:41 +01:00
2024-09-25 12:36:48 +02:00
2024-12-11 15:26:01 +01:00
2024-12-11 15:26:01 +01:00
2024-12-11 15:26:01 +01:00
2022-07-14 14:24:04 +02:00
2024-10-31 15:56:41 +01:00
2024-12-18 08:13:08 +01:00
2022-09-09 15:54:18 +02:00
2022-07-14 14:24:04 +02:00
2024-09-25 12:36:48 +02:00
2022-07-14 09:16:29 +02:00

SwissMX

SwissMX is a python application to operate the SwissMX system at cristallina:
alt text

Repositories and dependencies (update:23.09.24)

repo https://git.psi.ch/ ~/Documents/prj/SwissFEL/ description
SwissMX grp-sf_cristallina/SwissMX.git apps/SwissMX Main python user interface fro SwissMX
PBSwissMX grp-sf_cristallina/PBSwissMX.git apps/PBSwissMX PowerBrick documents and tool to generate trajectories and motion programs for SwissMX
PBTools epics_support_apps/PBTools.git PBTools packages needed by PBSwissMX for low level communication to PowerBrick
ppmac epics_support_apps/ppmac.git PBTools/ppmac packages needed by PBTools for lowest level communication to PowerBrick
SW_MX epics_ioc_modules/SW_MX.git epics_ioc_modules/SW_MX IOC modules and generate.py for all SwissMX motors
flowchart BT

PBSwissMX --> SwissMX
PBTools --> PBSwissMX 
ppmac --> PBTools
SW_MX-->PBSwissMX

installation location

repo installed at
SwissMX /sf/cristallina/applications/SwissMX/
PBSwissMX /sf/cristallina/applications/SwissMX/PBSwissMX/
PBTools /sf/cristallina/applications/SwissMX/PBTools/
ppmac /sf/cristallina/applications/SwissMX/PBTools/ppmac/
SW_MX /ioc/modules/SW_MX/ and ioc directories

deployment and tests (update: 31.10.24)

push local stuff to git

zamofing_t@ganymede:
cd ~/Documents/prj/SwissFEL/apps/SwissMX &&\
git commit-amend &&\
git push psigithub -f

cd ~/Documents/prj/SwissFEL/apps/PBSwissMX &&\
git commit-amend &&\
git push psigithub -f

switch to latest test environment

ssh saresc-cons-03

cd /sf/cristallina/applications/SwissMX &&\
git checkout master &&\
git stash push &&\
git fetch psigithub master &&\
git reset psigithub/master --hard &&\
git stash pop
#git pull psigithub --ff-only master

cd /sf/cristallina/applications/SwissMX/PBSwissMX &&\
git checkout master &&\
git stash push &&\
git fetch psigithub master &&\
git reset psigithub/master --hard &&\
git stash pop
#git pull psigithub --ff-only master

chmod -R g+w /sf/cristallina/applications/SwissMX

run application

*** with official python ***
additionally needed packages:
RH7:
[saresc-vcons-01 ~]$ /opt/gfa/python-3.8/latest/bin/pip install --user qtawesome
RH8:
[saresc-cons-03 ~]$ pip install --user qtawesome
swissmx

*** with conda environment ***
ssh gac-cristall@saresc-cons-03  (pw:ValToira_2021)
cd /sf/cristallina/applications/SwissMX/
# conda env list
conda activate crmx38
python swissmx.py --sim 0xc0

Document to start SwissMX in cristallina environment (maintained by John): https://docs.google.com/document/d/1yEmV_DbRBKQKVCoovjXriNgSjNEBaz50WA0l3yA5jtg/edit#heading=h.z9io692b8tow

code generation parameters

copied from: PBSwissMX/python/shapepath.py: ShapePath.setup_motion

    generates program <prgId> and saves to fnPrg
    the type of generated program is defined by <mode>$
    -> the list af all points that will be  moved at, is in 'mot_pts'

    (m)= mandatory
    (o)= optional
    common kwargs:
      scale      : (o) scaling velocity (default=1. value=0 would stop at each point
      cnt        : (o) move path multiple times (default=1)
      dwell      : (o) dwell time at end (default=100ms)

    mode:0  unused
    mode:1  pvt motion point list
            common kwargs plus:
              points : (m) point list
              trf    : (o) transformation that will be done on 'points', mot_pts=trf*points
    mode:2  unused
    mode:3  pvt motion point list using inverse fft velocity
            common kwargs plus:
              points : (m) point list
              trf    : (o)  transformation that will be done on 'points', mot_pts=trf*points
              numPad : (o) number of padding points to reduce aliasing (default=16)
    mode:4  pvt motion short code using grid parameters
            common kwargs plus:
              trf : (o) transformation that will be done on 'grid points'
              grid: (m) grid parameters: {orig:(0,0),pitch(10,10),cnt:(10,10),mode:0}
    mode:5  pvt motion 'stop and go' short code using grid parameters.
            Instead of continous motion it moves and waits as given in the parameters
            common kwargs plus:
              trf :  (o) transformation that will be done on 'grid points'
              grid:  (m) grid parameters: {orig:(0,0),pitch(10,10),cnt:(10,10),mode:0}
              tmove: (m) time to move in ms (move start on FEL-trigger
              twait: (m) time to wait in ms
              (tmove+twait will be rounded to a multiple of fel_per)
    mode:6  pvt motion 'hit and return using grid parameters. continous motion on 2n ells to pump then same 2n wells to probe, then go 2 rows down
            common kwargs plus:
              trf   : (o) transformation that will be done on 'grid points'
              grid  : (m) grid parameters: {orig:(0,0),pitch(10,10),cnt:(10,10),mode:0}
              ssz   : (m) section size (in wells)
              smv   : (o) time(in num of shots) to move to next section (horiz/vert)
                      default is (ssz[0]-1,ssz[1])
              sdelay: (o) shots count of delay. Default is ssz[0]*ssz[1]

Examples:
  mode:1
  mode:3
  mode:4
  mode:5,tmove:20,twait:30
  mode:6,ssz:(4,3)

graphical object parameters

  FixTarget:
    90*40+480*2=4560
    60*30+360*2=2520
    2520-240=2280  
    4560-240=4320
    size in mm, dscr.size in user units (um)
   "size:(6,3.5),
    dscr: {
      size:(4560,2520), 
      fiducial:{type:0,pos:((240,240),(4320,240),(240,2280),(4320,2280))},
      grid:{pos:(480,360),pitch:(90,60),count:(40,30)}
    }"

  grid:
    size, fiducialSize in mm:
    (60-1)*.120 -> 7.08mm
    (45-1)*.120 -> 5.28mm
    fiducialSize -> 0.1mm
    "size:(7.08,5.28),cnt:(60,45),fiducialSize:.01"

  SwissMX():
   "ofs:[.2,.2],width:10,fidScl:.02,fiducial:[[.1,.1],[.1,2.7],[10.3,.1],[10.3, 2.7]]"
  SwissFEL():
   "ofs:[.2,.2],width:10,fidScl:.02,fiducial:[[.1,.1],[.1,2.2],[10.3,.1],[10.3,2.2]]"

fully parameter examples:

  "mode:4,size:(7.08,5.28), cnt:(60,45), fiducialSize:.01"   -> add a grid

  "mode:6,ssz:(4,3), size:(7.08,5.28), cnt:(60,45), fiducialSize:.01"   -> add a grid
  "mode:6,ssz:(4,3), size:(3,1.5), cnt:(30,15), fiducialSize:.01"   -> add a grid

  "mode:6,ssz:(6,8), 
  dscr: {
    size:(4560,2520),
    fiducial:{type:0,pos:((240,240),(4320,240),(240,2280),(4320,2280))},
    grid:{pos:(480,360),pitch:(90,60),count:(40,30)}
  }"  -> add a FixTarget


testing hit and return:

-> add a FixTarget
 "mode:6,ssz:(6,8), 
  dscr: {
    size:(4560,2520),
    fiducial:{type:0,pos:((240,240),(4320,240),(240,2280),(4320,2280))},
    grid:{pos:(480,360),pitch:(90,60),count:(40,30)}
  }"  -> add a FixTarget
Description
No description provided
Readme 856 KiB
Languages
Python 98.8%
CSS 0.8%
Makefile 0.3%
Shell 0.1%