blah2
A real-time passive radar
Map< T > Class Template Reference

A class to store an ambiguity map. More...

#include <Map.h>

Collaboration diagram for Map< T >:
Collaboration graph

Public Member Functions

 Map (uint32_t nRows, uint32_t nCols)
 Constructor. More...
 
void set_row (uint32_t i, std::vector< T > row)
 Update a row in the 2D map. More...
 
void set_col (uint32_t i, std::vector< T > col)
 Update a column in the 2D map. More...
 
void set_metrics ()
 Create map metrics (noise power, dynamic range). More...
 
uint32_t get_nRows ()
 Get the number of rows in the map. More...
 
uint32_t get_nCols ()
 Get the number of columns in the map. More...
 
std::vector< T > get_row (uint32_t row)
 Get a row from the 2D map. More...
 
std::vector< T > get_col (uint32_t col)
 Get a column from the 2D map. More...
 
Map< double > * get_map_db ()
 Get a copy of the map in dB units. More...
 
void print ()
 Print the map to stdout (for debugging). More...
 
uint32_t doppler_hz_to_bin (double dopplerHz)
 Convert a Doppler value from Hz to bins. More...
 
std::string to_json (uint64_t timestamp)
 Generate JSON of the map and metadata. More...
 
std::string delay_bin_to_km (std::string json, uint32_t fs)
 Update JSON to convert delay bins to km. More...
 
bool save (std::string json, std::string path)
 Append the map to a save file. More...
 

Public Attributes

std::vector< std::vector< T > > data
 Map data to store. More...
 
std::deque< int > delay
 Delay units of map data (bins). More...
 
std::deque< double > doppler
 Doppler units of map data (Hz). More...
 
double noisePower
 Noise power of map (dB). More...
 
double maxPower
 Dynamic range of map (dB). More...
 

Private Attributes

uint32_t nRows
 Number of rows. More...
 
uint32_t nCols
 Number of columns. More...
 

Detailed Description

template<typename T>
class Map< T >

A class to store an ambiguity map.

References: Append to an existing array using rapidjson.

Author
30hours

Constructor & Destructor Documentation

◆ Map()

template<class T >
Map< T >::Map ( uint32_t  nRows,
uint32_t  nCols 
)

Constructor.

Parameters
nRowsNumber of rows.
nColsNumber of columns.
Returns
The object.

Member Function Documentation

◆ delay_bin_to_km()

template<class T >
std::string Map< T >::delay_bin_to_km ( std::string  json,
uint32_t  fs 
)

Update JSON to convert delay bins to km.

Parameters
jsonInput JSON string with delay field.
fsSampling frequency (Hz).
Returns
JSON string.

◆ doppler_hz_to_bin()

template<class T >
uint32_t Map< T >::doppler_hz_to_bin ( double  dopplerHz)

Convert a Doppler value from Hz to bins.

Parameters
dopplerHzDoppler value (Hz).
Returns
dopplerBin Doppler value (bins).

◆ get_col()

template<class T >
std::vector< T > Map< T >::get_col ( uint32_t  col)

Get a column from the 2D map.

Parameters
colIndex of column to get.
Returns
Vector of data.

◆ get_map_db()

template<class T >
Map< double > * Map< T >::get_map_db

Get a copy of the map in dB units.

Returns
Pointer to dB map.

◆ get_nCols()

template<class T >
uint32_t Map< T >::get_nCols

Get the number of columns in the map.

Returns
Number of columns.

◆ get_nRows()

template<class T >
uint32_t Map< T >::get_nRows

Get the number of rows in the map.

Returns
Number of rows.

◆ get_row()

template<class T >
std::vector< T > Map< T >::get_row ( uint32_t  row)

Get a row from the 2D map.

Parameters
rowIndex of row to get.
Returns
Vector of data.

◆ print()

template<class T >
void Map< T >::print

Print the map to stdout (for debugging).

Returns
Void.

◆ save()

template<class T >
bool Map< T >::save ( std::string  json,
std::string  path 
)

Append the map to a save file.

Parameters
jsonJSON string of map and metadata.
pathPath of file to save.
Returns
True is save is successful.

◆ set_col()

template<class T >
void Map< T >::set_col ( uint32_t  i,
std::vector< T >  col 
)

Update a column in the 2D map.

Parameters
iIndex of column to update.
colData to update.
Returns
Void.

◆ set_metrics()

template<class T >
void Map< T >::set_metrics

Create map metrics (noise power, dynamic range).

Returns
Void.

◆ set_row()

template<class T >
void Map< T >::set_row ( uint32_t  i,
std::vector< T >  row 
)

Update a row in the 2D map.

Parameters
iIndex of row to update.
rowData to update.
Returns
Void.

◆ to_json()

template<class T >
std::string Map< T >::to_json ( uint64_t  timestamp)

Generate JSON of the map and metadata.

Returns
JSON string.

Member Data Documentation

◆ data

template<typename T >
std::vector<std::vector<T> > Map< T >::data

Map data to store.

◆ delay

template<typename T >
std::deque<int> Map< T >::delay

Delay units of map data (bins).

◆ doppler

template<typename T >
std::deque<double> Map< T >::doppler

Doppler units of map data (Hz).

◆ maxPower

template<typename T >
double Map< T >::maxPower

Dynamic range of map (dB).

◆ nCols

template<typename T >
uint32_t Map< T >::nCols
private

Number of columns.

◆ noisePower

template<typename T >
double Map< T >::noisePower

Noise power of map (dB).

◆ nRows

template<typename T >
uint32_t Map< T >::nRows
private

Number of rows.


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