Package de.gsi.dataset.spi
Class Histogram2
- java.lang.Object
-
- de.gsi.dataset.spi.AbstractStylable<D>
-
- de.gsi.dataset.spi.AbstractDataSet<AbstractHistogram>
-
- de.gsi.dataset.spi.AbstractHistogram
-
- de.gsi.dataset.spi.Histogram2
-
- All Implemented Interfaces:
DataSet,DataSetMetaData,EventSource,Histogram,Histogram2D,java.io.Serializable
public class Histogram2 extends AbstractHistogram implements Histogram2D
- Author:
- rstein
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected HistogramxProjectionprotected HistogramyProjection-
Fields inherited from class de.gsi.dataset.spi.AbstractHistogram
axisBins, data, nAxisBins
-
Fields inherited from interface de.gsi.dataset.DataSetMetaData
TAG_GAIN_RANGE, TAG_OVERSHOOT, TAG_UNDERSHOOT
-
-
Constructor Summary
Constructors Constructor Description Histogram2(java.lang.String name, int nBinsX, double minX, double maxX, int nBinsY, double minY, double maxY)Creates 2D histogram with name and ranges [minX, maxX] and [minY, maxY]
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intfill(double x, double y)Increment bin with abscissa X, Y, and Z by 1.intfill(double x, double y, double w)Increment bin with abscissa X by with a weight w.intfindFirstBinAbove(double x, double y)doubleget(int dimIndex, int binIndex)Gets the x value of the data point with the index ijava.util.List<java.lang.String>getErrorList()intgetIndex(int dimIndex, double value)Gets the index of the data point closest to the given x coordinate.java.util.List<java.lang.String>getInfoList()Histogram1DgetProjectionX()Histogram1DgetProjectionY()protected doublegetSum(int dimIndex, int bin)doublegetValue(int dimIndex, double x)Gets the interpolated y value of the data point for given x coordinatejava.util.List<java.lang.String>getWarningList()doublegetZ(int xIndex, int yIndex)Returns Z coordinate for the specified data point.voidreset()reset histogram content-
Methods inherited from class de.gsi.dataset.spi.AbstractHistogram
addBinContent, addBinContent, findBin, findBin, findBin, findNextLargerIndex, getBinCenter, getBinContent, getDataCount, getDataCount, isEquiDistant
-
Methods inherited from class de.gsi.dataset.spi.AbstractDataSet
addDataLabel, addDataStyle, autoNotification, binarySearch, clearMetaInfo, equalDataLabels, equalEditConstraints, equalErrorValues, equalMetaData, equals, equals, equalValues, fireInvalidated, getAxisDescriptions, getDataLabel, getDataLabelMap, getDataStyleMap, getDimension, getEditConstraints, getMetaInfo, getName, getStyle, getThis, hashCode, lock, minNeigbourSearchX, recomputeLimits, removeDataLabel, removeStyle, setEditConstraints, setName, toString, updateEventListener
-
Methods inherited from class de.gsi.dataset.spi.AbstractStylable
getStyle, setStyle
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.gsi.dataset.DataSet
getAxisDescription, getAxisDescriptions, getDataLabel, getDimension, getName, getStyle, getStyle, getValues, lock, recomputeLimits, setStyle
-
Methods inherited from interface de.gsi.dataset.DataSetMetaData
getMetaInfo
-
Methods inherited from interface de.gsi.dataset.event.EventSource
addListener, autoNotification, invokeListener, invokeListener, invokeListener, isAutoNotification, removeListener, updateEventListener
-
Methods inherited from interface de.gsi.dataset.Histogram2D
findBin
-
-
-
-
Constructor Detail
-
Histogram2
public Histogram2(java.lang.String name, int nBinsX, double minX, double maxX, int nBinsY, double minY, double maxY)Creates 2D histogram with name and ranges [minX, maxX] and [minY, maxY]- Parameters:
name- of the data setsnBinsX- number of horizontal binsminX- minimum of horizontal rangemaxX- maximum of horizontal rangenBinsY- number of vertical binsminY- minimum of vertical rangemaxY- maximum of vertical range
-
-
Method Detail
-
fill
public int fill(double x, double y)Description copied from interface:Histogram2DIncrement bin with abscissa X, Y, and Z by 1. if x is less than the low-edge of the first bin, the Underflow bin is incremented if x is equal to or greater than the upper edge of last bin, the Overflow bin is incremented- Specified by:
fillin interfaceHistogram2D- Parameters:
x- new value to be addedy- new value to be added- Returns:
- corresponding bin number which has its content incremented by 1
-
fill
public int fill(double x, double y, double w)Description copied from interface:Histogram2DIncrement bin with abscissa X by with a weight w. if x is less than the low-edge of the first bin, the Underflow bin is incremented if x is equal to or greater than the upper edge of last bin, the Overflow bin is incremented- Specified by:
fillin interfaceHistogram2D- Parameters:
x- new value to be addedy- new value to be addedw- weight- Returns:
- corresponding bin number which has its content incremented by 1
-
findFirstBinAbove
public int findFirstBinAbove(double x, double y)- Specified by:
findFirstBinAbovein interfaceHistogram2D- Parameters:
x- spatial real-valued coordinate in Xy- spatial real-valued coordinate in Y- Returns:
- bin index that is above the spatial x and y coordinates
-
get
public double get(int dimIndex, int binIndex)Description copied from interface:DataSetGets the x value of the data point with the index i
-
getErrorList
public java.util.List<java.lang.String> getErrorList()
- Specified by:
getErrorListin interfaceDataSetMetaData- Overrides:
getErrorListin classAbstractDataSet<AbstractHistogram>
-
getIndex
public int getIndex(int dimIndex, double value)Description copied from class:AbstractDataSetGets the index of the data point closest to the given x coordinate. If the x coordinate lies outside the range of the data set, the index of the first/last point is returned.- Specified by:
getIndexin interfaceDataSet- Overrides:
getIndexin classAbstractDataSet<AbstractHistogram>- Parameters:
dimIndex- the dimension indexvalue- the x position of the data point- Returns:
- the index of the data point
-
getInfoList
public java.util.List<java.lang.String> getInfoList()
- Specified by:
getInfoListin interfaceDataSetMetaData- Overrides:
getInfoListin classAbstractDataSet<AbstractHistogram>
-
getProjectionX
public Histogram1D getProjectionX()
- Returns:
- 1D histogram with projection in X
-
getProjectionY
public Histogram1D getProjectionY()
- Returns:
- 1D histogram with projection in Y
-
getSum
protected double getSum(int dimIndex, int bin)
-
getValue
public double getValue(int dimIndex, double x)Description copied from interface:DataSetGets the interpolated y value of the data point for given x coordinate
-
getWarningList
public java.util.List<java.lang.String> getWarningList()
- Specified by:
getWarningListin interfaceDataSetMetaData- Overrides:
getWarningListin classAbstractDataSet<AbstractHistogram>
-
getZ
public double getZ(int xIndex, int yIndex)Description copied from interface:Histogram2DReturns Z coordinate for the specified data point.- Specified by:
getZin interfaceHistogram2D- Parameters:
xIndex- index of X coordinateyIndex- index of Y coordinate- Returns:
- Z coordinate
-
reset
public void reset()
Description copied from interface:Histogramreset histogram content- Specified by:
resetin interfaceHistogram- Overrides:
resetin classAbstractHistogram
-
-