Class SpecsPhoibosController

java.lang.Object
gda.factory.ConfigurableBase
uk.ac.diamond.daq.devices.specs.phoibos.SpecsPhoibosController
All Implemented Interfaces:
Configurable, gda.observable.IObservable

public class SpecsPhoibosController extends ConfigurableBase implements gda.observable.IObservable
The EPICS controller class for operating SPECS Phoibos electron analysers. The class interact only with the CAM plugin which contains the specific PVs to control the electron analyser, and to read back the collected data.

Only operation in kinetic energy (KE) mode is supported. For users to work in binding energy (BE) that needs to be implemented at a higher level.

  • All energies are in electron volts (eV)
  • All angles are in degrees (deg)
  • All positions are in millimetres (mm)
This class is closely related to the equivalent class for VG Scienta analysers VGScientaController
  • Field Details

  • Constructor Details

    • SpecsPhoibosController

      public SpecsPhoibosController()
  • Method Details

    • getBasePVName

      public String getBasePVName()
    • setBasePVName

      public void setBasePVName(String basePVName)
    • configure

      public void configure()
      Configures the analyser controller and checks it is in a state to be used by GDA.

      Default implementation for classes that do not have to do any specific configuration.
      Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.

      Specified by:
      configure in interface Configurable
      Overrides:
      configure in class ConfigurableBase
      See Also:
    • setLensMode

      public void setLensMode(String value) throws Exception
      Sets the current lens mode.
      Parameters:
      value - The required lens mode.
      Throws:
      IllegalArgumentException - If the lens mode requested is invalid
      Exception - If there is a problem with the EPICS communication
      See Also:
    • getLensMode

      public String getLensMode() throws Exception
      Gets the current lens mode
      Returns:
      The current lens mode
      Throws:
      Exception - If there is a problem with the EPICS communication
    • getPsuMode

      public String getPsuMode() throws Exception
      Gets the current PSU mode.
      Returns:
      The current power supply mode
      Throws:
      Exception - If there is a problem with the EPICS communication
    • setPsuMode

      public void setPsuMode(String value) throws Exception
      Sets the PSU mode. This is to allow different kinetic energy ranges to be reached.
      Parameters:
      value - The required PSU mode
      Throws:
      IllegalArgumentException - If the PSU mode requested is invalid
      Exception - If there is a problem with the EPICS communication
      See Also:
    • setAcquisitionMode

      public void setAcquisitionMode(String value) throws Exception
      Sets the acquisition mode. Acquisition modes provide different ways of operating the detector, which might be better in different count rate regimes.
      Parameters:
      value - The required acquisition mode.
      Throws:
      IllegalArgumentException - If the acquisition mode requested is invalid
      Exception - If there is a problem with the EPICS communication
      See Also:
    • getAcquisitionMode

      public String getAcquisitionMode() throws Exception
      Gets the acquisition mode. Acquisition modes provide different ways of operating the detector, which might be better in different count rate regimes.
      Returns:
      The current acquisition mode
      Throws:
      Exception - If there is a problem with the EPICS communication
    • getAcquisitionModes

      public Set<String> getAcquisitionModes()
      Acquisition modes provide different ways of operating the detector. This returns a read-only copy of the list of available modes.
      Returns:
      Set of the available acquisition modes
    • setPassEnergy

      public void setPassEnergy(double value) throws Exception
      Sets the pass energy to the requested value, in eV.
      Parameters:
      value - The requested pass energy, in eV
      Throws:
      Exception - If there is a problem with the EPICS communication
    • getPassEnergy

      public double getPassEnergy() throws Exception
      Gets the currently set pass energy, in eV.
      Returns:
      The current pass energy, in eV
      Throws:
      Exception - If there is a problem with the EPICS communication
    • setLowEnergy

      public void setLowEnergy(double value) throws Exception
      Sets the low kinetic energy for the scan, in eV.
      Parameters:
      value - The requested start energy, in eV
      Throws:
      IllegalArgumentException - If value is invalid input: '<'= 0
      Exception - If there is a problem with the EPICS communication
    • getLowEnergy

      public double getLowEnergy() throws Exception
      Gets the current low kinetic energy for the scan, in eV.
      Returns:
      The current end energy, in eV
      Throws:
      Exception - If there is a problem with the EPICS communication
    • setHighEnergy

      public void setHighEnergy(double value) throws Exception
      Sets the high kinetic energy for the scan, in eV.
      Parameters:
      value - The requested end energy, in eV
      Throws:
      IllegalArgumentException - If value is invalid input: '<'= 0
      Exception - If there is a problem with the EPICS communication
    • getHighEnergy

      public double getHighEnergy() throws Exception
      Gets the current high kinetic energy for the scan, in eV.
      Returns:
      The current end energy, in eV
      Throws:
      Exception - If there is a problem with the EPICS communication
    • setEnergyStep

      public void setEnergyStep(double value) throws Exception
      Sets the step energy for the scan, in eV. This is only used in "Fixed Transmission" and "Fixed Retarding Ratio" modes.
      Parameters:
      value - The requested energy step, in eV
      Throws:
      IllegalArgumentException - If value is invalid input: '<'= 0
      Exception - If there is a problem with the EPICS communication
    • getEnergyStep

      public double getEnergyStep() throws Exception
      Gets the current step energy for the scan. This is only used in "Fixed Transmission" and "Fixed Retarding Ratio" modes
      Returns:
      The current step energy, in eV
      Throws:
      Exception - If there is a problem with the EPICS communication
    • setCentreEnergy

      public void setCentreEnergy(double value) throws Exception
      Sets the centre energy to be used for "Fixed Energy" scans where the whole detector is integrated, in eV.
      Parameters:
      value - The requested centre energy in eV
      Throws:
      IllegalArgumentException - If value is invalid input: '<'= 0
      Exception - If there is a problem with the EPICS communication
    • getCentreEnergy

      public double getCentreEnergy() throws Exception
      Gets the current centre energy for "Fixed Energy" scans, in eV.
      Returns:
      The current centre energy, in eV
      Throws:
      Exception - If there is a problem with the EPICS communication
    • setRetardingRatio

      public void setRetardingRatio(double value) throws Exception
      Sets the retarding ratio to be used for "Fixed Retarding Ratio" scans. This is then used to vary the pass energy with the kinetic energy according to RR = KE/PE.
      Parameters:
      value - The requested retard ratio
      Throws:
      IllegalArgumentException - If value is invalid input: '<'= 0
      Exception - If there is a problem with the EPICS communication
    • getRetardingRatio

      public double getRetardingRatio() throws Exception
      Gets the retarding ratio to be used for "Fixed Retarding Ratio" scans. This is then used to vary the pass energy with the kinetic energy according to RR = KE/PE.
      Returns:
      The current retarding ratio
      Throws:
      Exception - If there is a problem with the EPICS communication
    • setValues

      public void setValues(int value) throws Exception
      Sets the number of values (also called samples) to be used in "Snapshot" or "Fixed Energy" modes.

      In snapshot mode this defines the number of fixed energy windows that the energy range will be divided into. This allow larger KE ranges to be covered using a smaller pass energy.

      In fixed energy mode this defines the number of repeats that define one iteration.

      Parameters:
      value - The requested number of values for the scan
      Throws:
      IllegalArgumentException - If value is invalid input: '<' 1
      Exception - If there is a problem with the EPICS communication
    • getValues

      public int getValues() throws Exception
      Gets the number of values (also called samples) to be used in "Snapshot" or "Fixed Energy" modes.

      In snapshot mode this defines the number of fixed energy windows that the energy range will be divided into. This allow larger KE ranges to be covered using a smaller pass energy.

      In fixed energy mode this defines the number of repeats that define one iteration.

      Returns:
      The current values
      Throws:
      Exception - If there is a problem with the EPICS communication
    • setSlices

      public void setSlices(int slices) throws Exception
      Sets the number of slices, this is the number of y channels
      Parameters:
      slices - The requested number of slices
      Throws:
      Exception
    • getSlices

      public int getSlices() throws Exception
      Throws:
      Exception
    • getEnergyChannels

      public int getEnergyChannels() throws Exception
      Throws:
      Exception
    • getTotalLeadPoints

      public int getTotalLeadPoints() throws Exception
      Throws:
      Exception
    • getSpectrum

      public double[] getSpectrum() throws Exception
      Throws:
      Exception
    • getImage

      public double[] getImage() throws Exception
      This calls getImage(int) but is more convenient as it handles the size for you. If performance is critical it would be better to reduce the number of requests to EPICS to do this you can call getImage(int) directly if you already know the size required.
      Returns:
      The image data as a 1D array
      Throws:
      Exception - If there is a problem with the EPICS communication
    • getSpectrum

      public double[] getSpectrum(int i) throws Exception
      Throws:
      Exception
    • getImage

      public double[] getImage(int i) throws Exception
      This gets the image as a double. You need to request the correct number of elements, if you don't know call getImage() instead as this will be handled automatically.
      Parameters:
      i - The number of array elements requested. Should be the the image size
      Returns:
      The image data as a 1D array
      Throws:
      Exception - If there is a problem with the EPICS communication
    • getImageAsFloat

      public float[] getImageAsFloat(int i) throws Exception
      This gets the image as a float, this maybe useful as type conversion is performed server side by EPICS so the data transfered is halved this can help improve performance (at the loss of precision). You need to request the correct number of elements.
      Parameters:
      i - The number of array elements requested. Should be the the image size
      Returns:
      The image data as a 1D array
      Throws:
      Exception - If there is a problem with the EPICS communication
    • getLensModes

      public Set<String> getLensModes()
      This returns a read-only copy of the available lens modes.
      Returns:
      Set of the available lens modes
    • getPsuModes

      public Set<String> getPsuModes()
      This returns a read-only copy of the available power supply modes.
      Returns:
      Set of the available power supply modes
    • getExposureTime

      public double getExposureTime() throws Exception
      Gets the currently set exposure time in seconds.
      Returns:
      The exposure time in seconds
      Throws:
      Exception - If there is a problem with the EPICS communication
    • setExposureTime

      public void setExposureTime(double value) throws Exception
      Sets the exposure time.
      Parameters:
      value - The requested exposure time in seconds
      Throws:
      Exception - If there is a problem with the EPICS communication
    • getIterations

      public int getIterations() throws Exception
      Gets the currently set number of iterations.
      Returns:
      The number of iterations
      Throws:
      Exception - If there is a problem with the EPICS communication
    • setIterations

      public void setIterations(int value) throws Exception
      Sets the number of iterations to be performed.
      Parameters:
      value - Number of iterations to run
      Throws:
      Exception - If there is a problem with the EPICS communication
      IllegalArgumentException - If value is invalid input: '<'1
    • isConnected

      public boolean isConnected() throws Exception
      Check if the EPICS IOC is connected to SpecsLab.
      Returns:
      true if the IOC is connected to SpecsLab
      Throws:
      Exception - If there is a problem with the EPICS communication
    • pause

      public void pause() throws Exception
      Pauses the current scan.
      Throws:
      Exception - If there is a problem with the EPICS communication
      See Also:
    • resume

      public void resume() throws Exception
      Resumes the current scan.
      Throws:
      Exception - If there is a problem with the EPICS communication
      See Also:
    • isPaused

      public boolean isPaused() throws Exception
      Check the current paused status of the analyser.
      Returns:
      True if the analyser is paused
      Throws:
      Exception - If there is a problem with the EPICS communication
      See Also:
    • setSafeState

      public void setSafeState(boolean safe) throws Exception
      Sets if the analyser should be placed into a safe state (HV switched off) at the end of a acquire. This can be disabled for performance because ramping the voltages takes significant time. Setting to false does NOT switch on HV it just means they will not be switched off at the end of the next acquire.

      When set to true this will block until the analyser has reached a safe state, with a time out of 30.0 seconds. This is desirable as asking the analyser to measure again during the ramping may fail.

      Parameters:
      safe - True to switch off the high voltage
      Throws:
      Exception - If there is a problem with the EPICS communication
    • isSafeState

      public boolean isSafeState() throws Exception
      Checks if the analyser will be placed in a safe state once an acquire finishes.
      Returns:
      true if analyser will be placed in a safe state once an acquire finishes
      Throws:
      Exception - If there is a problem with the EPICS communication
    • getStartY

      public double getStartY() throws Exception
      Gets the current start (or low) Y scale, in eV.
      Returns:
      The current start Y
      Throws:
      Exception - If there is a problem with the EPICS communication
    • getEndY

      public double getEndY() throws Exception
      Gets the current end (or high) Y scale, in eV.
      Returns:
      The current start Y
      Throws:
      Exception - If there is a problem with the EPICS communication
    • getYUnits

      public String getYUnits() throws Exception
      Gets the Y scale units
      Returns:
      The current start Y
      Throws:
      Exception - If there is a problem with the EPICS communication
    • setImageMode

      public void setImageMode(ImageMode imagemode) throws Exception
      Throws:
      Exception
    • startAcquiring

      public void startAcquiring() throws Exception
      Throws:
      Exception
    • stopAcquiring

      public void stopAcquiring() throws Exception
      Throws:
      Exception
    • getDetectorStatus

      public SpecsPhoibosStatus getDetectorStatus() throws Exception
      Throws:
      Exception
    • getStatusMessage

      public String getStatusMessage() throws Exception
      Throws:
      Exception
    • waitWhileStatusBusy

      public void waitWhileStatusBusy() throws InterruptedException
      Throws:
      InterruptedException
    • addIObserver

      public void addIObserver(gda.observable.IObserver anIObserver)
      Specified by:
      addIObserver in interface gda.observable.IObservable
    • deleteIObserver

      public void deleteIObserver(gda.observable.IObserver anIObserver)
      Specified by:
      deleteIObserver in interface gda.observable.IObservable
    • deleteIObservers

      public void deleteIObservers()
      Specified by:
      deleteIObservers in interface gda.observable.IObservable
    • getTotalPoints

      public int getTotalPoints() throws Exception
      Throws:
      Exception
    • getCurrentPoint

      public int getCurrentPoint() throws Exception
      Throws:
      Exception
    • getPointInIteration

      public int getPointInIteration() throws Exception
      Throws:
      Exception
    • validateScanConfiguration

      public void validateScanConfiguration() throws Exception
      Throws:
      Exception
    • getScanValidityStatus

      public String getScanValidityStatus() throws Exception
      Throws:
      Exception
    • getDetectorEnergyWidth

      public double getDetectorEnergyWidth() throws Exception
      Throws:
      Exception
    • getDetectorVoltage

      public double getDetectorVoltage() throws Exception
      Throws:
      Exception