waterfall  0.2dev
 All Classes Files Functions Variables Enumerations Enumerator Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
BolidRecorder Class Reference

Recorder for WaterfallBackend class that detects and records bolids. More...

#include <BolidRecorder.h>

Public Types

enum  State { STATE_INIT, STATE_BOLID, STATE_BOLID_ENDED, STATE_COUNT }
 Lists states of the bolid detection finite state machine. More...
 

Public Member Functions

 BolidRecorder ()
 Constructor.
 
 BolidRecorder (Ref< WaterfallBackend > backend, int snapshotLength, float leftFrequency, float rightFrequency, float minDetectionFq, float maxDetectionFq, float minNoiseFq, float maxNoiseFq, double advanceTime, double jitterTime, float averageFreqRange, float threshold, string metadataPath)
 Constructor.
 
virtual ~BolidRecorder ()
 Destructor.
 
virtual string getFileName (WFTime time)
 
virtual string getMetadataFileName (WFTime time)
 
virtual void start ()
 
virtual void update ()
 
- Public Member Functions inherited from SnapshotRecorder
 SnapshotRecorder (Ref< WaterfallBackend > backend, int snapshotLength, float leftFrequency, float rightFrequency)
 
virtual string getFileName (const char *typ, const char *ext, WFTime time)
 
virtual string getFileName (const string &typ, const string &origin, WFTime time)
 
virtual string getFileBasename (const char *typ, const char *ext, const string &origin, WFTime time)
 
virtual int requestBufferSize ()
 
virtual void stop ()
 
- Public Member Functions inherited from Recorder
 Recorder (Ref< WaterfallBackend > backend)
 
void setBuffer (RingBuffer2D< float > *buffer, FFTBackend::IQBuffer *rawBuffer, Mutex *bufferMutex, vector< RawDataHandle > *rawHandles)
 
int getSampleRate ()
 
int getFFTSampleRate ()
 
int fftMarkToRaw (int mark)
 
WFTime fftMarkToTime (int mark)
 
int fftSamplesToRaw (int sampleCount)
 Converts number of FFT samples to number raw I/Q samples.
 

Static Public Member Functions

static float noise (float *buffer, int length)
 
static int peak (float *buffer, int length)
 Returns the index of a maximal value in a float buffer.
 
static float average (float *buffer, int length)
 Returns the average value of all elements of a float buffer.
 
static Ref< DIObject > make (Ref< DynObject > config, Ref< DIObject > parent)
 Factory method for BolidRecorder. More...
 
- Static Public Member Functions inherited from SnapshotRecorder
static Ref< DIObject > make (Ref< DynObject > config, Ref< DIObject > parent)
 

Protected Member Functions

float average (float fromFq, float toFq)
 
- Protected Member Functions inherited from SnapshotRecorder
void * threadMethod ()
 
void startWriting ()
 
virtual void write (Snapshot snapshot)
 
virtual void writeRaw (Snapshot snapshot)
 

Protected Attributes

Frequency Bounds
float minNoiseFq_
 
float maxNoiseFq_
 
int lowNoiseBin_
 
int noiseWidth_
 
float minDetectFq_
 
float maxDetectFq_
 
int lowDetectBin_
 
int detectWidth_
 
Detection Algorithm Settings
double advanceTime_
 In seconds.
 
int advance_
 In FFT rows.
 
double jitterTime_
 In seconds.
 
int jitter_
 In FFT rows.
 
float averageFrequencyRange_
 In Hz.
 
int averageBinRange_
 In bins.
 
float thresholdRatio_
 
string metadataPath_
 
- Protected Attributes inherited from SnapshotRecorder
int snapshotLength_
 
float leftFrequency_
 
float rightFrequency_
 
bool writeUnfinished_
 
int snapshotRows_
 
int leftBin_
 
int rightBin_
 
Snapshot nextSnapshot_
 
Thread * workerThread_
 
Channel< Snapshotsnapshots_
 
- Protected Attributes inherited from Recorder
Ref< WaterfallBackendbackend_
 This recorder's backend.
 
RingBuffer2D< float > * buffer_
 FFT data buffer to record from.
 
FFTBackend::IQBufferrawBuffer_
 I/Q data buffer to record from.
 
Mutex * bufferMutex_
 Controls access to buffer_.
 
vector< RawDataHandle > * rawHandles_
 

Detection Algorithm Variables

State state_
 
float peakFreq_
 
int duration_
 
float noise_
 
float magnitude_
 
vector< float > noiseBuffer_
 
Ref< Output > metadataFile_
 
Ref< Output > getMetadataFile (WFTime time)
 

Additional Inherited Members

- Protected Types inherited from SnapshotRecorder
typedef MethodThread< void,
SnapshotRecorder
Thread
 

Detailed Description

Recorder for WaterfallBackend class that detects and records bolids.

This class analyzes FFT data passed to it from WaterfallBackend, attempts to detect bolids and when it does, records them to a FITS file.

Note
Recommended FFT bin settings for this recorder is: 32728 bins, 31704 bin (fft window) overlap.
Inheritance diagram for BolidRecorder:
Inheritance graph
[legend]
Collaboration diagram for BolidRecorder:
Collaboration graph
[legend]

Member Enumeration Documentation

Lists states of the bolid detection finite state machine.

Enumerator
STATE_INIT 

Default state, no bolid is being detected.

STATE_BOLID 

Bolid is being detected.

STATE_BOLID_ENDED 

Bolid has been detected, waiting for the timeout to run out.

STATE_COUNT 

Number of states.

Member Function Documentation

Ref< DIObject > BolidRecorder::make ( Ref< DynObject >  config,
Ref< DIObject >  parent 
)
static

Factory method for BolidRecorder.

The config values this method expects in parent are:

  • snapshot_length
  • low_freq
  • hi_freq
  • low_detect_freq
  • hi_detect_freq
  • low_noise_freq
  • hi_noise_freq

The documentation for this class was generated from the following files: