Class NIRSpectrumReader

  • All Implemented Interfaces:
    adams.core.AdditionalInformationHandler, adams.core.CleanUpHandler, adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.io.FileFormatHandler, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.ShallowCopySupporter<adams.data.io.input.AbstractDataContainerReader>, adams.core.SizeOfHandler, adams.core.Stoppable, Serializable, Comparable

    public class NIRSpectrumReader
    extends CALSpectrumReader
    Reads spectra in FOSS NIR format.

    Valid options are:

    -D <int> (property: debugLevel)
        The greater the number the more additional info the scheme may output to
        the console (0 = off).
        default: 0
        minimum: 0
     
    -input <adams.core.io.PlaceholderFile> (property: input)
        The file to read and turn into a container.
        default: .
     
    -create-dummy-report (property: createDummyReport)
        If true, then a dummy report is created if none present.
     
    -instrument <java.lang.String> (property: instrument)
        The name of the instrument that generated the spectra (if not already present
        in data).
        default: unknown
     
    -format <java.lang.String> (property: format)
        The data format string.
        default: NIR
     
    -typefield <java.lang.String> (property: typefield)
        Code|Field1|Field2|Field3|ID|[sample_type]
        default: Code
     
    -idfield <java.lang.String> (property: idfield)
        ID|Field1|Field2|Field3|[prefix]
        default: ID
     
    -start <int> (property: start)
        Spectrum number to start loading from.
        default: 1
     
    -max <int> (property: max)
        Maximum spectra to load.
        default: -1
     
    Author:
    dale (dale at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Constructor Detail

      • NIRSpectrumReader

        public NIRSpectrumReader()
    • Method Detail

      • globalInfo

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

        public String getFormatDescription()
        Returns a string describing the format (used in the file chooser).
        Specified by:
        getFormatDescription in interface adams.core.io.FileFormatHandler
        Overrides:
        getFormatDescription in class CALSpectrumReader
        Returns:
        a description suitable for displaying in the file chooser
      • getFormatExtensions

        public String[] getFormatExtensions()
        Returns the extension(s) of the format.
        Specified by:
        getFormatExtensions in interface adams.core.io.FileFormatHandler
        Overrides:
        getFormatExtensions in class CALSpectrumReader
        Returns:
        the extension(s) (without the dot!)
      • main

        public static void main​(String[] args)
        Runs the reader from the command-line. If the option AbstractSpectrumReader.OPTION_OUTPUTDIR is specified then the read spectra get output as .spec files in that directory.
        Parameters:
        args - the command-line options to use