Class SampleMovementServiceBase

java.lang.Object
gda.factory.FindableBase
gda.images.camera.SampleMovementServiceBase
All Implemented Interfaces:
Findable, SampleMovementService, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
ScannableSampleMovementService

public abstract class SampleMovementServiceBase extends FindableBase implements SampleMovementService, org.springframework.beans.factory.InitializingBean
Base class for classes that implement SampleMovementService.
  • Constructor Details

    • SampleMovementServiceBase

      public SampleMovementServiceBase()
  • Method Details

    • setOmegaDirection

      public void setOmegaDirection(Utilities.OmegaDirection omegaDirection)
    • setAxisOrientationMatrix

      public void setAxisOrientationMatrix(org.apache.commons.math.linear.RealMatrix axisOrientationMatrix)
      Sets the beamline-specific axis orientation matrix, which is a 3×3 matrix that defines how the 'standard' axes map onto the beamline's axes.
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • moveSampleByMicrons

      public void moveSampleByMicrons(double h, double v, double b) throws DeviceException
      Description copied from interface: SampleMovementService
      Moves the sample in 'real-world' microns. When standing behind the goniometer, with the beam travelling right, H +ve is away from you, V +ve is vertically up, and B +ve is along the beam:

      In this coordinate system, the B and V axes are not affected by any rotation of the goniometer; they are always orthogonal with respect to the H axis.

      To calculate the required physical movement, this method will take into account the rotation of the goniometer. A movement along 'standard' goniometer axes will be calculated using the current value of ω (along with the direction in which the goniometer rotates for a +ve rotation of ω).

      Specified by:
      moveSampleByMicrons in interface SampleMovementService
      Throws:
      DeviceException
    • getOmega

      protected abstract double getOmega() throws DeviceException
      Throws:
      DeviceException
    • doRotation

      protected double[] doRotation(double h, double v, double b, double omega)
    • moveSampleByMicronsAlongStandardAxes

      public void moveSampleByMicronsAlongStandardAxes(double h, double v, double b) throws DeviceException
      Description copied from interface: SampleMovementService
      Moves the sample along the three standard goniometer axes. When standing behind the goniometer, with the beam travelling right, H +ve is away from you. The V and B axes are the axes that rotate as the goniometer rotates.

      When ω = 0°, V +ve will be vertically up, and B +ve will be along the beam, as with 'real-world' coordinates:

      As the goniometer rotates, the V and B axes also rotate. If the goniometer rotates anticlockwise for a +ve rotation of ω, then when ω = 90°:

      A beamline-dependent movement will be calculated using the beamline's axis orientation matrix. This simply involves reorienting the three axes.

      Specified by:
      moveSampleByMicronsAlongStandardAxes in interface SampleMovementService
      Throws:
      DeviceException
    • moveSampleByMicronsAlongBeamlineAxes

      public void moveSampleByMicronsAlongBeamlineAxes(double x, double y, double z) throws DeviceException
      Description copied from interface: SampleMovementService
      Moves the sample along the beamline's goniometer axes.
      Specified by:
      moveSampleByMicronsAlongBeamlineAxes in interface SampleMovementService
      Throws:
      DeviceException
    • getPosition

      protected abstract double[] getPosition() throws DeviceException
      Returns the current position of the sample.
      Returns:
      a 3-element double array
      Throws:
      DeviceException
    • setPosition

      protected abstract void setPosition(double[] position) throws DeviceException
      Sets the current position of the sample.
      Parameters:
      position - a 3-element double array
      Throws:
      DeviceException