30 std::vector<std::vector<RealType>>
readPattern(
const std::string& name,
const std::string& datasetName);
49 _name(std::move(name))
86 [[nodiscard]] std::string
getName() const noexcept {
return _name; }
93 [[nodiscard]]
SimId getId() const noexcept {
return _id; }
116 void setName(std::string name)
noexcept { _name = std::move(name); }
192 const SimId id = 0) :
Antenna(name.data(), id), _alpha(alpha), _beta(beta), _gamma(gamma)
224 RealType wavelength)
const noexcept override;
270 Antenna(name.data(), id), _azscale(azscale), _elscale(elscale)
293 RealType wavelength)
const noexcept override;
336 Antenna(name.data(), id), _dimension(dimension)
359 RealType wavelength)
const noexcept override;
391 Antenna(name.data(), id), _diameter(diameter)
414 RealType wavelength)
const noexcept override;
453 XmlAntenna(
const std::string_view name,
const std::string_view filename,
const SimId id = 0) :
454 Antenna(name.data(), id), _azi_samples(std::make_unique<
interp::InterpSet>()),
455 _elev_samples(std::make_unique<
interp::InterpSet>())
457 loadAntennaDescription(filename);
480 RealType wavelength)
const override;
483 [[nodiscard]]
const std::string&
getFilename() const noexcept {
return _filename; }
504 void loadAntennaDescription(std::string_view filename);
506 std::string _filename;
508 std::unique_ptr<interp::InterpSet> _azi_samples;
509 std::unique_ptr<interp::InterpSet> _elev_samples;
530 H5Antenna(
const std::string_view name,
const std::string& filename,
const SimId id = 0) :
531 Antenna(name.data(), id), _pattern(
serial::readPattern(filename,
"antenna")), _filename(filename)
556 [[nodiscard]]
const std::string&
getFilename() const noexcept {
return _filename; }
559 [[nodiscard]]
const std::vector<std::vector<RealType>>&
getPattern() const noexcept {
return _pattern; }
562 std::vector<std::vector<RealType>> _pattern;
563 std::string _filename;
Thread-safe Meyers singleton for generating unique object IDs.
Abstract base class representing an antenna.
Antenna(Antenna &&)=default
Antenna(std::string name, const SimId id=0) noexcept
Constructs an Antenna object with the given name.
virtual RealType getGain(const math::SVec3 &angle, const math::SVec3 &refangle, RealType wavelength) const =0
Computes the gain of the antenna based on the input angle and reference angle.
SimId getId() const noexcept
Retrieves the unique ID of the antenna.
static RealType getAngle(const math::SVec3 &angle, const math::SVec3 &refangle) noexcept
Computes the angle between the input and reference angles.
Antenna & operator=(Antenna &&)=default
Antenna & operator=(const Antenna &)=delete
void setEfficiencyFactor(RealType loss) noexcept
Sets the efficiency factor of the antenna.
virtual ~Antenna()=default
RealType getEfficiencyFactor() const noexcept
Retrieves the efficiency factor of the antenna.
void setName(std::string name) noexcept
Sets the name of the antenna.
Antenna(const Antenna &)=delete
std::string getName() const noexcept
Retrieves the name of the antenna.
virtual RealType getNoiseTemperature(const math::SVec3 &) const noexcept
Computes the noise temperature of the antenna based on the angle.
Represents a Gaussian-shaped antenna gain pattern.
Gaussian & operator=(Gaussian &&)=delete
Gaussian(const Gaussian &)=delete
Gaussian & operator=(const Gaussian &)=delete
RealType getGain(const math::SVec3 &angle, const math::SVec3 &refangle, RealType wavelength) const noexcept override
Computes the gain of the Gaussian antenna.
Gaussian(Gaussian &&)=delete
RealType getAzimuthScale() const noexcept
Gets the azimuth scale factor.
void setAzimuthScale(RealType azscale) noexcept
Sets the azimuth scale factor of the Gaussian function.
Gaussian(const std::string_view name, const RealType azscale, const RealType elscale, const SimId id=0)
Constructs a Gaussian antenna with the given parameters.
void setElevationScale(RealType elscale) noexcept
Sets the elevation scale factor of the Gaussian function.
RealType getElevationScale() const noexcept
Gets the elevation scale factor.
~Gaussian() override=default
Represents an antenna whose gain pattern is loaded from a HDF5 file.
H5Antenna & operator=(const H5Antenna &)=delete
H5Antenna & operator=(H5Antenna &&)=delete
~H5Antenna() override=default
const std::string & getFilename() const noexcept
Gets the filename of the antenna description.
H5Antenna(H5Antenna &&)=delete
H5Antenna(const H5Antenna &)=delete
RealType getGain(const math::SVec3 &angle, const math::SVec3 &refangle, RealType) const override
Computes the gain of the antenna based on the input angle and reference angle.
H5Antenna(const std::string_view name, const std::string &filename, const SimId id=0)
Constructs a H5Antenna with the specified name and gain pattern file.
const std::vector< std::vector< RealType > > & getPattern() const noexcept
Gets the gain pattern object.
Represents an isotropic antenna with uniform gain in all directions.
Isotropic(const std::string_view name, const SimId id=0)
Constructs an Isotropic antenna with the given name.
Isotropic & operator=(Isotropic &&)=delete
~Isotropic() override=default
Isotropic & operator=(const Isotropic &)=delete
RealType getGain(const math::SVec3 &, const math::SVec3 &, RealType) const override
Computes the gain of the isotropic antenna.
Isotropic(Isotropic &&)=delete
Isotropic(const Isotropic &)=delete
Represents a parabolic reflector antenna.
Parabolic(const Parabolic &)=delete
~Parabolic() override=default
Parabolic & operator=(const Parabolic &)=delete
Parabolic(const std::string_view name, const RealType diameter, const SimId id=0)
Constructs a Parabolic antenna with the given diameter.
RealType getDiameter() const noexcept
Gets the diameter of the parabolic reflector.
Parabolic & operator=(Parabolic &&)=delete
void setDiameter(RealType diameter) noexcept
Sets the diameter of the parabolic reflector.
Parabolic(Parabolic &&)=delete
RealType getGain(const math::SVec3 &angle, const math::SVec3 &refangle, RealType wavelength) const noexcept override
Computes the gain of the parabolic antenna.
Represents a sinc function-based antenna gain pattern.
RealType getAlpha() const noexcept
Gets the alpha parameter of the sinc function.
RealType getGain(const math::SVec3 &angle, const math::SVec3 &refangle, RealType wavelength) const noexcept override
Computes the gain of the sinc antenna based on the input parameters.
Sinc & operator=(Sinc &&)=delete
Sinc & operator=(const Sinc &)=delete
void setGamma(RealType gamma) noexcept
Sets the gamma parameter of the sinc function.
RealType getGamma() const noexcept
Gets the gamma parameter of the sinc function.
Sinc(const std::string_view name, const RealType alpha, const RealType beta, const RealType gamma, const SimId id=0)
Constructs a Sinc antenna with the given parameters.
void setBeta(RealType beta) noexcept
Sets the beta parameter of the sinc function.
Sinc(const Sinc &)=delete
RealType getBeta() const noexcept
Gets the beta parameter of the sinc function.
void setAlpha(RealType alpha) noexcept
Sets the alpha parameter of the sinc function.
Represents a square horn antenna.
SquareHorn & operator=(SquareHorn &&)=delete
RealType getGain(const math::SVec3 &angle, const math::SVec3 &refangle, RealType wavelength) const noexcept override
Computes the gain of the square horn antenna.
RealType getDimension() const noexcept
Gets the dimension of the square horn.
SquareHorn(SquareHorn &&)=delete
void setDimension(RealType dimension) noexcept
Sets the dimension of the square horn.
SquareHorn & operator=(const SquareHorn &)=delete
SquareHorn(const std::string_view name, const RealType dimension, const SimId id=0)
Constructs a SquareHorn antenna with the given dimension.
~SquareHorn() override=default
SquareHorn(const SquareHorn &)=delete
Represents an antenna whose gain pattern is defined by an XML file.
XmlAntenna & operator=(const XmlAntenna &)=delete
RealType getMaxGain() const noexcept
Gets the maximum gain of the antenna.
XmlAntenna(XmlAntenna &&)=delete
XmlAntenna & operator=(XmlAntenna &&)=delete
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.
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.
~XmlAntenna() override=default
const interp::InterpSet * getAzimuthSamples() const noexcept
Gets the interpolation set for azimuth gain samples.
const interp::InterpSet * getElevationSamples() const noexcept
Gets the interpolation set for elevation gain samples.
const std::string & getFilename() const noexcept
Gets the filename of the antenna description.
XmlAntenna(const XmlAntenna &)=delete
Wrapper class for managing interpolation sets using smart pointers.
A class representing a vector in spherical coordinates.
Global configuration file for the project.
double RealType
Type for real numbers.
Classes and operations for 3D geometry.
Header file for the interpolation of sets of data.
Header file for the logging system.
std::vector< std::vector< RealType > > readPattern(const std::string &name, const std::string &datasetName)
Reads a 2D pattern dataset from an HDF5 file.
uint64_t SimId
64-bit Unique Simulation ID.
ObjectType
Categorizes objects for ID generation.