Omicron
4.2.0
An algorithm to detect and characterize transient events in gravitational-wave detectors
|
Construct a time-frequency-Q tiling structure. More...
#include <Otile.h>
Public Member Functions | |
void | DrawMapTiling (const unsigned int aQindex) |
Displays a canonical representation of a given Q-plane. More... | |
void | FillFullMap (const unsigned int aWindowIndex, const double aTimeOffset=0.0) |
Fills the full map. More... | |
void | FillMaps (void) |
Fills the Q-plane maps. More... | |
double | GetBandFrequency (const unsigned int aQindex, const unsigned int aBandIndex) |
Returns the band central frequency [Hz] of a given Q-plane. More... | |
unsigned int | GetBandN (const unsigned int aQindex) |
Returns the number of frequency bands of a given Q-plane. More... | |
double * | GetBands (const unsigned int aQindex) |
Returns the list of frequency bands. More... | |
unsigned int | GetBandTileN (const unsigned int aQindex, const unsigned int aBandIndex) |
Returns the number of tiles in a band of a given Q-plane. More... | |
double | GetChirpMass (void) |
Returns the chirp mass [solar masses]. More... | |
double | GetFrequencyMax (void) |
Returns the highest frequency of this tiling [Hz]. More... | |
double | GetFrequencyMin (void) |
Returns the minimum frequency of this tiling [Hz]. More... | |
TH2D * | GetFullMap (const unsigned int aWindowIndex) |
Returns a copy of the full map. More... | |
string | GetMapFill (void) |
Returns the current map fill type. More... | |
double | GetMismatchMax (void) |
Returns the maximum mismatch between tiles. More... | |
vector< unsigned int > | GetPlotTimeWindows (void) |
Returns the list of time windows for plots. More... | |
double | GetQ (const unsigned int aQindex) |
Returns the Q value of a given Q-plane. More... | |
unsigned int | GetQN (void) |
Returns the number of Q-planes. More... | |
double | GetRangezMin (void) |
Returns the map Z-axis range minimum. More... | |
double | GetSnrMapThr (void) |
Returns the current SNR threshold for maps. More... | |
double | GetSnrSqMax (const unsigned int aQindex) |
Returns the maximum SNR squared estimated in a given Q plane. More... | |
double | GetSnrTriggerThr (void) |
Returns the current SNR threshold for triggers. More... | |
double | GetTileAmplitude (const unsigned int aQindex, const unsigned int aBandIndex, const unsigned int aTimeTileIndex) |
Returns the amplitude of a given tile. More... | |
double | GetTileAmplitudeSq (const unsigned int aQindex, const unsigned int aBandIndex, const unsigned int aTimeTileIndex) |
Returns the amplitude squared of a given tile. More... | |
long unsigned int | GetTileN (const double aPadding=0.0) |
Returns the total number of tiles. More... | |
Segments * | GetTileSegments (TH1D *aSnrThreshold, const double aPadding) |
Returns tile segments. More... | |
double | GetTileSnrSq (const unsigned int aQindex, const unsigned int aBandIndex, const unsigned int aTimeTileIndex) |
Returns the SNR squared of a given tile. More... | |
unsigned int | GetTimeRange (void) |
Returns the time range [s]. More... | |
long unsigned int | ProjectData (fft *aDataFft) |
Projects a whitened data vector onto the Q planes. More... | |
double | SaveMaps (const string aOutdir, const string aName, const string aFormat, const double aTimeOffset=0.0, const bool aThumb=false) |
Saves the maps for each Q-planes in output files. More... | |
bool | SaveTriggers (TriggerBuffer *aTriggers) |
Saves tiles in a trigger structure. More... | |
void | SetChirp (const double aMchirp=-1.0, const double aMergerTime=-1.0) |
Sets the chirp mass [solar mass]. More... | |
void | SetMapFill (const string aMapContentType="snr") |
Defines how to fill the maps. More... | |
void | SetPlotTimeWindows (vector< unsigned int > aWindows) |
Sets the list of time windows for plots. More... | |
void | SetPower (Spectrum *aSpec1, Spectrum *aSpec2) |
Computes the noise power associated to the tiling structure. More... | |
void | SetRangez (const double aZmin=-1.0, const double aZmax=-1.0) |
Sets the map Z-axis range. More... | |
void | SetSnrThr (const double aSnrThr_map=0.0, const double aSnrThr_trigger=2.0) |
Sets a SNR threshold when saving maps and triggers. More... | |
Constructors and destructors | |
Otile (const unsigned int aTimeRange, const unsigned int aTimeOverlap, const double aQMin, const double aQMax, const double aFrequencyMin, const double aFrequencyMax, const unsigned int aSampleFrequency, const double aMaximumMismatch, const unsigned int aFullMapNt=1, const string aPlotStyle="GWOLLUM", const unsigned int aVerbosity=0) | |
Constructor of the Otile class. More... | |
virtual | ~Otile (void) |
Destructor of the Otile class. More... | |
Public Member Functions inherited from Osequence | |
Segments * | GetChunkOut (void) |
Returns the active segments in the current chunk. More... | |
unsigned int | GetChunkTimeCenter (void) |
Returns the central GPS time of current chunk [s]. More... | |
unsigned int | GetChunkTimeEnd (void) |
Returns the ending GPS time of current chunk [s]. More... | |
unsigned int | GetChunkTimeStart (void) |
Returns the starting GPS time of current chunk [s]. More... | |
unsigned int | GetCurrentOverlapDuration (void) |
Returns the current overlap duration [s]. More... | |
unsigned int | GetOverlapDuration (void) |
Returns the nominal overlap duration [s]. More... | |
unsigned int | GetTimeRange (void) |
Returns the sequence time range [s]. More... | |
bool | NewChunk (bool &aNewSegFlag) |
Loads a new Sequence chunk. More... | |
void | ResetSequence (void) |
Resets the time sequence. More... | |
unsigned int | SetSegments (Segments *aInSeg, Segments *aOutSeg=NULL) |
Sets new input/output segments. More... | |
Osequence (const unsigned int aTimeRange, const unsigned int aTimeOverlap, const unsigned int aVerbosity=0) | |
Constructor of the Osequence class. More... | |
virtual | ~Osequence (void) |
Destructor of the Osequence class. More... | |
Private Attributes | |
TF1 * | chirp |
Chirp track. More... | |
double | chirpm |
Chirp mass [solar mass]. More... | |
double | chirpt |
Chirp merger time [s]. More... | |
unsigned int ** | f_snrmax |
Loudest frequency tile (SNR). More... | |
TH2D ** | fullmap |
Full maps. More... | |
unsigned int | FullMapNt |
Number of time bins in the full map (0 for full resolution). More... | |
unsigned int | fVerbosity |
Verbosity level. More... | |
string | mapfill |
Map fill type. More... | |
double | MaximumMismatch |
Maximum mismatch. More... | |
unsigned int | nq |
number of q planes. More... | |
vector< unsigned int > | pwin |
Plot time windows. More... | |
Oqplane ** | qplanes |
Q planes. More... | |
double | SnrThr_map |
Map SNR threshold. More... | |
unsigned int ** | t_snrmax |
Loudest time tile (SNR). More... | |
double | vrange [2] |
Map Z-axis range. More... | |
Construct a time-frequency-Q tiling structure.
This class is 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.
This class also initializes an analysis sequence with the Osequence class from which it inherits.
This class offers a graphical interface (GwollumPlot inheritance) and plotting functions to display the tiles and the data.
Otile::Otile | ( | const unsigned int | aTimeRange, |
const unsigned int | aTimeOverlap, | ||
const double | aQMin, | ||
const double | aQMax, | ||
const double | aFrequencyMin, | ||
const double | aFrequencyMax, | ||
const unsigned int | aSampleFrequency, | ||
const double | aMaximumMismatch, | ||
const unsigned int | aFullMapNt = 1 , |
||
const string | aPlotStyle = "GWOLLUM" , |
||
const unsigned int | aVerbosity = 0 |
||
) |
Constructor of the Otile class.
The 3-dimensional tiling structure 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 to guarantee a maximal fractional energy loss from one tile to the next.
The analysis sequence is initialized:
[in] | aTimeRange | Time range [s]. |
[in] | aTimeOverlap | Time overlap [s]. |
[in] | aQMin | Minimal Q value. |
[in] | aQMax | Maximal Q value. |
[in] | aFrequencyMin | Minimal frequency [Hz]. |
[in] | aFrequencyMax | Maximal frequency [Hz]. |
[in] | aSampleFrequency | Sampling frequency [Hz]. |
[in] | aMaximumMismatch | Maximum mismatch between tiles. |
[in] | aFullMapNt | Full map time resolution (number of bins). 0 = full resolution. Use = 1 for a minimum resolution. This resolution cannot be changed anymore. |
[in] | aPlotStyle | Plotting style. |
[in] | aVerbosity | Verbosity level. |
|
virtual |
Destructor of the Otile class.
void Otile::DrawMapTiling | ( | const unsigned int | aQindex | ) |
Displays a canonical representation of a given Q-plane.
[in] | aQindex | Q-plane index: must be valid. |
void Otile::FillFullMap | ( | const unsigned int | aWindowIndex, |
const double | aTimeOffset = 0.0 |
||
) |
Fills the full map.
The full map combines all the Q-planes. For a given full map bin, the highest SNR ovelapping Q-plane tile is considered.
[in] | aWindowIndex | Window index, as defined with SetPlotTimeWindows(). |
[in] | aTimeOffset | Time offset [s]. |
|
inline |
Fills the Q-plane maps.
|
inline |
Returns the band central frequency [Hz] of a given Q-plane.
[in] | aQindex | Q-plane index. If the index is out of range, the full map is considered. |
[in] | aBandIndex | Band index. |
|
inline |
Returns the number of frequency bands of a given Q-plane.
[in] | aQindex | Q-plane index. If the index is out of range, the full map is considered. |
double * Otile::GetBands | ( | const unsigned int | aQindex | ) |
Returns the list of frequency bands.
The returned array is of size GetBandN()+1 and contains the bin limits.
[in] | aQindex | Q-plane index. If the index is out of range, the full map is considered. |
|
inline |
Returns the number of tiles in a band of a given Q-plane.
[in] | aQindex | Q-plane index. If the index is out of range, the full map is considered. |
[in] | aBandIndex | Band index (irrelevant for the full map). |
|
inline |
Returns the chirp mass [solar masses].
|
inline |
Returns the highest frequency of this tiling [Hz].
The maximum frequency of the highest Q plane is returned.
|
inline |
Returns the minimum frequency of this tiling [Hz].
The minimum frequency of the lowest-Q plane is returned.
|
inline |
Returns a copy of the full map.
[in] | aWindowIndex | Window index, as defined with SetPlotTimeWindows(). |
|
inline |
Returns the current map fill type.
|
inline |
Returns the maximum mismatch between tiles.
|
inline |
Returns the list of time windows for plots.
|
inline |
Returns the Q value of a given Q-plane.
[in] | aQindex | Q-plane index. If the index is out of range, 0 is returned. |
|
inline |
Returns the number of Q-planes.
|
inline |
Returns the map Z-axis range minimum.
|
inline |
Returns the current SNR threshold for maps.
|
inline |
Returns the maximum SNR squared estimated in a given Q plane.
[in] | aQindex | Q-plane index. |
|
inline |
Returns the current SNR threshold for triggers.
|
inline |
Returns the amplitude of a given tile.
[in] | aQindex | Q-plane index. |
[in] | aBandIndex | Band index. |
[in] | aTimeTileIndex | Tile index in the band. |
|
inline |
Returns the amplitude squared of a given tile.
[in] | aQindex | Q-plane index. |
[in] | aBandIndex | Band index. |
[in] | aTimeTileIndex | Tile index in the band. |
long unsigned int Otile::GetTileN | ( | const double | aPadding = 0.0 | ) |
Returns the total number of tiles.
[in] | aPadding | Number of seconds excluded on both sides of the time range. |
Segments * Otile::GetTileSegments | ( | TH1D * | aSnrThreshold, |
const double | aPadding | ||
) |
Returns tile segments.
A tile segment is the tile start/stop. Here, tiles are selected if the SNR is larger than a given threshold. The threshold is given as a TH1D histogram binned in the tile frequency [Hz]. The bin content is the SNR threshold. A negative bin content is considered as an infinite threshold. Out-of-range frequencies are associated to an infinite threshold.
[in] | aSnrThreshold | SNR threshold as a function of frequency. |
[in] | aPadding | Number of seconds excluded on both sides of the tiling structure when selecting tiles above the SNR threshold. |
|
inline |
Returns the SNR squared of a given tile.
[in] | aQindex | Q-plane index. |
[in] | aBandIndex | Band index. |
[in] | aTimeTileIndex | Tile index in the band. |
|
inline |
Returns the time range [s].
long unsigned int Otile::ProjectData | ( | fft * | aDataFft | ) |
Projects a whitened data vector onto the Q planes.
The complex data vector is projected onto each Q-plane. The data is provided through a fft object. The fft::Forward() must be applied before calling this function.
[in] | aDataFft | fft structure containing the data to project. |
double Otile::SaveMaps | ( | const string | aOutdir, |
const string | aName, | ||
const string | aFormat, | ||
const double | aTimeOffset = 0.0 , |
||
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 "full map" is also saved. It combines all tiles projected in the time-frequency plane.
[in] | aOutdir | Output directory path to save the plots. It must exist. |
[in] | aName | Name identifier used for titles. |
[in] | aFormat | Output format string: usual graphical formats are supported. |
[in] | aTimeOffset | Time offset applied to the window center [s]. |
[in] | aThumb | Produce thumbnails if set to true. |
bool Otile::SaveTriggers | ( | TriggerBuffer * | aTriggers | ) |
Saves tiles in a trigger structure.
Tiles with a SNR value above the SNR threshold are saved in the input trigger structure.
The corresponding triggers Segments are also saved following the GWOLLUM convention for triggers. If the Sequence
algorithm is in use, the current timing is applied to the tiling.
[in] | aTriggers | TriggerBuffer object. |
|
inline |
Sets the chirp mass [solar mass].
Use a negative mass value to not draw the chirp track. If the merger time is negative, the merger time is taken at the center of the timing window.
[in] | aMchirp | Chirp mass in solar masses. |
[in] | aMergerTime | Merger GPS time [s]. |
|
inline |
Defines how to fill the maps.
Use a keyword to define the content of maps:
[in] | aMapContentType | Map content keyword. |
void Otile::SetPlotTimeWindows | ( | vector< unsigned int > | aWindows | ) |
Sets the list of time windows for plots.
The full map containers are created.
[in] | aWindows | List of time windows [s]. |
|
inline |
Computes the noise power associated to the tiling structure.
[in] | aSpec1 | First noise power spectrum used to whiten the data. |
[in] | aSpec2 | Second noise power spectrum used to whiten the data. |
|
inline |
Sets the map Z-axis range.
If aZmin>=aZmax, the Z-axis is automatically ranged.
[in] | aZmin | Minimum Z value. |
[in] | aZmax | Maximum Z value. |
|
inline |
Sets a SNR threshold when saving maps and triggers.
The thresholds are applied when calling the SaveMaps() or SaveTriggers() functions.
[in] | aSnrThr_map | When calling SaveMaps(), a map is not saved if the loudest tile is below that threshold. |
[in] | aSnrThr_trigger | Tiles with a SNR value below that threshold are not saved when calling SaveTriggers(). |
|
private |
Chirp track.
|
private |
Chirp mass [solar mass].
|
private |
Chirp merger time [s].
|
private |
Loudest frequency tile (SNR).
|
private |
Full maps.
|
private |
Number of time bins in the full map (0 for full resolution).
|
private |
Verbosity level.
|
private |
Map fill type.
|
private |
Maximum mismatch.
|
private |
number of q planes.
|
private |
Plot time windows.
|
private |
Q planes.
|
private |
Map SNR threshold.
|
private |
Loudest time tile (SNR).
|
private |
Map Z-axis range.