Package adams.data.cleaner.spectrum
Class InterPercentileRangeCleaner
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.cleaner.spectrum.AbstractCleaner
-
- adams.data.cleaner.spectrum.AbstractSerializableCleaner
-
- adams.data.cleaner.spectrum.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInterPercentileRangeCleaner.DataCollectorA helper class for collecting the data from the database and computing the inter-percentile ranges (IPRs).static classInterPercentileRangeCleaner.InterPercentileRangeContainer class for storing the lower and upper percentile, as well as the wave number.
-
Field Summary
Fields Modifier and Type Field Description protected Hashtable<Float,InterPercentileRangeCleaner.InterPercentileRange>m_AmplitudeIPRsthe interpercentiles to use for the amplitudes.protected intm_ChunkSizethe chunk size when retrieving spectra from the database.protected AbstractSpectrumConditionsm_Conditionsthe spectrum retrieval conditions.protected adams.db.AbstractDatabaseConnectionm_DatabaseConnectionthe database connection.protected doublem_Factorthe maximum factor a value can be above the upper percentile or below the lower percentile before considered "un-clean".protected Hashtable<adams.data.report.Field,InterPercentileRangeCleaner.InterPercentileRange>m_FieldIPRsthe interpercentiles to use for the fields.protected doublem_LowerPercentilethe lower percentile.protected Stringm_SampleTypethe sample type regular expression.protected doublem_UpperPercentilethe upper percentile.-
Fields inherited from class adams.data.cleaner.spectrum.AbstractSerializableCleaner
m_OverrideSerializationFile, m_SerializableObjectHelper, m_SerializationFile
-
Fields inherited from class adams.data.cleaner.spectrum.AbstractCleaner
m_ActualPreFilter, m_FlowContext, m_PreFilter
-
-
Constructor Summary
Constructors Constructor Description InterPercentileRangeCleaner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcheckSpectrum(Spectrum data)Checks the spectrum, whether all of its values (amplitudes + fields) are within the boundaries.protected StringcheckValue(InterPercentileRangeCleaner.InterPercentileRange ipr, double value)Checks the specified value against the inter-percentile setup whether it is valid or not.StringchunkSizeTipText()Returns the tip text for this property.StringconditionsTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.StringfactorTipText()Returns the tip text for this property.intgetChunkSize()Returns the chunk size to use for loading data from the database.adams.db.AbstractConditionsgetConditions()Returns the conditions container to use for retrieving the spectra.adams.db.AbstractDatabaseConnectiongetDatabaseConnection()Returns the currently used database connection object, can be null.doublegetFactor()Returns the factor to multiply the inter-percentile range with.doublegetLowerPercentile()Returns the lower percentile.protected SampleDataFgetSampleDataF()Returns the SampleDataT singleton to use.protected SpectrumFgetSpectrumF()Returns the SpectrumT singleton to use.doublegetUpperPercentile()Returns the upper percentile.StringglobalInfo()Returns a string describing the object.protected voidinitialize()Initializes the members.voidinitSerializationSetup()Regenerates all the objects that are necessary for serialization.StringlowerPercentileTipText()Returns the tip text for this property.protected StringperformCheck(Spectrum data)Performs the check.Object[]retrieveSerializationSetup()Returns the member variables to serialize to a file.voidsetChunkSize(int value)Sets the chunk size to use for loading data from the database.voidsetConditions(adams.db.AbstractConditions value)Sets the conditions container to use for retrieving the spectra.voidsetDatabaseConnection(adams.db.AbstractDatabaseConnection value)Sets the database connection object to use.voidsetFactor(double value)Sets the factor to multiply the inter-percentile range with.voidsetLowerPercentile(double value)Sets the lower percentile.voidsetSerializationSetup(Object[] value)Updates the member variables with the provided objects obtained from deserialization.voidsetUpperPercentile(double value)Sets the upper percentile.StringupperPercentileTipText()Returns the tip text for this property.-
Methods inherited from class adams.data.cleaner.spectrum.AbstractSerializableCleaner
destroy, getOverrideSerializedFile, getSerializationFile, isSetupLoadedOrGenerated, overrideSerializedFileTipText, preCheck, reset, serializationFileTipText, setOverrideSerializedFile, setSerializationFile, setSetupLoadedOrGenerated
-
Methods inherited from class adams.data.cleaner.spectrum.AbstractCleaner
check, compareTo, equals, forCommandLine, forName, getCleaners, getFlowContext, getPreFilter, preFilter, preFilterTipText, setFlowContent, setPreFilter, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_ChunkSize
protected int m_ChunkSize
the chunk size when retrieving spectra from the database.
-
m_Conditions
protected AbstractSpectrumConditions m_Conditions
the spectrum retrieval conditions.
-
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_AmplitudeIPRs
protected Hashtable<Float,InterPercentileRangeCleaner.InterPercentileRange> m_AmplitudeIPRs
the interpercentiles to use for the amplitudes.
-
m_FieldIPRs
protected Hashtable<adams.data.report.Field,InterPercentileRangeCleaner.InterPercentileRange> m_FieldIPRs
the interpercentiles to use for the fields.
-
m_SampleType
protected String m_SampleType
the sample type regular expression.
-
m_DatabaseConnection
protected adams.db.AbstractDatabaseConnection m_DatabaseConnection
the database connection.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin classadams.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:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classAbstractSerializableCleaner
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classAbstractSerializableCleaner
-
initSerializationSetup
public void initSerializationSetup()
Regenerates all the objects that are necessary for serialization.- Specified by:
initSerializationSetupin interfaceadams.core.SerializableObject
-
retrieveSerializationSetup
public Object[] retrieveSerializationSetup()
Returns the member variables to serialize to a file.- Specified by:
retrieveSerializationSetupin interfaceadams.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:
setSerializationSetupin interfaceadams.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:
getDatabaseConnectionin interfaceadams.db.DatabaseConnectionProvider- Returns:
- the current object
-
setDatabaseConnection
public void setDatabaseConnection(adams.db.AbstractDatabaseConnection value)
Sets the database connection object to use.- Specified by:
setDatabaseConnectionin interfaceadams.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 valuevalue- 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:
performCheckin classAbstractCleaner- Parameters:
data- the spectrum to check- Returns:
- null if ok, otherwise error message
-
-