seismicVeto
Class VetoProcess.ChannelDetector

java.lang.Object
  extended by seismicVeto.VetoProcess.ChannelDetector
Enclosing class:
VetoProcess

 class VetoProcess.ChannelDetector
extends java.lang.Object

Since the detector may be running on several channels, make a sub class for the actual detector code so that multiple instances may be created.

Author:
Doug Gillespie

Field Summary
private  double background
           
private  int callCount
           
private  int channel
           
private  long detectionEndSample
           
private  double detectionEnergy
           
private  boolean detectionOn
           
private  int detectionSliceCount
           
private  long detectionStartSample
           
private  int randomSample
           
private  double[][] randomWaveData
          Random waveofrms for use in simulated wave data.
private  double[] runningBackground
           
private  int selectedWave1
           
private  int selectedWave2
           
(package private) static int setupCount
           
 
Constructor Summary
VetoProcess.ChannelDetector(int channel)
           
 
Method Summary
protected  void clearWaveData(double[] data)
           
private  void continueDetection(FFTDataUnit dataUnit, double energy)
           
private  void endDetection()
           
private  double energySum(Complex[] fftData, int bin1, int bin2)
           
protected  void fillWaveData(double[] data)
           
 double[] getRunningBackground()
           
 void newData(PamObservable o, FFTDataUnit arg)
          Performs the same function as newData in the outer class, but this time it should only ever get called with data for a single channel.
 void pamStart()
           
private  double[][] prepareRandomWaveData(int nSamples)
          generate a number of random samples of data which follow a particular spectral shape.
private  void startDetection(FFTDataUnit dataUnit, double energy)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

channel

private int channel

detectionOn

private boolean detectionOn

background

private double background

callCount

private int callCount

runningBackground

private double[] runningBackground

setupCount

static final int setupCount
See Also:
Constant Field Values

randomWaveData

private double[][] randomWaveData
Random waveofrms for use in simulated wave data.


selectedWave1

private int selectedWave1

selectedWave2

private int selectedWave2

randomSample

private int randomSample

detectionEndSample

private long detectionEndSample

detectionStartSample

private long detectionStartSample

detectionEnergy

private double detectionEnergy

detectionSliceCount

private int detectionSliceCount
Constructor Detail

VetoProcess.ChannelDetector

public VetoProcess.ChannelDetector(int channel)
Method Detail

pamStart

public void pamStart()

newData

public void newData(PamObservable o,
                    FFTDataUnit arg)
Performs the same function as newData in the outer class, but this time it should only ever get called with data for a single channel. For the first few calls, it just updates the background by taking a straight mean of the energy values. After that it calculates a decaying average of the background.

Parameters:
o -
arg -

fillWaveData

protected void fillWaveData(double[] data)

clearWaveData

protected void clearWaveData(double[] data)

prepareRandomWaveData

private double[][] prepareRandomWaveData(int nSamples)
generate a number of random samples of data which follow a particular spectral shape. These will be stitched together in random order to make a longer wave sample in the veto

Parameters:
nSamples -
sampleLength -

energySum

private double energySum(Complex[] fftData,
                         int bin1,
                         int bin2)

startDetection

private void startDetection(FFTDataUnit dataUnit,
                            double energy)

continueDetection

private void continueDetection(FFTDataUnit dataUnit,
                               double energy)

endDetection

private void endDetection()

getRunningBackground

public double[] getRunningBackground()