FERS 1.0.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
antenna_factory.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-only
2//
3// Copyright (c) 2006-2008 Marc Brooker and Michael Inggs
4// Copyright (c) 2008-present FERS Contributors (see AUTHORS.md).
5//
6// See the GNU GPLv2 LICENSE file in the FERS project root for more information.
7
8/**
9 * @file antenna_factory.h
10 * @brief Header file defining various types of antennas and their gain patterns.
11 */
12
13#pragma once
14
15#include <memory>
16#include <optional>
17#include <string>
18#include <string_view>
19#include <utility>
20#include <vector>
21
22#include "core/config.h"
23#include "core/logging.h"
24#include "core/sim_id.h"
26#include "math/geometry_ops.h"
27
28namespace serial
29{
30 std::vector<std::vector<RealType>> readPattern(const std::string& name, const std::string& datasetName);
31}
32
33namespace antenna
34{
35 /**
36 * @class Antenna
37 * @brief Abstract base class representing an antenna.
38 */
39 class Antenna
40 {
41 public:
42 /**
43 * @brief Constructs an Antenna object with the given name.
44 *
45 * @param name The name of the antenna.
46 */
47 explicit Antenna(std::string name, const SimId id = 0) noexcept :
48 _loss_factor(1), _id(id == 0 ? SimIdGenerator::instance().generateId(ObjectType::Antenna) : id),
49 _name(std::move(name))
50 {
51 }
52
53 virtual ~Antenna() = default;
54
55 Antenna(const Antenna&) = delete;
56
57 Antenna& operator=(const Antenna&) = delete;
58
59 Antenna(Antenna&&) = default;
60
61 Antenna& operator=(Antenna&&) = default;
62
63 /**
64 * @brief Computes the gain of the antenna based on the input angle and reference angle.
65 *
66 * @param angle The angle at which the gain is to be computed.
67 * @param refangle The reference angle.
68 * @param wavelength The wavelength of the signal.
69 * @return The gain of the antenna at the specified angle and wavelength.
70 */
71 [[nodiscard]] virtual RealType getGain(const math::SVec3& angle, const math::SVec3& refangle,
72 RealType wavelength) const = 0;
73
74 /**
75 * @brief Retrieves the efficiency factor of the antenna.
76 *
77 * @return The efficiency factor of the antenna.
78 */
79 [[nodiscard]] RealType getEfficiencyFactor() const noexcept { return _loss_factor; }
80
81 /**
82 * @brief Retrieves the name of the antenna.
83 *
84 * @return The name of the antenna.
85 */
86 [[nodiscard]] std::string getName() const noexcept { return _name; }
87
88 /**
89 * @brief Retrieves the unique ID of the antenna.
90 *
91 * @return The antenna SimId.
92 */
93 [[nodiscard]] SimId getId() const noexcept { return _id; }
94
95 /**
96 * @brief Computes the noise temperature of the antenna based on the angle.
97 *
98 * @param angle The angle at which the noise temperature is to be computed.
99 * @return The noise temperature of the antenna.
100 */
101 // TODO: Implement noise temperature calculation
102 [[nodiscard]] virtual RealType getNoiseTemperature(const math::SVec3& /*angle*/) const noexcept { return 0; }
103
104 /**
105 * @brief Sets the efficiency factor of the antenna.
106 *
107 * @param loss The new efficiency factor.
108 */
109 void setEfficiencyFactor(RealType loss) noexcept;
110
111 /**
112 * @brief Sets the name of the antenna.
113 *
114 * @param name The new name of the antenna.
115 */
116 void setName(std::string name) noexcept { _name = std::move(name); }
117
118 protected:
119 /**
120 * @brief Computes the angle between the input and reference angles.
121 *
122 * @param angle The input angle.
123 * @param refangle The reference angle.
124 * @return The computed angle.
125 */
126 static RealType getAngle(const math::SVec3& angle, const math::SVec3& refangle) noexcept;
127
128 private:
129 RealType _loss_factor; ///< Efficiency factor of the antenna.
130 SimId _id; ///< Unique ID for this antenna.
131 std::string _name; ///< Name of the antenna.
132 };
133
134 /**
135 * @class Isotropic
136 * @brief Represents an isotropic antenna with uniform gain in all directions.
137 *
138 * This class models an ideal isotropic antenna, which has a directivity of 1 (0 dB).
139 */
140 class Isotropic final : public Antenna
141 {
142 public:
143 /**
144 * @brief Constructs an Isotropic antenna with the given name.
145 *
146 * @param name The name of the antenna.
147 */
148 explicit Isotropic(const std::string_view name, const SimId id = 0) : Antenna(name.data(), id) {}
149
150 ~Isotropic() override = default;
151
152 Isotropic(const Isotropic&) = delete;
153
154 Isotropic& operator=(const Isotropic&) = delete;
155
156 Isotropic(Isotropic&&) = delete;
157
159
160 /**
161 * @brief Computes the gain of the isotropic antenna.
162 *
163 * @return The gain of the antenna, which is equal to the efficiency factor.
164 */
165 [[nodiscard]] RealType getGain(const math::SVec3& /*angle*/, const math::SVec3& /*refangle*/,
166 RealType /*wavelength*/) const override
167 {
168 // David Young: Isotropic antennas have a directivity of 1 (or 0 dB),
169 // therefore, the gain of the antenna is the efficiency factor
170 return getEfficiencyFactor();
171 }
172 };
173
174 /**
175 * @class Sinc
176 * @brief Represents a sinc function-based antenna gain pattern.
177 *
178 * This antenna has a gain pattern defined by a sinc function, with customizable parameters.
179 */
180 class Sinc final : public Antenna
181 {
182 public:
183 /**
184 * @brief Constructs a Sinc antenna with the given parameters.
185 *
186 * @param name The name of the antenna.
187 * @param alpha The alpha parameter.
188 * @param beta The beta parameter.
189 * @param gamma The gamma parameter.
190 */
191 Sinc(const std::string_view name, const RealType alpha, const RealType beta, const RealType gamma,
192 const SimId id = 0) : Antenna(name.data(), id), _alpha(alpha), _beta(beta), _gamma(gamma)
193 {
194 }
195
196 ~Sinc() override = default;
197
198 Sinc(const Sinc&) = delete;
199
200 Sinc& operator=(const Sinc&) = delete;
201
202 Sinc(Sinc&&) = delete;
203
204 Sinc& operator=(Sinc&&) = delete;
205
206 /** @brief Gets the alpha parameter of the sinc function. */
207 [[nodiscard]] RealType getAlpha() const noexcept { return _alpha; }
208
209 /** @brief Gets the beta parameter of the sinc function. */
210 [[nodiscard]] RealType getBeta() const noexcept { return _beta; }
211
212 /** @brief Gets the gamma parameter of the sinc function. */
213 [[nodiscard]] RealType getGamma() const noexcept { return _gamma; }
214
215 /**
216 * @brief Computes the gain of the sinc antenna based on the input parameters.
217 *
218 * @param angle The angle at which the gain is to be computed.
219 * @param refangle The reference angle.
220 * @param wavelength The wavelength of the signal.
221 * @return The computed gain of the antenna.
222 */
223 [[nodiscard]] RealType getGain(const math::SVec3& angle, const math::SVec3& refangle,
224 RealType wavelength) const noexcept override;
225
226 /**
227 * @brief Sets the alpha parameter of the sinc function.
228 *
229 * @param alpha The new alpha parameter.
230 */
231 void setAlpha(RealType alpha) noexcept { _alpha = alpha; }
232
233 /**
234 * @brief Sets the beta parameter of the sinc function.
235 *
236 * @param beta The new beta parameter.
237 */
238 void setBeta(RealType beta) noexcept { _beta = beta; }
239
240 /**
241 * @brief Sets the gamma parameter of the sinc function.
242 *
243 * @param gamma The new gamma parameter.
244 */
245 void setGamma(RealType gamma) noexcept { _gamma = gamma; }
246
247 private:
248 RealType _alpha; ///< Parameter defining the shape of the gain pattern.
249 RealType _beta; ///< Parameter defining the shape of the gain pattern.
250 RealType _gamma; ///< Parameter defining the shape of the gain pattern.
251 };
252
253 /**
254 * @class Gaussian
255 * @brief Represents a Gaussian-shaped antenna gain pattern.
256 *
257 * This antenna has a gain pattern that follows a Gaussian distribution.
258 */
259 class Gaussian final : public Antenna
260 {
261 public:
262 /**
263 * @brief Constructs a Gaussian antenna with the given parameters.
264 *
265 * @param name The name of the antenna.
266 * @param azscale The azimuth scale factor.
267 * @param elscale The elevation scale factor.
268 */
269 Gaussian(const std::string_view name, const RealType azscale, const RealType elscale, const SimId id = 0) :
270 Antenna(name.data(), id), _azscale(azscale), _elscale(elscale)
271 {
272 }
273
274 ~Gaussian() override = default;
275
276 Gaussian(const Gaussian&) = delete;
277
278 Gaussian& operator=(const Gaussian&) = delete;
279
280 Gaussian(Gaussian&&) = delete;
281
283
284 /**
285 * @brief Computes the gain of the Gaussian antenna.
286 *
287 * @param angle The angle at which the gain is to be computed.
288 * @param refangle The reference angle.
289 * @param wavelength The wavelength of the signal.
290 * @return The computed gain of the antenna.
291 */
292 [[nodiscard]] RealType getGain(const math::SVec3& angle, const math::SVec3& refangle,
293 RealType wavelength) const noexcept override;
294
295 /** @brief Gets the azimuth scale factor. */
296 [[nodiscard]] RealType getAzimuthScale() const noexcept { return _azscale; }
297
298 /** @brief Gets the elevation scale factor. */
299 [[nodiscard]] RealType getElevationScale() const noexcept { return _elscale; }
300
301 /**
302 * @brief Sets the azimuth scale factor of the Gaussian function.
303 *
304 * @param azscale The new azimuth scale factor.
305 */
306 void setAzimuthScale(RealType azscale) noexcept { _azscale = azscale; }
307
308 /**
309 * @brief Sets the elevation scale factor of the Gaussian function.
310 *
311 * @param elscale The new elevation scale factor.
312 */
313 void setElevationScale(RealType elscale) noexcept { _elscale = elscale; }
314
315 private:
316 RealType _azscale; ///< Azimuth scale factor.
317 RealType _elscale; ///< Elevation scale factor.
318 };
319
320 /**
321 * @class SquareHorn
322 * @brief Represents a square horn antenna.
323 *
324 * This antenna models a square horn with a specific dimension.
325 */
326 class SquareHorn final : public Antenna
327 {
328 public:
329 /**
330 * @brief Constructs a SquareHorn antenna with the given dimension.
331 *
332 * @param name The name of the antenna.
333 * @param dimension The dimension of the square horn.
334 */
335 SquareHorn(const std::string_view name, const RealType dimension, const SimId id = 0) :
336 Antenna(name.data(), id), _dimension(dimension)
337 {
338 }
339
340 ~SquareHorn() override = default;
341
342 SquareHorn(const SquareHorn&) = delete;
343
344 SquareHorn& operator=(const SquareHorn&) = delete;
345
347
349
350 /**
351 * @brief Computes the gain of the square horn antenna.
352 *
353 * @param angle The angle at which the gain is to be computed.
354 * @param refangle The reference angle.
355 * @param wavelength The wavelength of the signal.
356 * @return The computed gain of the antenna.
357 */
358 [[nodiscard]] RealType getGain(const math::SVec3& angle, const math::SVec3& refangle,
359 RealType wavelength) const noexcept override;
360
361 /** @brief Gets the dimension of the square horn. */
362 [[nodiscard]] RealType getDimension() const noexcept { return _dimension; }
363
364 /**
365 * @brief Sets the dimension of the square horn.
366 *
367 * @param dimension The new dimension of the square horn.
368 */
369 void setDimension(RealType dimension) noexcept { _dimension = dimension; }
370
371 private:
372 RealType _dimension; ///< Dimension of the square horn.
373 };
374
375 /**
376 * @class Parabolic
377 * @brief Represents a parabolic reflector antenna.
378 *
379 * This antenna models a parabolic reflector with a specific diameter.
380 */
381 class Parabolic final : public Antenna
382 {
383 public:
384 /**
385 * @brief Constructs a Parabolic antenna with the given diameter.
386 *
387 * @param name The name of the antenna.
388 * @param diameter The diameter of the parabolic reflector.
389 */
390 Parabolic(const std::string_view name, const RealType diameter, const SimId id = 0) :
391 Antenna(name.data(), id), _diameter(diameter)
392 {
393 }
394
395 ~Parabolic() override = default;
396
397 Parabolic(const Parabolic&) = delete;
398
399 Parabolic& operator=(const Parabolic&) = delete;
400
401 Parabolic(Parabolic&&) = delete;
402
404
405 /**
406 * @brief Computes the gain of the parabolic antenna.
407 *
408 * @param angle The angle at which the gain is to be computed.
409 * @param refangle The reference angle.
410 * @param wavelength The wavelength of the signal.
411 * @return The computed gain of the antenna.
412 */
413 [[nodiscard]] RealType getGain(const math::SVec3& angle, const math::SVec3& refangle,
414 RealType wavelength) const noexcept override;
415
416 /** @brief Gets the diameter of the parabolic reflector. */
417 [[nodiscard]] RealType getDiameter() const noexcept { return _diameter; }
418
419 /**
420 * @brief Sets the diameter of the parabolic reflector.
421 *
422 * @param diameter The new diameter of the parabolic reflector.
423 */
424 void setDiameter(RealType diameter) noexcept { _diameter = diameter; }
425
426 private:
427 RealType _diameter; ///< Diameter of the parabolic reflector.
428 };
429
430 /**
431 * @class XmlAntenna
432 * @brief Represents an antenna whose gain pattern is defined by an XML file.
433 *
434 * This class models an antenna where the gain pattern is read from an XML file.
435 */
436 class XmlAntenna final : public Antenna
437 {
438 public:
439 enum class AxisSymmetry
440 {
441 Mirrored,
442 None,
443 };
444
445 /**
446 * @brief Constructs an XmlAntenna with the specified name and XML configuration file.
447 *
448 * The constructor loads the azimuth and elevation gain patterns from the provided XML file.
449 *
450 * @param name The name of the antenna.
451 * @param filename The path to the XML file containing the antenna's gain pattern data.
452 */
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>())
456 {
457 loadAntennaDescription(filename);
458 }
459
460 ~XmlAntenna() override = default;
461
462 XmlAntenna(const XmlAntenna&) = delete;
463
464 XmlAntenna& operator=(const XmlAntenna&) = delete;
465
467
469
470 /**
471 * @brief Computes the gain of the antenna based on the input angle and reference angle.
472 *
473 * @param angle The angle at which the gain is to be computed.
474 * @param refangle The reference angle.
475 * @param wavelength The wavelength of the signal (not used in this antenna type).
476 * @return The gain of the antenna at the specified angle.
477 * @throws std::runtime_error If gain values cannot be retrieved from the interpolation sets.
478 */
479 [[nodiscard]] RealType getGain(const math::SVec3& angle, const math::SVec3& refangle,
480 RealType wavelength) const override;
481
482 /** @brief Gets the filename of the antenna description. */
483 [[nodiscard]] const std::string& getFilename() const noexcept { return _filename; }
484
485 /** @brief Gets the maximum gain of the antenna. */
486 [[nodiscard]] RealType getMaxGain() const noexcept { return _max_gain; }
487
488 /** @brief Gets the interpolation set for azimuth gain samples. */
489 [[nodiscard]] const interp::InterpSet* getAzimuthSamples() const noexcept { return _azi_samples.get(); }
490
491 /** @brief Gets the interpolation set for elevation gain samples. */
492 [[nodiscard]] const interp::InterpSet* getElevationSamples() const noexcept { return _elev_samples.get(); }
493
494 private:
495 [[nodiscard]] std::optional<RealType> lookupAxisGain(const interp::InterpSet* set, RealType angle,
496 AxisSymmetry symmetry) const noexcept;
497
498 /**
499 * @brief Loads the antenna gain pattern from the specified XML file.
500 *
501 * @param filename The path to the XML file containing the antenna's gain pattern data.
502 * @throws std::runtime_error If the XML file cannot be loaded or parsed.
503 */
504 void loadAntennaDescription(std::string_view filename);
505
506 std::string _filename; ///< The original filename for the antenna description.
507 RealType _max_gain{}; ///< The maximum gain of the antenna.
508 std::unique_ptr<interp::InterpSet> _azi_samples; ///< Interpolation set for azimuth gain samples.
509 std::unique_ptr<interp::InterpSet> _elev_samples; ///< Interpolation set for elevation gain samples.
510 AxisSymmetry _azi_symmetry{AxisSymmetry::Mirrored}; ///< Lookup mode for azimuth gain samples.
511 AxisSymmetry _elev_symmetry{AxisSymmetry::Mirrored}; ///< Lookup mode for elevation gain samples.
512 };
513
514 /**
515 * @class H5Antenna
516 * @brief Represents an antenna whose gain pattern is loaded from a HDF5 file.
517 *
518 * This class models an antenna with a gain pattern defined in an HDF5 file. The gain pattern is stored in a
519 * `Pattern` object, which is used to compute the antenna's gain based on the input angle and reference angle.
520 */
521 class H5Antenna final : public Antenna
522 {
523 public:
524 /**
525 * @brief Constructs a H5Antenna with the specified name and gain pattern file.
526 *
527 * @param name The name of the antenna.
528 * @param filename The path to the file containing the antenna's gain pattern.
529 */
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)
532 {
533 }
534
535 ~H5Antenna() override = default;
536
537 H5Antenna(const H5Antenna&) = delete;
538
539 H5Antenna& operator=(const H5Antenna&) = delete;
540
541 H5Antenna(H5Antenna&&) = delete;
542
544
545 /**
546 * @brief Computes the gain of the antenna based on the input angle and reference angle.
547 *
548 * @param angle The angle at which the gain is to be computed.
549 * @param refangle The reference angle.
550 * @return The gain of the antenna at the specified angle.
551 */
552 [[nodiscard]] RealType getGain(const math::SVec3& angle, const math::SVec3& refangle,
553 RealType /*wavelength*/) const override;
554
555 /** @brief Gets the filename of the antenna description. */
556 [[nodiscard]] const std::string& getFilename() const noexcept { return _filename; }
557
558 /** @brief Gets the gain pattern object. */
559 [[nodiscard]] const std::vector<std::vector<RealType>>& getPattern() const noexcept { return _pattern; }
560
561 private:
562 std::vector<std::vector<RealType>> _pattern; ///< The 2D pattern data.
563 std::string _filename; ///< The original filename for the antenna description.
564 };
565}
Thread-safe Meyers singleton for generating unique object IDs.
Definition sim_id.h:42
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(Sinc &&)=delete
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.
~Sinc() override=default
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.
Definition config.h:27
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.
Definition sim_id.h:18
ObjectType
Categorizes objects for ID generation.
Definition sim_id.h:25