BCDA-APS / bluesky_training

Bluesky training, including instrument package
https://bcda-aps.github.io/bluesky_training/
Other
11 stars 0 forks source link

add slits to training demo #89

Closed prjemian closed 1 year ago

prjemian commented 1 year ago

Add the four motor slit as an example: https://bcda-aps.github.io/apstools/latest/api/_devices.html#slits

Motor assignments here: https://github.com/prjemian/epics-docker/tree/main/v1.1/n5_custom_synApps

Thanks @cpchuang, @pken for the suggestion!

prjemian commented 1 year ago
from apstools.synApps import Optics2Slit2D_HV
IOC = "gp:"
slit1 = Optics2Slit2D_HV(f"{IOC}Slit1", name="slit1")

which has this structure:

slit1
    h
        xp, xn, size, center
    v
        xp, xn, size, center
prjemian commented 1 year ago

The motor assignments should already be set in the IOC as part of the 2slit.db database.

### Slits (If not supplied, RELTOCENTER defaults to zero)
dbLoadRecords("$(OPTICS)/opticsApp/Db/2slit.db","P=$(PREFIX),SLIT=Slit1V,mXp=m3,mXn=m4,RELTOCENTER=0")
dbLoadRecords("$(OPTICS)/opticsApp/Db/2slit.db","P=$(PREFIX),SLIT=Slit1H,mXp=m5,mXn=m6,RELTOCENTER=0")

In the template code shown, the motors are: $(PREFIX)m3 to $(PREFIX)m6. Your motor assignments may be different.

prjemian commented 1 year ago

or

from apstools.synApps import Optics2Slit2D_InbOutBotTop
IOC = "gp:"
slit1 = Optics2Slit2D_InbOutBotTop(f"{IOC}Slit1", name="slit1")

which has this structure:

slit1
    top
    bot
    out
    inb
    hsize
    hcenter
    vsize
    vcenter
prjemian commented 1 year ago

There are two implementations, corresponding to differing and competing opinions of how the support should be implemented.

See the documentation: https://bcda-aps.github.io/apstools/latest/api/synApps/_db_2slit.html#module-apstools.synApps.db_2slit