FERS 0.1.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
antenna::XmlAntenna Class Referencefinal

Represents an antenna whose gain pattern is defined by an XML file. More...

#include "antenna_factory.h"

+ Inheritance diagram for antenna::XmlAntenna:
+ Collaboration diagram for antenna::XmlAntenna:

Public Types

enum class  AxisSymmetry : std::uint8_t { Mirrored , None }
 Symmetry mode for one-dimensional XML antenna gain axes. More...
 

Public Member Functions

 XmlAntenna (const std::string_view name, const std::string_view filename, const SimId id=0)
 Constructs an XmlAntenna with the specified name and XML configuration file.
 
 ~XmlAntenna () override=default
 
 XmlAntenna (const XmlAntenna &)=delete
 
XmlAntennaoperator= (const XmlAntenna &)=delete
 
 XmlAntenna (XmlAntenna &&)=delete
 
XmlAntennaoperator= (XmlAntenna &&)=delete
 
RealType getGain (const math::SVec3 &angle, const math::SVec3 &refangle, RealType wavelength) const override
 Computes the gain of the antenna based on the input angle and reference angle.
 
const std::string & getFilename () const noexcept
 Gets the filename of the antenna description.
 
RealType getMaxGain () const noexcept
 Gets the maximum gain of the antenna.
 
const interp::InterpSetgetAzimuthSamples () const noexcept
 Gets the interpolation set for azimuth gain samples.
 
const interp::InterpSetgetElevationSamples () const noexcept
 Gets the interpolation set for elevation gain samples.
 
RealType getEfficiencyFactor () const noexcept
 Retrieves the efficiency factor of the antenna.
 
std::string getName () const noexcept
 Retrieves the name of the antenna.
 
SimId getId () const noexcept
 Retrieves the unique ID of the antenna.
 
virtual RealType getNoiseTemperature (const math::SVec3 &) const noexcept
 Computes the noise temperature of the antenna based on the angle.
 
void setEfficiencyFactor (RealType loss) noexcept
 Sets the efficiency factor of the antenna.
 
void setName (std::string name) noexcept
 Sets the name of the antenna.
 

Static Protected Member Functions

static RealType getAngle (const math::SVec3 &angle, const math::SVec3 &refangle) noexcept
 Computes the angle between the input and reference angles.
 

Detailed Description

Represents an antenna whose gain pattern is defined by an XML file.

This class models an antenna where the gain pattern is read from an XML file.

Definition at line 437 of file antenna_factory.h.

Member Enumeration Documentation

◆ AxisSymmetry

Symmetry mode for one-dimensional XML antenna gain axes.

Enumerator
Mirrored 

Mirror positive-axis samples onto negative angles.

None 

Use the axis samples exactly as provided.

Definition at line 441 of file antenna_factory.h.

442 {
443 Mirrored, ///< Mirror positive-axis samples onto negative angles.
444 None, ///< Use the axis samples exactly as provided.
445 };
@ Mirrored
Mirror positive-axis samples onto negative angles.
@ None
Use the axis samples exactly as provided.

Constructor & Destructor Documentation

◆ XmlAntenna() [1/3]

antenna::XmlAntenna::XmlAntenna ( const std::string_view  name,
const std::string_view  filename,
const SimId  id = 0 
)

Constructs an XmlAntenna with the specified name and XML configuration file.

The constructor loads the azimuth and elevation gain patterns from the provided XML file.

Parameters
nameThe name of the antenna.
filenameThe path to the XML file containing the antenna's gain pattern data.

Definition at line 455 of file antenna_factory.h.

455 :
456 Antenna(name.data(), id), _azi_samples(std::make_unique<interp::InterpSet>()),
457 _elev_samples(std::make_unique<interp::InterpSet>())
458 {
459 loadAntennaDescription(filename);
460 }
Antenna(std::string name, const SimId id=0) noexcept
Constructs an Antenna object with the given name.
math::Vec3 max

◆ ~XmlAntenna()

antenna::XmlAntenna::~XmlAntenna ( )
overridedefault

◆ XmlAntenna() [2/3]

antenna::XmlAntenna::XmlAntenna ( const XmlAntenna )
delete

◆ XmlAntenna() [3/3]

antenna::XmlAntenna::XmlAntenna ( XmlAntenna &&  )
delete

Member Function Documentation

◆ getAngle()

RealType antenna::Antenna::getAngle ( const math::SVec3 angle,
const math::SVec3 refangle 
)
staticprotectednoexceptinherited

Computes the angle between the input and reference angles.

Parameters
angleThe input angle.
refangleThe reference angle.
Returns
The computed angle.

Definition at line 356 of file antenna_factory.cpp.

357 {
359 normangle.length = 1;
360 return std::acos(dotProduct(Vec3(normangle), Vec3(refangle)));
361 }
A class representing a vector in spherical coordinates.
A class representing a vector in rectangular coordinates.
RealType length() const noexcept
Calculates the length (magnitude) of the vector.
RealType dotProduct(const Vec3 &a, const Vec3 &b) noexcept
Computes the dot product of two Vec3 vectors.

References math::SVec3::length.

◆ getAzimuthSamples()

const interp::InterpSet * antenna::XmlAntenna::getAzimuthSamples ( ) const
noexcept

Gets the interpolation set for azimuth gain samples.

Definition at line 491 of file antenna_factory.h.

491{ return _azi_samples.get(); }

◆ getEfficiencyFactor()

RealType antenna::Antenna::getEfficiencyFactor ( ) const
noexceptinherited

Retrieves the efficiency factor of the antenna.

Returns
The efficiency factor of the antenna.

Definition at line 80 of file antenna_factory.h.

80{ return _loss_factor; }

Referenced by antenna::Isotropic::getGain(), getGain(), and antenna::H5Antenna::getGain().

+ Here is the caller graph for this function:

◆ getElevationSamples()

const interp::InterpSet * antenna::XmlAntenna::getElevationSamples ( ) const
noexcept

Gets the interpolation set for elevation gain samples.

Definition at line 494 of file antenna_factory.h.

494{ return _elev_samples.get(); }

◆ getFilename()

const std::string & antenna::XmlAntenna::getFilename ( ) const
noexcept

Gets the filename of the antenna description.

Definition at line 485 of file antenna_factory.h.

485{ return _filename; }

◆ getGain()

RealType antenna::XmlAntenna::getGain ( const math::SVec3 angle,
const math::SVec3 refangle,
RealType  wavelength 
) const
overridevirtual

Computes the gain of the antenna based on the input angle and reference angle.

Parameters
angleThe angle at which the gain is to be computed.
refangleThe reference angle.
wavelengthThe wavelength of the signal (not used in this antenna type).
Returns
The gain of the antenna at the specified angle.
Exceptions
std::runtime_errorIf gain values cannot be retrieved from the interpolation sets.

Implements antenna::Antenna.

Definition at line 401 of file antenna_factory.cpp.

402 {
404
405 const std::optional<RealType> azi_value =
406 lookupAxisGain(_azi_samples.get(), delta_angle.azimuth, _azi_symmetry);
407
408 if (const std::optional<RealType> elev_value =
409 lookupAxisGain(_elev_samples.get(), delta_angle.elevation, _elev_symmetry);
411 {
412 return *azi_value * *elev_value * _max_gain * getEfficiencyFactor();
413 }
414
415 LOG(Level::FATAL, "Could not get antenna gain value");
416 throw std::runtime_error("Could not get antenna gain value");
417 }
RealType getEfficiencyFactor() const noexcept
Retrieves the efficiency factor of the antenna.
#define LOG(level,...)
Definition logging.h:19

References math::SVec3::azimuth, math::SVec3::elevation, antenna::Antenna::getEfficiencyFactor(), and LOG.

+ Here is the call graph for this function:

◆ getId()

SimId antenna::Antenna::getId ( ) const
noexceptinherited

Retrieves the unique ID of the antenna.

Returns
The antenna SimId.

Definition at line 94 of file antenna_factory.h.

94{ return _id; }

Referenced by radar::to_json().

+ Here is the caller graph for this function:

◆ getMaxGain()

RealType antenna::XmlAntenna::getMaxGain ( ) const
noexcept

Gets the maximum gain of the antenna.

Definition at line 488 of file antenna_factory.h.

488{ return _max_gain; }

◆ getName()

std::string antenna::Antenna::getName ( ) const
noexceptinherited

Retrieves the name of the antenna.

Returns
The name of the antenna.

Definition at line 87 of file antenna_factory.h.

87{ return _name; }

◆ getNoiseTemperature()

virtual RealType antenna::Antenna::getNoiseTemperature ( const math::SVec3 ) const
virtualnoexceptinherited

Computes the noise temperature of the antenna based on the angle.

Parameters
angleThe angle at which the noise temperature is to be computed.
Returns
The noise temperature of the antenna.

Definition at line 103 of file antenna_factory.h.

103{ return 0; }

◆ operator=() [1/2]

XmlAntenna & antenna::XmlAntenna::operator= ( const XmlAntenna )
delete

◆ operator=() [2/2]

XmlAntenna & antenna::XmlAntenna::operator= ( XmlAntenna &&  )
delete

◆ setEfficiencyFactor()

void antenna::Antenna::setEfficiencyFactor ( RealType  loss)
noexceptinherited

Sets the efficiency factor of the antenna.

Parameters
lossThe new efficiency factor.

Definition at line 347 of file antenna_factory.cpp.

348 {
349 if (loss > 1)
350 {
351 LOG(Level::INFO, "Using greater than unity antenna efficiency.");
352 }
353 _loss_factor = loss;
354 }

References LOG.

◆ setName()

void antenna::Antenna::setName ( std::string  name)
noexceptinherited

Sets the name of the antenna.

Parameters
nameThe new name of the antenna.

Definition at line 117 of file antenna_factory.h.

117{ _name = std::move(name); }

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