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