Construct a time-frequency-Q tiling. More...
#include <Otile.h>
Public Member Functions | |
bool | DrawMapContent (const int aQindex) |
Draws a given Q-plane. | |
bool | DrawMapPhase (const int aQindex) |
Draws phase for a given Q-plane. | |
bool | DrawMapTiling (const int aQindex) |
Displays a canonical representation of a given Q-plane. | |
int | GetNQ (void) |
Returns the number of Q planes. | |
double | GetQ (const int aQindex) |
Returns the Q value of a given plane. | |
bool | ProjectData (double *aDataRe, double *aDataIm, const bool aTileDown=true) |
Projects a data vector onto the Q planes. | |
double | SaveMaps (const string aOutdir, const string aName, const int aT0, const string aFormat, vector< int > aWindows, const bool aThumb=false) |
Saves the maps for each Q-planes in output files. | |
bool | SaveTriggers (MakeTriggers *aTriggers, const double aLeftTimePad=0.0, const double aRightTimePad=0.0, const double aT0=0.0) |
Saves active tiles in a MakeTriggers structure. | |
bool | SetPower (Spectrum *aSpec) |
Sets the data power spectrum. | |
void | SetSaveSelection (const double aSNRThr_map=-1.0, const double aSNRThr_trigger=2.0, const int aNTriggerMax=1000000) |
Sets a selection when saving maps and triggers. | |
void | SetSNRScale (const int aSNRScale) |
Sets the maximum for the map SNR vertical scale. | |
Constructors and destructors | |
Otile (const int aTimeRange, const double aQMin, const double aQMax, const double aFrequencyMin, const double aFrequencyMax, const int aSampleFrequency, const double aMaximumMismatch, const string aPlotStyle="GWOLLUM", const int aVerbosity=0) | |
Constructor of the Otile class. | |
virtual | ~Otile (void) |
Destructor of the Otile class. | |
Static Public Member Functions | |
static vector< double > | ComputeQs (const double aQMin, const double aQMax, const double aMaximumMismatch) |
Computes a set of Q values. |
Construct a time-frequency-Q tiling.
This class was designed to tile the 3-dimensional space in time, frequency and Q. The tiling consists of logarithmically spaced Q-planes. Each of these planes is divided in logarithmically spaced frequency bands. Each of these bands are then linearly divided in time bins. Once constructed, the planes can be used to apply a Q-transform to data. This class offers a graphical interface (GwollumPlot inheritance) and plotting functions to display the tiles and the data.
Otile::Otile | ( | const int | aTimeRange, | |
const double | aQMin, | |||
const double | aQMax, | |||
const double | aFrequencyMin, | |||
const double | aFrequencyMax, | |||
const int | aSampleFrequency, | |||
const double | aMaximumMismatch, | |||
const string | aPlotStyle = "GWOLLUM" , |
|||
const int | aVerbosity = 0 | |||
) |
Constructor of the Otile class.
The tiling is constructed given the user parameters. The parameter space is defined by a time range, a frequency range and a Q range. The user must specify a maximum mismatch value corresponding to a maximal fractional energy loss from one tile to the next.
Some conditions are to be met to use this class:
aTimeRange | time range [s] | |
aQMin | minimal Q value | |
aQMax | maximal Q value | |
aFrequencyMin | minimal frequency [Hz] | |
aFrequencyMax | maximal frequency [Hz] | |
aSampleFrequency | sampling frequency [Hz] | |
aMaximumMismatch | maximum mismatch between tiles | |
aPlotStyle | plotting style | |
aVerbosity | verbosity level |
Otile::~Otile | ( | void | ) | [virtual] |
Destructor of the Otile class.
vector< double > Otile::ComputeQs | ( | const double | aQMin, | |
const double | aQMax, | |||
const double | aMaximumMismatch | |||
) | [static] |
Computes a set of Q values.
This function returns a vector of Q values corresponding to a set of parameters:
aQMin | minimal Q value | |
aQMax | maximal Q value | |
aMaximumMismatch | maximum mismatch between Q planes |
bool Otile::DrawMapContent | ( | const int | aQindex | ) |
Draws a given Q-plane.
aQindex | Q-plane index |
bool Otile::DrawMapPhase | ( | const int | aQindex | ) |
Draws phase for a given Q-plane.
aQindex | Q-plane index |
bool Otile::DrawMapTiling | ( | const int | aQindex | ) |
Displays a canonical representation of a given Q-plane.
aQindex | Q-plane index |
int Otile::GetNQ | ( | void | ) | [inline] |
Returns the number of Q planes.
double Otile::GetQ | ( | const int | aQindex | ) |
Returns the Q value of a given plane.
-1.0 is returned if this function fails.
aQindex | Q-plane index |
bool Otile::ProjectData | ( | double * | aDataRe, | |
double * | aDataIm, | |||
const bool | aTileDown = true | |||
) |
Projects a data vector onto the Q planes.
A complex data vector is projected onto all the Q-planes. The tiles are populated with the resulting SNR values.
If requested, tiles are de-activated if they overlap (in time or frequency) another tile. This process is call down-tiling.
IMPORTANT: the input data vector must the right size, i.e. SampleFrequency/2 as defined in the constructor. No check will be performed!
aDataRe | real part of the data vector (frequency domain) | |
aDataIm | imaginary part of the data vector (frequency domain) | |
aTileDown | apply down-tiling if set to true |
double Otile::SaveMaps | ( | const string | aOutdir, | |
const string | aName, | |||
const int | aT0, | |||
const string | aFormat, | |||
vector< int > | aWindows, | |||
const bool | aThumb = false | |||
) |
Saves the maps for each Q-planes in output files.
The maps are saved in output files. An additionnal map called 'fullmap' is also saved. It represents active tiles projected in the time-frequency plane. IMPORTANT NOTE: Maps are not saved if the maximum SNR within the first window time range is below the SNR threshold, see SetSaveSelection(). The returned value is the maximum SNR value within the first window time range. -1.0 is returned if this function fails.
See also SetSaveSelection().
aOutdir | output directory path | |
aName | name identifier | |
aT0 | plane central time | |
aFormat | output format string | |
aWindows | list of time windows | |
aThumb | also produce thumbnails if set to true |
bool Otile::SaveTriggers | ( | MakeTriggers * | aTriggers, | |
const double | aLeftTimePad = 0.0 , |
|||
const double | aRightTimePad = 0.0 , |
|||
const double | aT0 = 0.0 | |||
) |
Saves active tiles in a MakeTriggers structure.
The triggers Segments are also saved follwing the GWOLLUM convention for triggers. A padding can be provided to NOT saved triggers on the plane edges. The planes are always centered on 0. A T0 must therefore be provided.
See also SetSaveSelection().
aTriggers | MakeTriggers object | |
aLeftTimePad | duration of the left padding | |
aRightTimePad | duration of the right padding | |
aT0 | plane central time |
bool Otile::SetPower | ( | Spectrum * | aSpec | ) |
Sets the data power spectrum.
This function must be called to compute the amplitude in a given tile: amplitude = SNR * sqrt(power). The power of a tile is given by the input power spectrum weighted by the Cone window. If this function is never called, the power is set to 0.
The PSD must be given as a valid Spectrum structure, i.e, the PSD was previously computed.
aSpec | Spectrum structure where the PSD has been computed |
void Otile::SetSaveSelection | ( | const double | aSNRThr_map = -1.0 , |
|
const double | aSNRThr_trigger = 2.0 , |
|||
const int | aNTriggerMax = 1000000 | |||
) | [inline] |
Sets a selection when saving maps and triggers.
This selection is applied when calling the SaveMaps() or SaveTriggers() functions.
aSNRThr_map | when calling SaveMaps(), a map is not saved if the loudest tile is below that threshold | |
aSNRThr_trigger | tiles with a SNR value below that threshold are not saved when calling SaveTriggers() | |
aTriggerFracMax | if, for a given Qplane, the fraction of tiles with a SNR above 'aSNRThr_trigger' is larger than this value, not a single tile of all planes can be saved. In other words, SaveTriggers() will return false |
void Otile::SetSNRScale | ( | const int | aSNRScale | ) | [inline] |
Sets the maximum for the map SNR vertical scale.
If the SNR value is smaller than 1, an automatic scale is used.
aSNRScale | maximal SNR value |