FERS 1.0.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
params Namespace Reference

Classes

class  Parameters
 Struct to hold simulation parameters. More...
 

Enumerations

enum class  CoordinateFrame { ENU , UTM , ECEF }
 Defines the coordinate systems supported for scenario definition. More...
 
enum class  RotationAngleUnit { Degrees , Radians }
 Defines the units used at external rotation-path boundaries. More...
 

Functions

RealType c () noexcept
 Get the speed of light.
 
RealType boltzmannK () noexcept
 Get the Boltzmann constant.
 
RealType startTime () noexcept
 Get the start time for the simulation.
 
RealType endTime () noexcept
 Get the end time for the simulation.
 
RealType simSamplingRate () noexcept
 Get the simulation sampling rate.
 
RealType rate () noexcept
 Get the rendering sample rate.
 
unsigned randomSeed () noexcept
 Get the random seed.
 
unsigned adcBits () noexcept
 Get the ADC quantization bits.
 
unsigned renderFilterLength () noexcept
 Get the render filter length.
 
unsigned renderThreads () noexcept
 Get the number of worker threads.
 
unsigned oversampleRatio () noexcept
 Get the oversampling ratio.
 
void setC (RealType cValue) noexcept
 Set the speed of light.
 
void setTime (const RealType startTime, const RealType endTime) noexcept
 Set the start and end times for the simulation.
 
void setSimSamplingRate (const RealType rate) noexcept
 Set the simulation sampling rate.
 
void setRate (RealType rateValue)
 Set the rendering sample rate.
 
void setRandomSeed (const unsigned seed) noexcept
 Set the random seed.
 
void setAdcBits (const unsigned bits) noexcept
 Set the ADC quantization bits.
 
void setOversampleRatio (unsigned ratio)
 Set the oversampling ratio.
 
void setOrigin (const double lat, const double lon, const double alt) noexcept
 Set the geodetic origin for the KML generator.
 
double originLatitude () noexcept
 
double originLongitude () noexcept
 
double originAltitude () noexcept
 
std::expected< void, std::string > setThreads (const unsigned threads) noexcept
 Set the number of worker threads.
 
void setCoordinateSystem (const CoordinateFrame frame, const int zone, const bool north) noexcept
 Set the coordinate system for the scenario.
 
CoordinateFrame coordinateFrame () noexcept
 
RotationAngleUnit rotationAngleUnit () noexcept
 
int utmZone () noexcept
 
bool utmNorthHemisphere () noexcept
 
void setRotationAngleUnit (const RotationAngleUnit unit) noexcept
 
constexpr std::string_view rotationAngleUnitToken (const RotationAngleUnit unit) noexcept
 
std::optional< RotationAngleUnitrotationAngleUnitFromToken (const std::string_view token) noexcept
 
 NLOHMANN_JSON_SERIALIZE_ENUM (CoordinateFrame, {{CoordinateFrame::ENU, "ENU"}, {CoordinateFrame::UTM, "UTM"}, {CoordinateFrame::ECEF, "ECEF"}}) NLOHMANN_JSON_SERIALIZE_ENUM(RotationAngleUnit
 

Variables

Parameters params
 

Enumeration Type Documentation

◆ CoordinateFrame

enum class params::CoordinateFrame
strong

Defines the coordinate systems supported for scenario definition.

Enumerator
ENU 

East-North-Up local tangent plane (default)

UTM 

Universal Transverse Mercator.

ECEF 

Earth-Centered, Earth-Fixed.

Definition at line 29 of file parameters.h.

30 {
31 ENU, ///< East-North-Up local tangent plane (default)
32 UTM, ///< Universal Transverse Mercator
33 ECEF ///< Earth-Centered, Earth-Fixed
34 };
@ UTM
Universal Transverse Mercator.
@ ENU
East-North-Up local tangent plane (default)
@ ECEF
Earth-Centered, Earth-Fixed.

◆ RotationAngleUnit

enum class params::RotationAngleUnit
strong

Defines the units used at external rotation-path boundaries.

Enumerator
Degrees 

Compass azimuth and elevation expressed in degrees.

Radians 

Compass azimuth and elevation expressed in radians.

Definition at line 40 of file parameters.h.

41 {
42 Degrees, ///< Compass azimuth and elevation expressed in degrees
43 Radians ///< Compass azimuth and elevation expressed in radians
44 };

Function Documentation

◆ adcBits()

unsigned params::adcBits ( )
noexcept

Get the ADC quantization bits.

Returns
Number of ADC quantization bits.

Definition at line 133 of file parameters.h.

133{ return params.adc_bits; }

Referenced by processing::quantizeAndScaleWindow().

+ Here is the caller graph for this function:

◆ boltzmannK()

RealType params::boltzmannK ( )
noexcept

Get the Boltzmann constant.

Returns
The Boltzmann constant.

Definition at line 97 of file parameters.h.

97{ return params.boltzmann_k; }

Referenced by processing::applyThermalNoise().

+ Here is the caller graph for this function:

◆ c()

RealType params::c ( )
noexcept

Get the speed of light.

Returns
The speed of light in meters per second.

Definition at line 91 of file parameters.h.

91{ return params.c; }

Referenced by simulation::calculateDirectPathContribution(), simulation::calculatePreviewLinks(), simulation::calculateReflectedPathContribution(), fers_get_antenna_pattern(), simulation::solveRe(), and simulation::solveReDirect().

+ Here is the caller graph for this function:

◆ coordinateFrame()

CoordinateFrame params::coordinateFrame ( )
noexcept

Definition at line 284 of file parameters.h.

284{ return params.coordinate_frame; }

◆ endTime()

RealType params::endTime ( )
noexcept

Get the end time for the simulation.

Returns
End time for the simulation.

Definition at line 109 of file parameters.h.

109{ return params.end; }

Referenced by fers_signal::from_json(), radar::Receiver::getWindowCount(), core::SimulationEngine::handleRxPulsedWindowEnd(), core::SimulationEngine::handleTxPulsedStart(), serial::json_to_world(), core::OutputMetadataCollector::OutputMetadataCollector(), radar::processRawSchedule(), core::SimulationEngine::run(), core::World::scheduleInitialEvents(), and setTime().

+ Here is the caller graph for this function:

◆ NLOHMANN_JSON_SERIALIZE_ENUM()

params::NLOHMANN_JSON_SERIALIZE_ENUM ( CoordinateFrame  ,
{{CoordinateFrame::ENU, "ENU"}, {CoordinateFrame::UTM, "UTM"}, {CoordinateFrame::ECEF, "ECEF"}}   
)

References ECEF, ENU, and UTM.

◆ originAltitude()

double params::originAltitude ( )
noexcept

Definition at line 252 of file parameters.h.

252{ return params.origin_altitude; }

◆ originLatitude()

double params::originLatitude ( )
noexcept

Definition at line 248 of file parameters.h.

248{ return params.origin_latitude; }

◆ originLongitude()

double params::originLongitude ( )
noexcept

Definition at line 250 of file parameters.h.

250{ return params.origin_longitude; }

◆ oversampleRatio()

unsigned params::oversampleRatio ( )
noexcept

Get the oversampling ratio.

Returns
The oversampling ratio.

Definition at line 151 of file parameters.h.

151{ return params.oversample_ratio; }

Referenced by processing::pipeline::applyDownsamplingAndQuantization(), processing::applyThermalNoise(), fers_signal::downsample(), serial::json_to_world(), fers_signal::Signal::load(), core::OutputMetadataCollector::OutputMetadataCollector(), core::SimulationEngine::processCwPhysics(), processing::renderWindow(), processing::runPulsedFinalizer(), radar::Transmitter::setPrf(), radar::Receiver::setWindowProperties(), and fers_signal::upsample().

+ Here is the caller graph for this function:

◆ randomSeed()

unsigned params::randomSeed ( )
noexcept

Get the random seed.

Returns
The current random seed value.

Definition at line 127 of file parameters.h.

127{ return params.random_seed.value_or(0); }

◆ rate()

RealType params::rate ( )
noexcept

Get the rendering sample rate.

Returns
The rendering sample rate.

Definition at line 121 of file parameters.h.

121{ return params.rate; }

Referenced by serial::addChunkToFile(), processing::applyThermalNoise(), processing::pipeline::exportCwToHdf5(), noise::ClockModelGenerator::getSample(), serial::json_to_world(), core::OutputMetadataCollector::OutputMetadataCollector(), core::SimulationEngine::processCwPhysics(), processing::renderWindow(), processing::runPulsedFinalizer(), radar::Transmitter::setPrf(), setSimSamplingRate(), and radar::Receiver::setWindowProperties().

+ Here is the caller graph for this function:

◆ renderFilterLength()

unsigned params::renderFilterLength ( )
noexcept

Get the render filter length.

Returns
The length of the render filter.

Definition at line 139 of file parameters.h.

139{ return params.filter_length; }

Referenced by fers_signal::Signal::render().

+ Here is the caller graph for this function:

◆ renderThreads()

unsigned params::renderThreads ( )
noexcept

Get the number of worker threads.

Returns
The number of worker threads.

Definition at line 145 of file parameters.h.

145{ return params.render_threads; }

Referenced by fers_run_simulation().

+ Here is the caller graph for this function:

◆ rotationAngleUnit()

RotationAngleUnit params::rotationAngleUnit ( )
noexcept

Definition at line 286 of file parameters.h.

286{ return params.rotation_angle_unit; }

Referenced by math::from_json(), serial::xml_serializer_utils::serializeRotation(), math::to_json(), and serial::update_platform_paths_from_json().

+ Here is the caller graph for this function:

◆ rotationAngleUnitFromToken()

std::optional< RotationAngleUnit > params::rotationAngleUnitFromToken ( const std::string_view  token)
noexcept

Definition at line 299 of file parameters.h.

300 {
301 if (token == "deg")
302 {
303 return RotationAngleUnit::Degrees;
304 }
305 if (token == "rad")
306 {
307 return RotationAngleUnit::Radians;
308 }
309 return std::nullopt;
310 }

References Degrees, and Radians.

Referenced by serial::xml_parser_utils::parseParameters().

+ Here is the caller graph for this function:

◆ rotationAngleUnitToken()

constexpr std::string_view params::rotationAngleUnitToken ( const RotationAngleUnit  unit)
constexprnoexcept

Definition at line 294 of file parameters.h.

295 {
296 return unit == RotationAngleUnit::Radians ? "rad" : "deg";
297 }

References Radians.

Referenced by serial::kml_generator_utils::generateDirectionalAntennaKml(), and serial::xml_serializer_utils::serializeParameters().

+ Here is the caller graph for this function:

◆ setAdcBits()

void params::setAdcBits ( const unsigned  bits)
noexcept

Set the ADC quantization bits.

Parameters
bitsThe new ADC quantization bits.

Definition at line 213 of file parameters.h.

214 {
215 params.adc_bits = bits;
216 LOG(logging::Level::DEBUG, "ADC quantization bits set to: {}", bits);
217 }
#define LOG(level,...)
Definition logging.h:19
@ DEBUG
Debug level for general debugging information.

References logging::DEBUG, and LOG.

◆ setC()

void params::setC ( RealType  cValue)
noexcept

Set the speed of light.

Parameters
cValueThe new speed of light.

Definition at line 157 of file parameters.h.

158 {
159 params.c = cValue;
160 LOG(logging::Level::INFO, "Propagation speed (c) set to: {:.5f}", cValue);
161 }
@ INFO
Info level for informational messages.

References logging::INFO, and LOG.

◆ setCoordinateSystem()

void params::setCoordinateSystem ( const CoordinateFrame  frame,
const int  zone,
const bool  north 
)
noexcept

Set the coordinate system for the scenario.

Parameters
frameThe coordinate frame (ENU, UTM, ECEF).
zoneThe UTM zone, if applicable.
northThe UTM hemisphere (true for North), if applicable.

Definition at line 277 of file parameters.h.

278 {
279 params.coordinate_frame = frame;
280 params.utm_zone = zone;
281 params.utm_north_hemisphere = north;
282 }

◆ setOrigin()

void params::setOrigin ( const double  lat,
const double  lon,
const double  alt 
)
noexcept

Set the geodetic origin for the KML generator.

Parameters
latThe latitude of the origin.
lonThe longitude of the origin.
altThe altitude of the origin (MSL).

Definition at line 240 of file parameters.h.

241 {
242 params.origin_latitude = lat;
243 params.origin_longitude = lon;
244 params.origin_altitude = alt;
245 LOG(logging::Level::INFO, "Origin set to lat: {}, lon: {}, alt: {}", lat, lon, alt);
246 }

References logging::INFO, and LOG.

◆ setOversampleRatio()

void params::setOversampleRatio ( unsigned  ratio)

Set the oversampling ratio.

Parameters
ratioThe new oversampling ratio.
Exceptions
std::runtime_errorif the ratio is zero.

Definition at line 224 of file parameters.h.

225 {
226 if (ratio == 0)
227 {
228 throw std::runtime_error("Oversample ratio must be >= 1");
229 }
230 params.oversample_ratio = ratio;
231 LOG(logging::Level::DEBUG, "Oversampling enabled with ratio: {}", ratio);
232 }

References logging::DEBUG, and LOG.

◆ setRandomSeed()

void params::setRandomSeed ( const unsigned  seed)
noexcept

Set the random seed.

Parameters
seedThe new random seed value.

Definition at line 203 of file parameters.h.

204 {
205 params.random_seed = seed;
206 LOG(logging::Level::DEBUG, "Random seed set to: {}", seed);
207 }

References logging::DEBUG, and LOG.

◆ setRate()

void params::setRate ( RealType  rateValue)

Set the rendering sample rate.

Parameters
rateValueThe new sample rate for rendering.

Definition at line 189 of file parameters.h.

190 {
191 if (rateValue <= 0)
192 {
193 throw std::runtime_error("Sampling rate must be > 0");
194 }
195 params.rate = rateValue;
196 LOG(logging::Level::DEBUG, "Sample rate set to: {:.5f}", rateValue);
197 }

References logging::DEBUG, and LOG.

◆ setRotationAngleUnit()

void params::setRotationAngleUnit ( const RotationAngleUnit  unit)
noexcept

Definition at line 292 of file parameters.h.

292{ params.rotation_angle_unit = unit; }

◆ setSimSamplingRate()

void params::setSimSamplingRate ( const RealType  rate)
noexcept

Set the simulation sampling rate.

Parameters
rateThe new simulation sampling rate.

Definition at line 179 of file parameters.h.

180 {
181 params.sim_sampling_rate = rate;
182 LOG(logging::Level::DEBUG, "Simulation sampling rate set to: {:.5f} Hz", rate);
183 }
RealType rate() noexcept
Get the rendering sample rate.
Definition parameters.h:121

References logging::DEBUG, LOG, and rate().

+ Here is the call graph for this function:

◆ setThreads()

std::expected< void, std::string > params::setThreads ( const unsigned  threads)
noexcept

Set the number of worker threads.

Parameters
threadsThe number of worker threads.
Returns
A std::expected<void, std::string> indicating success or an error message if the number of threads is invalid.

Definition at line 260 of file parameters.h.

261 {
262 if (threads == 0)
263 {
264 return std::unexpected("Thread count must be >= 1");
265 }
266 params.render_threads = threads;
267 LOG(logging::Level::INFO, "Number of worker threads set to: {}", threads);
268 return {};
269 }

References logging::INFO, and LOG.

Referenced by fers_set_thread_count().

+ Here is the caller graph for this function:

◆ setTime()

void params::setTime ( const RealType  startTime,
const RealType  endTime 
)
noexcept

Set the start and end times for the simulation.

Parameters
startTimeStart time for the simulation.
endTimeEnd time for the simulation.

Definition at line 168 of file parameters.h.

169 {
170 params.start = startTime;
171 params.end = endTime;
172 LOG(logging::Level::INFO, "Simulation time set from {:.5f} to {:.5f} seconds", startTime, endTime);
173 }
RealType endTime() noexcept
Get the end time for the simulation.
Definition parameters.h:109
RealType startTime() noexcept
Get the start time for the simulation.
Definition parameters.h:103

References endTime(), logging::INFO, LOG, and startTime().

+ Here is the call graph for this function:

◆ simSamplingRate()

RealType params::simSamplingRate ( )
noexcept

Get the simulation sampling rate.

Returns
The simulation sampling rate.

Definition at line 115 of file parameters.h.

115{ return params.sim_sampling_rate; }

Referenced by simulation::calculateResponse().

+ Here is the caller graph for this function:

◆ startTime()

RealType params::startTime ( )
noexcept

Get the start time for the simulation.

Returns
Start time for the simulation.

Definition at line 103 of file parameters.h.

103{ return params.start; }

Referenced by processing::pipeline::applyPulsedInterference(), processing::pipeline::exportCwToHdf5(), fers_signal::from_json(), radar::Receiver::getWindowCount(), serial::json_to_world(), core::OutputMetadataCollector::OutputMetadataCollector(), core::SimulationEngine::processCwPhysics(), radar::processRawSchedule(), core::World::scheduleInitialEvents(), and setTime().

+ Here is the caller graph for this function:

◆ utmNorthHemisphere()

bool params::utmNorthHemisphere ( )
noexcept

Definition at line 290 of file parameters.h.

290{ return params.utm_north_hemisphere; }

◆ utmZone()

int params::utmZone ( )
noexcept

Definition at line 288 of file parameters.h.

288{ return params.utm_zone; }

Variable Documentation

◆ params