Ejemplo n.º 1
0
 def __init__(self,
              evr,
              lcls,
              sequencer,
              polarity,
              xstage,
              ystage,
              rotPVbase,
              presetPVbase,
              codes,
              burstdelay=4.5e-3,
              flipflopdelay=8e-3,
              followerdelay=3.8e-5):
     self.x = xstage
     self.y = ystage
     self._rotPVbase = rotPVbase
     self.trigger = evr
     self._lcls = lcls
     self._seq = sequencer
     self._codes = codes
     self._burstdelay = burstdelay
     self._flipflopdelay = flipflopdelay
     self._followerdelay = followerdelay
     self._yPreset = stateiocDevice('%s:Y' % presetPVbase)
     for preset in self._yPreset.statesAll():
         self.__dict__['mv_' + preset] = partial(self._move_to_preset,
                                                 preset)
Ejemplo n.º 2
0
    def __init__(self,
                 PV,
                 screen_motor=None,
                 zoom_lens_motor=None,
                 lens_focus_motor=None,
                 led=None,
                 det=None,
                 zoomPV=None,
                 desc="PIM",
                 checkMECXRTBelens=None):
        if PV == "":
            self.pim = None
        else:
            self.pim = stateiocDevice(PV)

        self.y = screen_motor
        self.zoom = zoom_lens_motor
        self.focus = lens_focus_motor
        self.__led = led
        self.__desc = desc
        self.__det = det
        self.__zoomPV = zoomPV

        # Hutch specific routines that I don't know what to do with yet
        self._checkMECXRTBelens = checkMECXRTBelens = None  # Used in .sin() for MEC
        self._viewerlauncher = None  # Used in .viewer() in MEC
Ejemplo n.º 3
0
    def __init__(self,
                 ipmPV,
                 det=None,
                 ipimb=None,
                 mot_diode_x=None,
                 mot_diode_y=None,
                 mot_target_y=None,
                 desc="ipm",
                 show_dets=False):
        self._ipmPV = ipmPV
        diodePV = ipmPV + ":DIODE"
        targetPV = ipmPV + ":TARGET"
        self.diode = stateiocDevice(diodePV)
        self.target = stateiocDevice(targetPV)
        self.__show_dets = show_dets
        self.__det = det
        self.__desc = desc

        self.ipimb = ipimb
        self.dx = mot_diode_x
        self.dy = mot_diode_y
        self.ty = mot_target_y

        self.amiDet = self.__det
Ejemplo n.º 4
0
 def __init__(self, motors, mirrorPV, mirror, x=None, y=None, rx=None, ry=None, air_x=None, air_y=None, vac_x=None, vac_y=None, motors_in_way=None, flipper=None, glaswindow=None, bewindow=None):
   self.m=mirror
   if air_x is not None: self.air_x=air_x
   if air_y is not None: self.air_y=air_y
   if vac_x is not None: self.vac_x=vac_x
   if vac_y is not None: self.vac_y=vac_y
   if rx is not None: self.rx=rx
   if ry is not None: self.ry=ry
   if x is not None: self.x=x
   if y is not None: self.y=y
   self._motors = motors
   self._flip = flipper
   self._glaswindow = glaswindow
   self._bewindow = bewindow
   if self._flip is not None:
     setattr(self, self._flip._name, self._flip)
   self._inout = stateiocDevice(mirrorPV)
   if motors_in_way is None:
     self._motors_in_way = []
   else:
     self._motors_in_way = motors_in_way
   self._motors_in_way_name = [ mot_tup[0] for mot_tup in self._motors_in_way ]
   self._outpresetname = 'reflaser_beamline_position'
Ejemplo n.º 5
0
    def __init__(self,
                 lensX,
                 lensY,
                 lensZ,
                 yStatePV,
                 CRLConfigFile=config.DEFAULT_LENS_SET,
                 calibfile=None,
                 zoffset=None,
                 zdir=None,
                 zrange=None,
                 precisionLateral=0.05,
                 E=None,
                 attObj=None,
                 lclsObj=None,
                 monoObj=None,
                 beamsizeUnfocused=500e-6):
        """
    lensX, lensY, lensZ: motors that move the position of the lens set
    yStatePV: ims motor states PV for preset y positions. This is used to
      check which lens set is closest to the beam.
    CRLConfigFile: file that defines which lenses are being used.
      see /reg/neh/operator/xppopr/xpppython_files/Be_lens_sets/current_set
    calibfile: json file that defines beam trajectory.
      contains dx, dy, x_ref, y_ref, z_ref
    zoffset: distance from sample to lens_z=0 in meters
    zdir: 1 or -1, represents beam direction wrt z direction.
    zrange: array or tuple of 2 values: minimum and maximum z pos in meters
    precisionLateral: tolerance on xy deviations from calibrated beam path
      before python prints a warning. Same units as x, y (currently mm)
    E: energy override for calculations. If E is defined, we'll use it,
      otherwise we'll try to use the mono first and the lcls second.
    attObj: lusiatt attenuator object for instrument-safe moves.
    lclsObj: object that gets PVs from lcls (for energy)
    monoObj: object that gets energy from monochromator
    beamsizeUnfocused: radial size of x-ray beam before focusing.
    """

        self._CRLConfigFile = CRLConfigFile
        try:
            self._readLensSet()
        except Exception as exc:
            print "\n\nWARNING: Could not load lens sets from File!"
            print exc
            print "Crl calculations may not behave as expected.\n"
        self._calibfile = calibfile
        self._zrange = zrange
        self._zdir = zdir
        self._zoffset = zoffset
        self._precisionLateral = precisionLateral
        self.beamsizeUnfocused = beamsizeUnfocused

        self.x = lensX
        self.y = lensY
        self.z = lensZ
        self._E = E
        self._attObj = attObj
        self._lclsObj = lclsObj
        self._monoObj = monoObj

        self.ypos = stateioc.stateiocDevice(yStatePV)
        self.zpos = VirtualMotor('crl_zpos', self._moveZ, self._whereZ,
                                 self._waitall)
        self.beamSize = VirtualMotor('crl_beamsize', self._moveBeamsize,
                                     self._whereBeamsize, self._waitall)

        self.calc = blutil.belenses