Class InterPercentileRangeCleaner

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SerializableObject, adams.core.ShallowCopySupporter<AbstractCleaner>, adams.core.SizeOfHandler, adams.db.DatabaseConnectionHandler, adams.db.DatabaseConnectionProvider, adams.db.DatabaseConnectionUser, Serializable, Comparable

    public class InterPercentileRangeCleaner
    extends AbstractSerializableCleaner
    implements adams.db.DatabaseConnectionHandler
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_ChunkSize

        protected int m_ChunkSize
        the chunk size when retrieving spectra from the database.
      • m_Factor

        protected double m_Factor
        the maximum factor a value can be above the upper percentile or below the lower percentile before considered "un-clean".
      • m_LowerPercentile

        protected double m_LowerPercentile
        the lower percentile.
      • m_UpperPercentile

        protected double m_UpperPercentile
        the upper percentile.
      • m_SampleType

        protected String m_SampleType
        the sample type regular expression.
      • m_DatabaseConnection

        protected adams.db.AbstractDatabaseConnection m_DatabaseConnection
        the database connection.
    • Constructor Detail

      • InterPercentileRangeCleaner

        public InterPercentileRangeCleaner()
    • 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 AbstractSerializableCleaner
      • initSerializationSetup

        public void initSerializationSetup()
        Regenerates all the objects that are necessary for serialization.
        Specified by:
        initSerializationSetup in interface adams.core.SerializableObject
      • retrieveSerializationSetup

        public Object[] retrieveSerializationSetup()
        Returns the member variables to serialize to a file.
        Specified by:
        retrieveSerializationSetup in interface adams.core.SerializableObject
        Returns:
        the objects to serialize
      • setSerializationSetup

        public void setSerializationSetup​(Object[] value)
        Updates the member variables with the provided objects obtained from deserialization.
        Specified by:
        setSerializationSetup in interface adams.core.SerializableObject
        Parameters:
        value - the deserialized objects
      • setChunkSize

        public void setChunkSize​(int value)
        Sets the chunk size to use for loading data from the database.
        Parameters:
        value - the chunk size
      • getChunkSize

        public int getChunkSize()
        Returns the chunk size to use for loading data from the database.
        Returns:
        the chunk size
      • chunkSizeTipText

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

        public void setConditions​(adams.db.AbstractConditions value)
        Sets the conditions container to use for retrieving the spectra.
        Parameters:
        value - the conditions
      • getConditions

        public adams.db.AbstractConditions getConditions()
        Returns the conditions container to use for retrieving the spectra.
        Returns:
        the conditions
      • conditionsTipText

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

        public void setFactor​(double value)
        Sets the factor to multiply the inter-percentile range with.
        Parameters:
        value - the factor
      • getFactor

        public double getFactor()
        Returns the factor to multiply the inter-percentile range with.
        Returns:
        the factor
      • factorTipText

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

        public void setLowerPercentile​(double value)
        Sets the lower percentile.
        Parameters:
        value - the percentile
      • getLowerPercentile

        public double getLowerPercentile()
        Returns the lower percentile.
        Returns:
        the percentile
      • lowerPercentileTipText

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

        public void setUpperPercentile​(double value)
        Sets the upper percentile.
        Parameters:
        value - the percentile
      • getUpperPercentile

        public double getUpperPercentile()
        Returns the upper percentile.
        Returns:
        the percentile
      • upperPercentileTipText

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

        public adams.db.AbstractDatabaseConnection getDatabaseConnection()
        Returns the currently used database connection object, can be null.
        Specified by:
        getDatabaseConnection in interface adams.db.DatabaseConnectionProvider
        Returns:
        the current object
      • setDatabaseConnection

        public void setDatabaseConnection​(adams.db.AbstractDatabaseConnection value)
        Sets the database connection object to use.
        Specified by:
        setDatabaseConnection in interface adams.db.DatabaseConnectionHandler
        Parameters:
        value - the object to use
      • getSampleDataF

        protected SampleDataF getSampleDataF()
        Returns the SampleDataT singleton to use.
        Returns:
        the table singleton to use
      • getSpectrumF

        protected SpectrumF getSpectrumF()
        Returns the SpectrumT singleton to use.
        Returns:
        the table singleton to use
      • checkValue

        protected String checkValue​(InterPercentileRangeCleaner.InterPercentileRange ipr,
                                    double value)
        Checks the specified value against the inter-percentile setup whether it is valid or not.
        Parameters:
        ipr - the inter-percentile range setup for the value
        value - the value to check
        Returns:
        null if OK, otherwise error message
      • checkSpectrum

        protected String checkSpectrum​(Spectrum data)
        Checks the spectrum, whether all of its values (amplitudes + fields) are within the boundaries.
        Parameters:
        data - the spectrum to check
        Returns:
        null if OK, otherwise the error message
      • performCheck

        protected String performCheck​(Spectrum data)
        Performs the check.
        Specified by:
        performCheck in class AbstractCleaner
        Parameters:
        data - the spectrum to check
        Returns:
        null if ok, otherwise error message