Class SpreadSheetToSpectrum

  • All Implemented Interfaces:
    adams.core.AdditionalInformationHandler, adams.core.CleanUpHandler, adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.QuickInfoSupporter, adams.core.ShallowCopySupporter<adams.data.conversion.AbstractConversion>, adams.core.SizeOfHandler, adams.core.Stoppable, adams.data.conversion.Conversion, Serializable

    public class SpreadSheetToSpectrum
    extends adams.data.conversion.AbstractConversion
    Turns a spreadsheet into a spectrum. The columns that act as wavenumber and amplitude must be specified.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -col-wave-number <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: columnWaveNumber)
        The column in the spreadsheet that contains the wavenumber information.
        default: 1
        example: An index is a number starting with 1; apart from column names (case-sensitive), the following placeholders can be used as well: first, second, third, last_2, last_1, last
     
    -col-amplitude <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: columnAmplitude)
        The column in the spreadsheet that contains the amplitude information.
        default: 2
        example: An index is a number starting with 1; apart from column names (case-sensitive), the following placeholders can be used as well: first, second, third, last_2, last_1, last
     
    -id <java.lang.String> (property: ID)
        The ID for the spectrum.
        default: 
     
    -format <java.lang.String> (property: format)
        The format for the spectrum.
        default: NIR
     
    -instrument <java.lang.String> (property: instrument)
        The instrument for the spectrum.
        default: unknown
     
    Version:
    $Revision: 2242 $
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected adams.data.spreadsheet.SpreadSheetColumnIndex m_ColumnAmplitude
      the amplitude column.
      protected adams.data.spreadsheet.SpreadSheetColumnIndex m_ColumnWaveNumber
      the wavenumber column.
      protected String m_Format
      the format to use for the spectrum.
      protected String m_ID
      the ID to use for the spectrum.
      protected String m_Instrument
      the instrument to use for the spectrum.
      • Fields inherited from class adams.data.conversion.AbstractConversion

        m_Input, m_Output, m_Owner, m_Stopped
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Class accepts()
      Returns the class that is accepted as input.
      String columnAmplitudeTipText()
      Returns the tip text for this property.
      String columnWaveNumberTipText()
      Returns the tip text for this property.
      void defineOptions()
      Adds options to the internal list of options.
      protected Object doConvert()
      Performs the actual conversion.
      String formatTipText()
      Returns the tip text for this property.
      Class generates()
      Returns the class that is generated as output.
      adams.data.spreadsheet.SpreadSheetColumnIndex getColumnAmplitude()
      Returns the column with the amplitude information.
      adams.data.spreadsheet.SpreadSheetColumnIndex getColumnWaveNumber()
      Returns the column with the wavenumber information.
      String getFormat()
      Returns the format to use for the spectrum.
      String getID()
      Returns the ID to use for the spectrum.
      String getInstrument()
      Returns the instrument to use for the spectrum.
      String globalInfo()
      Returns a string describing the object.
      String IDTipText()
      Returns the tip text for this property.
      String instrumentTipText()
      Returns the tip text for this property.
      void setColumnAmplitude​(adams.data.spreadsheet.SpreadSheetColumnIndex value)
      Sets the column with the amplitude information.
      void setColumnWaveNumber​(adams.data.spreadsheet.SpreadSheetColumnIndex value)
      Sets the column with the wavenumber information.
      void setFormat​(String value)
      Sets the format to use for the spectrum.
      void setID​(String value)
      Sets the ID to use for the spectrum.
      void setInstrument​(String value)
      Sets the instrument to use for the spectrum.
      • Methods inherited from class adams.data.conversion.AbstractConversion

        checkData, cleanUp, convert, getAdditionalInformation, getInput, getInput, getOutput, getOutput, getOwner, getQuickInfo, reset, setInput, setOwner, shallowCopy, shallowCopy, stopExecution
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Field Detail

      • m_ColumnWaveNumber

        protected adams.data.spreadsheet.SpreadSheetColumnIndex m_ColumnWaveNumber
        the wavenumber column.
      • m_ColumnAmplitude

        protected adams.data.spreadsheet.SpreadSheetColumnIndex m_ColumnAmplitude
        the amplitude column.
      • m_ID

        protected String m_ID
        the ID to use for the spectrum.
      • m_Format

        protected String m_Format
        the format to use for the spectrum.
      • m_Instrument

        protected String m_Instrument
        the instrument to use for the spectrum.
    • Constructor Detail

      • SpreadSheetToSpectrum

        public SpreadSheetToSpectrum()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • setColumnWaveNumber

        public void setColumnWaveNumber​(adams.data.spreadsheet.SpreadSheetColumnIndex value)
        Sets the column with the wavenumber information.
        Parameters:
        value - the column
      • getColumnWaveNumber

        public adams.data.spreadsheet.SpreadSheetColumnIndex getColumnWaveNumber()
        Returns the column with the wavenumber information.
        Returns:
        the column
      • columnWaveNumberTipText

        public String columnWaveNumberTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setColumnAmplitude

        public void setColumnAmplitude​(adams.data.spreadsheet.SpreadSheetColumnIndex value)
        Sets the column with the amplitude information.
        Parameters:
        value - the column
      • getColumnAmplitude

        public adams.data.spreadsheet.SpreadSheetColumnIndex getColumnAmplitude()
        Returns the column with the amplitude information.
        Returns:
        the column
      • columnAmplitudeTipText

        public String columnAmplitudeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setID

        public void setID​(String value)
        Sets the ID to use for the spectrum.
        Parameters:
        value - the ID
      • getID

        public String getID()
        Returns the ID to use for the spectrum.
        Returns:
        the ID
      • IDTipText

        public String IDTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setFormat

        public void setFormat​(String value)
        Sets the format to use for the spectrum.
        Parameters:
        value - the format
      • getFormat

        public String getFormat()
        Returns the format to use for the spectrum.
        Returns:
        the format
      • formatTipText

        public String formatTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setInstrument

        public void setInstrument​(String value)
        Sets the instrument to use for the spectrum.
        Parameters:
        value - the instrument
      • getInstrument

        public String getInstrument()
        Returns the instrument to use for the spectrum.
        Returns:
        the instrument
      • instrumentTipText

        public String instrumentTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • accepts

        public Class accepts()
        Returns the class that is accepted as input.
        Specified by:
        accepts in interface adams.data.conversion.Conversion
        Specified by:
        accepts in class adams.data.conversion.AbstractConversion
        Returns:
        the class
      • generates

        public Class generates()
        Returns the class that is generated as output.
        Specified by:
        generates in interface adams.data.conversion.Conversion
        Specified by:
        generates in class adams.data.conversion.AbstractConversion
        Returns:
        the class
      • doConvert

        protected Object doConvert()
                            throws Exception
        Performs the actual conversion.
        Specified by:
        doConvert in class adams.data.conversion.AbstractConversion
        Returns:
        the converted data
        Throws:
        Exception - if something goes wrong with the conversion