Package gda.hrpd.data
Class EpicsCVscanDataWriter
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.hrpd.data.EpicsCVscanDataWriter
- All Implemented Interfaces:
DataWriter,Configurable,Findable
This class writes files of tabulated data from Multiple Analyser Crystal Detectors, along with a header and footer if
needed, in ASCII format. The files created use names which are an increment from the last name.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringthe full file name of the current data fileprotected Stringfile extension to useprotected Stringfile prefix to use (if any)protected Stringfile suffix to use (if any)protected intthe current file number being written to, which is managed by the NumTracker Class -
Constructor Summary
ConstructorsConstructorDescriptionConstructor which determines the name of the next file and creates it. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddData(IScanDataPoint dataPoint) for incremental addition of datavoidaddDataWriterExtender(IDataWriterExtender dataWriterExtender) Adds an additional IDataWriterExtender to handle DataWriter eventsaddRawData(File file, int rows, ArrayList<Scannable> parentScannables, String motorName, ArrayList<Detector> allDetectors, double[] path1, int[][] data, double scantime, double monitorValue) MAC specific data writeraddRebinnedData(File file, int rows, ArrayList<Scannable> parentScannables, double[] tth, double[] count, double[] counterror, double scantime, double monitorValue) voidWrites any file footers and closes file.voidDefault 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.voidconfigureScanNumber(int scanNumber) method used to allow filewriter to configure the scanNumber based on the supplied value or internally if null It is called by the ScanBase.prepareScanForCollectionreturn the scan file name with prefix and/or suffix if specified, without extension specifier.intGet the current scan identifier (ie scan number)Returns the full path of the folder which data files are written to.Get the delimiter used between columnsintReturns the number of the last file written to.header is a publicly accessible string which will be written to the file (or saved to a database) during the prepareForCollection method.gda.hrpd.SampleInfointvoidremoveDataWriterExtender(IDataWriterExtender dataWriterExtender) Remove a IDataWriterExtender to handle DataWriter events.voidsetBeamInfo(Beam beam) voidvoidsetComment(String comment) voidsetDelimiter(String delimiter) Set the delimiter used between columns (default is a tab '\t')voidSets the header of the datahandlervoidSets the header of the datahandlervoidsetMetadata(Metadata metadata) voidsetSampleInfo(gda.hrpd.SampleInfo saminfo) voidwriteColumnHeadings(FileWriter filewriter) This should be extended by inheriting classes.voidThis should be extended by inheriting classes.voidwriteHeader(FileWriter filewriter) Standard header for synchrotron experiments at beamline I11 at DLS written in the format of name/key-value pair, placed in between the markers of invalid input: '&DLS' and invalid input: '&END'Methods inherited from class gda.factory.FindableConfigurableBase
getName, setNameMethods inherited from class gda.factory.ConfigurableBase
isConfigureAtStartup, isConfigured, reconfigure, setConfiguredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface gda.data.scan.datawriter.DataWriter
scanStart
-
Field Details
-
thisFileNumber
protected int thisFileNumberthe current file number being written to, which is managed by the NumTracker Class -
fileExtension
file extension to use -
filePrefix
file prefix to use (if any) -
fileSuffix
file suffix to use (if any) -
currentFileName
the full file name of the current data file
-
-
Constructor Details
-
EpicsCVscanDataWriter
public EpicsCVscanDataWriter()Constructor which determines the name of the next file and creates it.
-
-
Method Details
-
getSampleInfo
public gda.hrpd.SampleInfo getSampleInfo() -
setSampleInfo
public void setSampleInfo(gda.hrpd.SampleInfo saminfo) -
getBeamInfo
-
setBeamInfo
-
getBeamlineInfo
-
setBeamlineInfo
-
getMetadata
-
setMetadata
-
configure
public void configure()Description copied from class:ConfigurableBaseDefault 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:
configurein interfaceConfigurable- Overrides:
configurein classConfigurableBase
-
addData
Description copied from interface:DataWriterfor incremental addition of data- Specified by:
addDatain interfaceDataWriter- Parameters:
dataPoint- Object
-
addRawData
public String addRawData(File file, int rows, ArrayList<Scannable> parentScannables, String motorName, ArrayList<Detector> allDetectors, double[] path1, int[][] data, double scantime, double monitorValue) MAC specific data writer- Parameters:
rows-parentScannables-motorName-allDetectors-path1-data-scantime-- Returns:
- filename
-
addRebinnedData
-
completeCollection
public void completeCollection()Writes any file footers and closes file.- Specified by:
completeCollectionin interfaceDataWriter
-
writeHeader
Standard header for synchrotron experiments at beamline I11 at DLS written in the format of name/key-value pair, placed in between the markers of invalid input: '&DLS' and invalid input: '&END'&DLS <dt> CarouselNo=1 SampleID=S537 SampleName=Silicon Description='Silicon Standard' Title='Calibration SampleInfo Scan' Comment='any comments added by the users' RunNumber=245 Date=dd-mmm-yy Time=hr:min:sec BeamlineInfo=I11 Project=HRPD Experiment=MAC Wavelength=1.2 Temperature=295 SamplePosition=20.0 </dt> &END
-
writeColumnHeadings
This should be extended by inheriting classes. -
getDataDir
Returns the full path of the folder which data files are written to.- Returns:
- the full path of the folder which data files are written
-
getDelimiter
Get the delimiter used between columns- Returns:
- the delimiter used between columns
-
setDelimiter
Set the delimiter used between columns (default is a tab '\t')- Parameters:
delimiter- String
-
getFileNumber
public int getFileNumber()Returns the number of the last file written to.- Returns:
- long
-
incrementFileNumber
public int incrementFileNumber() -
getCurrentFileName
return the scan file name with prefix and/or suffix if specified, without extension specifier.- Specified by:
getCurrentFileNamein interfaceDataWriter- Returns:
- root part of the MAC file name.
-
setHeader
Description copied from interface:DataWriterSets the header of the datahandler- Specified by:
setHeaderin interfaceDataWriter- Parameters:
header- String
-
setComment
-
getCurrentScanIdentifier
public int getCurrentScanIdentifier()Description copied from interface:DataWriterGet the current scan identifier (ie scan number)- Specified by:
getCurrentScanIdentifierin interfaceDataWriter- Returns:
- String
-
addDataWriterExtender
Description copied from interface:DataWriterAdds an additional IDataWriterExtender to handle DataWriter events- Specified by:
addDataWriterExtenderin interfaceDataWriter- Parameters:
dataWriterExtender-
-
getHeader
Description copied from interface:DataWriterheader is a publicly accessible string which will be written to the file (or saved to a database) during the prepareForCollection method. Before this method is called, the header object may be added to using these accessor methods.- Specified by:
getHeaderin interfaceDataWriter- Returns:
- an ArrayList containing header information
-
removeDataWriterExtender
Description copied from interface:DataWriterRemove a IDataWriterExtender to handle DataWriter events.- Specified by:
removeDataWriterExtenderin interfaceDataWriter- Parameters:
dataWriterExtender-
-
setHeader
Description copied from interface:DataWriterSets the header of the datahandler- Specified by:
setHeaderin interfaceDataWriter- Parameters:
header- ArrayList
-
configureScanNumber
Description copied from interface:DataWritermethod used to allow filewriter to configure the scanNumber based on the supplied value or internally if null It is called by the ScanBase.prepareScanForCollection- Specified by:
configureScanNumberin interfaceDataWriter- Parameters:
scanNumber-- Throws:
Exception
-