Package detectionPlotFX.plots
Class WignerPlot<D extends PamDataUnit>
java.lang.Object
detectionPlotFX.plots.WignerPlot<D>
- Type Parameters:
D
- the specific pamDetection type.
- All Implemented Interfaces:
DetectionPlot<D>
- Direct Known Subclasses:
MTClassifierPane.WignerTemplateData
,RawWignerPlot
,WhistleWignerPlot
Plots a Wigner transform of a detection.
- Author:
- Jamie Macaulay
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
The Wigner update object.class
Runs a Wigner plot in separate thread. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected D
The last plotted detection.protected WignerPlot<D>.WignerTask
The wigner load task.Fields inherited from interface detectionPlotFX.layout.DetectionPlot
SCROLLPANE_DRAW, STANDARD_DRAW
-
Constructor Summary
ConstructorsConstructorDescriptionWignerPlot
(DetectionPlotDisplay detectionPlotDisplay) Constructor for the waveform plot. -
Method Summary
Modifier and TypeMethodDescriptionprotected double[][]
calcWignerData
(D pamDetection, double[] waveform, DetectionPlotProjector projector) Calculate Wigner data for a data unit.void
checWignerRecalc
(WignerPlotParams wignerParameters) Check whether the wigner plot needs recalculated with a new settings.double[][]
conditionWaveform
(double[] clickWave) Perform pre-conditioning of waveform.protected void
createImage
(double[][] wignerData) Generate the image from the Wigner plot data.protected void
drawPlot
(javafx.scene.canvas.GraphicsContext gc, javafx.scene.shape.Rectangle rectangle, D pamDetection, DetectionPlotProjector projector) Draw the image on a graphics context.getName()
Get the name of the plot e.g.boolean
javafx.scene.layout.Pane
Get the settings pane for the particular plot.abstract double[]
getWaveform
(D pamDetection, int chan) Get the waveforms from a PamDetectionGet the parameters for the wigner plot.Get the settings pane.double[]
Get the current waveform used to calculate the wigner plot.boolean
Indicates whether the wigner image needs recalculated.void
paintPlot
(D pamDetection, javafx.scene.canvas.GraphicsContext gc, javafx.scene.shape.Rectangle rectangle, DetectionPlotProjector projector, int flag) Plot the relevent data from a detection.void
Repaint the current data unit.void
setNeedsRecalc
(boolean needsRecalc) Set the needs recalc flag.void
setupAxis
(D pamDetection, double sR, DetectionPlotProjector projector) Called to set up the axis correctly before the plot is createdvoid
Setup the plot.void
setWignerParameters
(WignerPlotParams params) void
setWignerWaveform
(double[] wignerWaveform) Set th current wigner waveform.
-
Field Details
-
currentDetection
The last plotted detection. -
wignerLoadTask
The wigner load task.
-
-
Constructor Details
-
WignerPlot
Constructor for the waveform plot.
-
-
Method Details
-
getName
Description copied from interface:DetectionPlot
Get the name of the plot e.g. waveform, spectrum etc.- Specified by:
getName
in interfaceDetectionPlot<D extends PamDataUnit>
-
setupPlot
public void setupPlot()Description copied from interface:DetectionPlot
Setup the plot. This may, for example, involve changing axis etc.- Specified by:
setupPlot
in interfaceDetectionPlot<D extends PamDataUnit>
-
setupAxis
Called to set up the axis correctly before the plot is created- Specified by:
setupAxis
in interfaceDetectionPlot<D extends PamDataUnit>
- Parameters:
pamDetection
- - the data of every channel. e.g. might be a waveform with each point representing a sample.sR
- - the sample rate.waveform
- - the waveforms of every channel. Each point represents one sample.pamAxis
- - all the axis of the graph. this is in order TOP, RIGHT, BOTTOM, LEFT.
-
getWaveform
Get the waveforms from a PamDetection- Parameters:
pamDetection
- the detectionchan
- - the single channel to plot (not the channel bitmap)- Returns:
- the waveform for each channel
-
paintPlot
public void paintPlot(D pamDetection, javafx.scene.canvas.GraphicsContext gc, javafx.scene.shape.Rectangle rectangle, DetectionPlotProjector projector, int flag) Description copied from interface:DetectionPlot
Plot the relevent data from a detection.- Specified by:
paintPlot
in interfaceDetectionPlot<D extends PamDataUnit>
- Parameters:
pamDetection
- - the data of every channel. e.g. might be a waveform with each point representing a sample.gc
- - the graphics handle to draw on.
-
drawPlot
protected void drawPlot(javafx.scene.canvas.GraphicsContext gc, javafx.scene.shape.Rectangle rectangle, D pamDetection, DetectionPlotProjector projector) Draw the image on a graphics context.- Parameters:
gc
- - graphics context
-
createImage
protected void createImage(double[][] wignerData) Generate the image from the Wigner plot data. Note that this algorithms cannot be used to plot large Wigner data sets.- Parameters:
complete
- set of Wigner data to plot.
-
calcWignerData
protected double[][] calcWignerData(D pamDetection, double[] waveform, DetectionPlotProjector projector) Calculate Wigner data for a data unit.- Parameters:
pamDetection
- - the data unitchan
- - the channel of the data unit to plot.pamAxis
- - the axis to plot on.- Returns:
- wignerData - the wigner surface. This will be nbins by nbins in size.
-
conditionWaveform
public double[][] conditionWaveform(double[] clickWave) Perform pre-conditioning of waveform. Returns both the waveform and bin limits if the waveform has been shortened.- Returns:
- conditioned waveform in first row and bin limits in second row.
-
getSettingsPane
public javafx.scene.layout.Pane getSettingsPane()Description copied from interface:DetectionPlot
Get the settings pane for the particular plot. This sits on the right hand side of the display inside a hiding pane.- Specified by:
getSettingsPane
in interfaceDetectionPlot<D extends PamDataUnit>
- Returns:
- a pane with controls for changing settings in a node.
-
getWignerParameters
Get the parameters for the wigner plot.- Returns:
-
reDrawLastUnit
public void reDrawLastUnit()Repaint the current data unit. -
setWignerParameters
-
checWignerRecalc
Check whether the wigner plot needs recalculated with a new settings.- Parameters:
wignerParameters
-
-
isNeedsRecalc
public boolean isNeedsRecalc()Indicates whether the wigner image needs recalculated.- Returns:
-
setNeedsRecalc
public void setNeedsRecalc(boolean needsRecalc) Set the needs recalc flag. This will force a recalculation of wigner data.- Parameters:
needsRecalc
-
-
getNeedsRecalc
public boolean getNeedsRecalc() -
getWignerSettingsPane
Get the settings pane. This pane changes wigner plot specific settings.- Returns:
- the Wigner settings pane
-
getWignerWaveform
public double[] getWignerWaveform()Get the current waveform used to calculate the wigner plot.- Returns:
- - the current wigner waveform
-
setWignerWaveform
public void setWignerWaveform(double[] wignerWaveform) Set th current wigner waveform.- Parameters:
wignerWaveform
- - the current wigner waveform.
-
getDetectionPlotDisplay
-