Package adams.data.cleaner.spectrum
Class InterPercentileRangeCleaner.DataCollector
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.data.cleaner.spectrum.InterPercentileRangeCleaner.DataCollector
-
- All Implemented Interfaces:
adams.core.logging.LoggingSupporter
,adams.core.SizeOfHandler
,Serializable
- Enclosing class:
- InterPercentileRangeCleaner
public static class InterPercentileRangeCleaner.DataCollector extends adams.core.logging.LoggingObject
A helper class for collecting the data from the database and computing the inter-percentile ranges (IPRs).- Version:
- $Revision: 1913 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Hashtable<Float,InterPercentileRangeCleaner.InterPercentileRange>
m_AmplitudeRanges
the inter-percentile ranges for the amplitudes (wavenumber - IPR).protected List<Hashtable<Float,Float[]>>
m_AmplitudeRangesPerChunk
the inter-percentile ranges for the amplitudes (list of wavenumber - lower/upper percentile) per chunk.protected int
m_ChunkSize
the chunk size.protected adams.db.AbstractDatabaseConnection
m_DatabaseConnection
the database connection.protected Hashtable<adams.data.report.Field,InterPercentileRangeCleaner.InterPercentileRange>
m_FieldRanges
the inter-percentile ranges for the fields (field - IPR).protected List<Hashtable<adams.data.report.Field,Float[]>>
m_FieldRangesPerChunk
the inter-percentile ranges for the fields (field - lower/upper percentile) per chunk.protected HashSet<adams.data.report.Field>
m_Fields
the fields that were encountered.protected List<Integer>
m_IDs
the spectrum IDs to collected the data from.protected double
m_LowerPercentile
the lower percentile.protected double
m_UpperPercentile
the upper percentile.protected HashSet<Float>
m_WaveNumbers
the wave numbers that were encountered.
-
Constructor Summary
Constructors Constructor Description DataCollector(adams.db.AbstractDatabaseConnection dbcon, List<Integer> IDs, double lowerPercentile, double upperPercentile, int chunkSize)
Initializes the data collector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
collect()
Starts the collection of the data.protected Object[]
collectChunk(int fromIndex, int toIndex)
Collects a single chunk.protected void
collectChunks()
Collects the data in chunks and computes the ranges based on that (picks the median).Hashtable<Float,InterPercentileRangeCleaner.InterPercentileRange>
getAmplitudeRanges()
Returns the inter-percentile ranges for the amplitudes.int
getChunkSize()
Returns the size of the chunks being used.Hashtable<adams.data.report.Field,InterPercentileRangeCleaner.InterPercentileRange>
getFieldRanges()
Returns the ranges for the fields.List<Integer>
getIDs()
Returns the IDs used for data collection.double
getLowerPercentile()
Returns the lower percentile.protected SpectrumF
getSpectrumF()
Returns the SpectrumT singleton to use.double
getUpperPercentile()
Returns the upper percentile.
-
-
-
Field Detail
-
m_ChunkSize
protected int m_ChunkSize
the chunk size.
-
m_LowerPercentile
protected double m_LowerPercentile
the lower percentile.
-
m_UpperPercentile
protected double m_UpperPercentile
the upper percentile.
-
m_AmplitudeRanges
protected Hashtable<Float,InterPercentileRangeCleaner.InterPercentileRange> m_AmplitudeRanges
the inter-percentile ranges for the amplitudes (wavenumber - IPR).
-
m_FieldRanges
protected Hashtable<adams.data.report.Field,InterPercentileRangeCleaner.InterPercentileRange> m_FieldRanges
the inter-percentile ranges for the fields (field - IPR).
-
m_AmplitudeRangesPerChunk
protected List<Hashtable<Float,Float[]>> m_AmplitudeRangesPerChunk
the inter-percentile ranges for the amplitudes (list of wavenumber - lower/upper percentile) per chunk.
-
m_FieldRangesPerChunk
protected List<Hashtable<adams.data.report.Field,Float[]>> m_FieldRangesPerChunk
the inter-percentile ranges for the fields (field - lower/upper percentile) per chunk.
-
m_Fields
protected HashSet<adams.data.report.Field> m_Fields
the fields that were encountered.
-
m_DatabaseConnection
protected adams.db.AbstractDatabaseConnection m_DatabaseConnection
the database connection.
-
-
Constructor Detail
-
DataCollector
public DataCollector(adams.db.AbstractDatabaseConnection dbcon, List<Integer> IDs, double lowerPercentile, double upperPercentile, int chunkSize)
Initializes the data collector.- Parameters:
IDs
- the IDs to uselowerPercentile
- the lower percentile to retrieveupperPercentile
- the upper percentile to retrievechunkSize
- the size of the chunks
-
-
Method Detail
-
getAmplitudeRanges
public Hashtable<Float,InterPercentileRangeCleaner.InterPercentileRange> getAmplitudeRanges()
Returns the inter-percentile ranges for the amplitudes.- Returns:
- the ranges
-
getFieldRanges
public Hashtable<adams.data.report.Field,InterPercentileRangeCleaner.InterPercentileRange> getFieldRanges()
Returns the ranges for the fields.- Returns:
- the ranges
-
getChunkSize
public int getChunkSize()
Returns the size of the chunks being used.- Returns:
- the size
-
getLowerPercentile
public double getLowerPercentile()
Returns the lower percentile.- Returns:
- the percentile
-
getUpperPercentile
public double getUpperPercentile()
Returns the upper percentile.- Returns:
- the percentile
-
getSpectrumF
protected SpectrumF getSpectrumF()
Returns the SpectrumT singleton to use.- Returns:
- the table singleton to use
-
collectChunk
protected Object[] collectChunk(int fromIndex, int toIndex)
Collects a single chunk.- Parameters:
fromIndex
- the start index (incl.)toIndex
- the end index (incl.)- Returns:
- an array of length two, storing the collected ranges for the amplitudes and the fields
-
collectChunks
protected void collectChunks()
Collects the data in chunks and computes the ranges based on that (picks the median).
-
collect
public void collect()
Starts the collection of the data.
-
-