Package uk.ac.gda.beamline.i20.scannable
Class MonoOptimisation
java.lang.Object
gda.factory.FindableBase
uk.ac.gda.beamline.i20.scannable.MonoOptimisation
- All Implemented Interfaces:
Findable
Functions to perform optimisation of monochromator, i.e. adjust bragg offset to maximise throughput
- Since:
- 26/8/2016
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureOffsetParameters(MonoMoveWithOffsetScannable braggWithOffset) Setup the offset parameters in aMonoMoveWithOffsetScannableobject from the Gaussians fitted duringoptimise(double, double).org.eclipse.january.dataset.DatasetScan bragg offset without using normal scanning mechanism (so it can be run in the middle of a scan)booleandoublebooleandoubleintdoubleintbooleanstatic doublegoldenSectionSearch(Scannable scannableToMove, Scannable scannableToMonitor, double minPos, double maxPos, double tolerance) Peak finding algorithm based on golden section search method.booleanorg.eclipse.january.dataset.DatasetloadDataFromNexusFile(String filename) Load optimisation scan data from nexus file.voidoptimise(double lowEnergy, double highEnergy) voidoptimiseManual(Scannable bragg, double braggEnergy) voidsetAllowOptimisation(boolean allowOptimisation) voidsetBraggScannable(Scannable braggScannable) voidsetCollectionTime(double collectionTime) voidsetDaServer(DAServer daServerForTfg) voidsetDiagnosticPositioner(EnumPositioner diagnosticPositioner) voidsetFitToPeakPointsOnly(boolean b) voidsetOffsetEnd(double offsetEnd) voidsetOffsetNumPoints(int offsetNumPoints) voidsetOffsetStart(double offsetStart) voidsetPeakPointRange(int peakPointRange) voidsetPhotonShutter(EnumPositioner photonShutter) voidsetProduceVetoOutput(boolean vetoOn) Send DAServer commands to switch between normal and no veto output (Veto output is used for for triggering detectors such as Xspress2, XMap, Medipix)NORMAL_VETO_OUTPUT_COMMAND,NO_VETO_OUTPUT_COMMANDare the commands sent to DAServer to switch Veto output on and off.voidsetScannableToMonitor(Scannable scannableToMonitor) voidsetScannableToMove(Scannable scannableToMove) voidsetSelectNewScansInPlotView(boolean selectNewScansInPlotView) voidsetUseDiagnosticDetector(boolean useDiagnosticDetector) voidsetZeroBraggOffsetAfterFailure(boolean restore) Set to true to set Bragg offset to zero after a failed/aborted scanMethods inherited from class gda.factory.FindableBase
equals, getName, hashCode, setName
-
Constructor Details
-
MonoOptimisation
-
-
Method Details
-
optimise
- Throws:
Exception
-
setDaServer
-
getDaServer
-
setProduceVetoOutput
public void setProduceVetoOutput(boolean vetoOn) Send DAServer commands to switch between normal and no veto output (Veto output is used for for triggering detectors such as Xspress2, XMap, Medipix)NORMAL_VETO_OUTPUT_COMMAND,NO_VETO_OUTPUT_COMMANDare the commands sent to DAServer to switch Veto output on and off.- Parameters:
vetoOn- true = veto output, false no veto output
-
optimiseManual
- Throws:
DeviceException
-
loadDataFromNexusFile
public org.eclipse.january.dataset.Dataset loadDataFromNexusFile(String filename) throws NexusException, org.eclipse.january.DatasetException Load optimisation scan data from nexus file. Combine position and detector values into a single Dataset..- Parameters:
filename-- Returns:
- Dataset with position data in 1st column, detector data in 2nd.
- Throws:
NexusExceptionorg.eclipse.january.DatasetException
-
doManualScan
Scan bragg offset without using normal scanning mechanism (so it can be run in the middle of a scan)- Returns:
- Dataset of position and detector values.
- Throws:
DeviceExceptionInterruptedException
-
configureOffsetParameters
Setup the offset parameters in aMonoMoveWithOffsetScannableobject from the Gaussians fitted duringoptimise(double, double).- Parameters:
braggWithOffset-
-
setSelectNewScansInPlotView
public void setSelectNewScansInPlotView(boolean selectNewScansInPlotView) -
getSelectNewScansInPlotView
public boolean getSelectNewScansInPlotView() -
getFittedGaussianLowEnergy
-
getFittedGaussianHighEnergy
-
getScannableToMonitor
-
setScannableToMonitor
-
getScannableToMove
-
setScannableToMove
-
getOffsetStart
public double getOffsetStart() -
setOffsetStart
public void setOffsetStart(double offsetStart) -
getOffsetEnd
public double getOffsetEnd() -
setOffsetEnd
public void setOffsetEnd(double offsetEnd) -
getOffsetNumPoints
public int getOffsetNumPoints() -
setOffsetNumPoints
public void setOffsetNumPoints(int offsetNumPoints) -
getCollectionTime
public double getCollectionTime() -
setCollectionTime
public void setCollectionTime(double collectionTime) -
setFitToPeakPointsOnly
public void setFitToPeakPointsOnly(boolean b) -
getFitToPeakPointsOnly
public boolean getFitToPeakPointsOnly() -
getPeakPointRange
public int getPeakPointRange() -
setPeakPointRange
public void setPeakPointRange(int peakPointRange) -
goldenSectionSearch
public static double goldenSectionSearch(Scannable scannableToMove, Scannable scannableToMonitor, double minPos, double maxPos, double tolerance) throws DeviceException, InterruptedException Peak finding algorithm based on golden section search method.- Parameters:
scannableToMove-scannableToMonitor-minPos-maxPos-tolerance-- Returns:
- position of scannableToMove that gives peak value of scannableToMonitor
- Throws:
DeviceExceptionInterruptedException- Since:
- 31/8/2016
-
getBraggScannable
-
setBraggScannable
-
getAllowOptimisation
public boolean getAllowOptimisation() -
setAllowOptimisation
public void setAllowOptimisation(boolean allowOptimisation) -
getPhotonShutter
-
setPhotonShutter
-
getDiagnosticPositioner
-
setDiagnosticPositioner
-
isUseDiagnosticDetector
public boolean isUseDiagnosticDetector() -
setUseDiagnosticDetector
public void setUseDiagnosticDetector(boolean useDiagnosticDetector) -
setZeroBraggOffsetAfterFailure
public void setZeroBraggOffsetAfterFailure(boolean restore) Set to true to set Bragg offset to zero after a failed/aborted scan- Parameters:
restore-
-