Package de.gsi.dataset.spi
Class Histogram2
- java.lang.Object
-
- de.gsi.dataset.spi.AbstractStylable<D>
-
- de.gsi.dataset.spi.AbstractDataSet<D>
-
- de.gsi.dataset.spi.AbstractDataSet3D<AbstractHistogram>
-
- de.gsi.dataset.spi.AbstractHistogram
-
- de.gsi.dataset.spi.Histogram2
-
- All Implemented Interfaces:
DataSet,DataSet3D,DataSetMetaData,EventSource,Histogram,Histogram2D
public class Histogram2 extends AbstractHistogram implements Histogram2D
- Author:
- rstein
-
-
Field Summary
Fields Modifier and Type Field Description protected HistogramxProjectionprotected HistogramyProjection-
Fields inherited from class de.gsi.dataset.spi.AbstractHistogram
dataLabels, dataStyles
-
Fields inherited from class de.gsi.dataset.spi.AbstractDataSet3D
zRange
-
Fields inherited from class de.gsi.dataset.spi.AbstractDataSet
editConstraints, lock, metaInfoMap, name, updateListeners, xRange, yRange
-
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)java.util.List<java.lang.String>getErrorList()java.util.List<java.lang.String>getInfoList()Histogram1DgetProjectionX()Histogram1DgetProjectionY()protected doublegetSumX(int bin)protected doublegetSumY(int bin)java.util.List<java.lang.String>getWarningList()doublegetX(int i)Gets the x value of the data point with the index iintgetXDataCount()Returns number of X coordinates.doublegetY(int i)Gets the y value of the data point with the index iintgetYDataCount()Returns number of Y coordinates.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, addDataLabel, addDataStyle, findBin, findBin, findBin, findBinX, findBinY, findBinZ, findNextLargerIndex, getBinCenterX, getBinCenterY, getBinCenterZ, getBinContent, getDataLabel, getDataLabelMap, getDataStyleMap, getDimension, getMaximum, getMinimum, getNBinsX, getNBinsY, getNBinsZ, getStyle, getValueRange, isEquiDistant, removeDataLabel, removeStyle, set
-
Methods inherited from class de.gsi.dataset.spi.AbstractDataSet3D
computeLimits, getDataCount, getXIndex, getYIndex, getZRange
-
Methods inherited from class de.gsi.dataset.spi.AbstractDataSet
binarySearchX, binarySearchY, fireInvalidated, getDataCount, getDefaultDataLabel, getEditConstraints, getMetaInfo, getName, getThis, getUndefValue, getXMax, getXMin, getXRange, getYMax, getYMin, getYRange, isAutoNotification, lock, minNeigbourSearchX, setAutoNotifaction, setEditConstraints, setName, toString, unlock, updateEventListener
-
Methods inherited from class de.gsi.dataset.spi.AbstractStylable
getStyle, setStyle
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.gsi.dataset.DataSet
getDataCount, getDataCount, getName, getStyle, getUndefValue, getValue, getXIndex, getXMax, getXMin, getXValues, getYIndex, getYMax, getYMin, getYValues, isAutoNotification, lock, setAutoNotifaction, setStyle, unlock
-
Methods inherited from interface de.gsi.dataset.DataSetMetaData
getMetaInfo
-
Methods inherited from interface de.gsi.dataset.event.EventSource
addListener, invokeListener, invokeListener, 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
-
getProjectionX
public Histogram1D getProjectionX()
- Returns:
- 1D histogram with projection in X
-
getProjectionY
public Histogram1D getProjectionY()
- Returns:
- 1D histogram with projection in Y
-
reset
public void reset()
Description copied from interface:Histogramreset histogram content- Specified by:
resetin interfaceHistogram- Overrides:
resetin classAbstractHistogram
-
getZ
public double getZ(int xIndex, int yIndex)Description copied from interface:DataSet3DReturns Z coordinate for the specified data point.
-
getXDataCount
public int getXDataCount()
Description copied from interface:DataSet3DReturns number of X coordinates.- Specified by:
getXDataCountin interfaceDataSet3D- Returns:
- the number of y axis bins
-
getYDataCount
public int getYDataCount()
Description copied from interface:DataSet3DReturns number of Y coordinates.- Specified by:
getYDataCountin interfaceDataSet3D- Returns:
- the number of y axis bins
-
getX
public double getX(int i)
Description copied from interface:DataSetGets the x value of the data point with the index i
-
getY
public double getY(int i)
Description copied from interface:DataSetGets the y value of the data point with the index i
-
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 The function returns the corresponding bin number which has its content incremented by 1- 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 The function returns the corresponding bin number which has its content incremented by 1- 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
-
getInfoList
public java.util.List<java.lang.String> getInfoList()
- Specified by:
getInfoListin interfaceDataSetMetaData- Overrides:
getInfoListin classAbstractDataSet<AbstractHistogram>
-
getSumX
protected double getSumX(int bin)
-
getSumY
protected double getSumY(int bin)
-
getWarningList
public java.util.List<java.lang.String> getWarningList()
- Specified by:
getWarningListin interfaceDataSetMetaData- Overrides:
getWarningListin classAbstractDataSet<AbstractHistogram>
-
getErrorList
public java.util.List<java.lang.String> getErrorList()
- Specified by:
getErrorListin interfaceDataSetMetaData- Overrides:
getErrorListin classAbstractDataSet<AbstractHistogram>
-
-