Class SrsDataFile

All Implemented Interfaces:
DataWriter, IDataWriterExtender

public class SrsDataFile extends IncrementalFile
An extension of IncrementalFile class which produces files in the SRS ascii format. It uses the reference of the scan which created this datahandler to determine which columns to have in the output. The header information is passed as an ArrayList with:
  • element 0 is title element 1 is condition1 element 2 is condition2 element 3 is condition3 element 4 - n are comments
  • 
     &SRS SRSRUN=129283,SRSDAT=040910,SRSTIM=181147,
     SRSSTN='W164',SRSPRJ='POWDERDF',SRSEXP='12345432', SRSTLE='k733a ',
     SRSCN1='k733 aft',SRSCN2='room tem',SRSCN3='drot 3 s', &END Calib A with
     error 0.0000 0.0000 Detector 2 Angle 0 Calib B with error 1.000000 0.000000
     SPECTRUM 1 Accumulation Time for Data = 120.000 Seconds Current Temp 0.0000
     Set Point 0.0000 Active segment 0.0000 Active program 0.0000 Program Elapsed
     time 0.0000 Time parameters read TEMP/TIME DISABLED DEDS time stamp Fri Sep
     10 18:13:49 2004 119. 70. 51. 49. 42. 29. 47. 45. etc...
    
     

    The columns may be automatically aligned to the headers by setting the java property gda.data.scan.datawriter.dataFormat.SrsDataFile.aligncolumns to true

    • Constructor Details

      • SrsDataFile

        public SrsDataFile()
        Constructor
    • Method Details

      • addData

        public void addData(IScanDataPoint dataPoint) throws Exception
        for incremental addition of data.

        data should be in the form of a double array. This data will be tab separated, terminated with an "\n", and appended to the open file.

        Specified by:
        addData in interface DataWriter
        Overrides:
        addData in class DataWriterBase
        Parameters:
        dataPoint - Object
        Throws:
        Exception
      • setHeader

        public void setHeader(String header)
        Description copied from interface: DataWriter
        Sets the header of the datahandler
        Parameters:
        header - String
      • writeHeader

        public void writeHeader()
        Description copied from class: IncrementalFile
        This should be extended by inheriting classes.
        Specified by:
        writeHeader in class IncrementalFile
      • writeFooter

        public void writeFooter()
        Description copied from class: IncrementalFile
        This should be extended by inheriting classes.
        Specified by:
        writeFooter in class IncrementalFile
      • writeColumnHeadings

        public void writeColumnHeadings()
        Description copied from class: IncrementalFile
        This should be extended by inheriting classes.
        Specified by:
        writeColumnHeadings in class IncrementalFile