43 const RealType gain = std::stof(gain_element.getText());
44 set->insertSample(angle, gain);
56 return _model ? _rcs * _model->sampleModel() : _rcs;
60 Target(platform, std::move(name), seed), _azi_samples(std::make_unique_for_overwrite<
interp::InterpSet>()),
61 _elev_samples(std::make_unique_for_overwrite<
interp::InterpSet>()), _filename(filename)
66 throw std::runtime_error(
"Could not load target description from " + filename);
71 loadTargetGainAxis(_elev_samples.get(), root.
childElement(
"elevation", 0));
72 loadTargetGainAxis(_azi_samples.get(), root.
childElement(
"azimuth", 0));
79 const SVec3 global_bisector_angle = inAngle + outAngle;
85 const SVec3 local_aspect_angle = global_bisector_angle - target_rotation;
88 const auto azi_value = _azi_samples->getValueAt(local_aspect_angle.
azimuth / 2.0);
90 if (
const auto elev_value = _elev_samples->getValueAt(local_aspect_angle.
elevation / 2.0);
91 azi_value && elev_value)
94 const RealType rcs = *azi_value * *elev_value;
99 throw std::runtime_error(
"Could not get RCS value for target");
Class for managing XML documents.
XmlElement getRootElement() const
Get the root element of the document.
bool loadFile(std::string_view filename)
Load an XML file into the document.
Class representing a node in an XML document.
XmlElement childElement(const std::string_view name="", const unsigned index=0) const noexcept
Retrieve a child element by name and index.
bool isValid() const noexcept
Check if the XML element is valid.
xmlNodePtr getNode() const noexcept
Get the underlying XML node pointer.
std::string getText() const
Get the text content of the XML element.
Wrapper class for managing interpolation sets using smart pointers.
A class representing a vector in spherical coordinates.
RealType elevation
The elevation angle of the vector.
RealType azimuth
The azimuth angle of the vector.
RealType getRcs(math::SVec3 &inAngle, math::SVec3 &outAngle, RealType time) const override
Gets the RCS value from file-based data for a specific bistatic geometry and time.
FileTarget(Platform *platform, std::string name, const std::string &filename, unsigned seed)
Constructs a file-based radar target.
RealType getRcs(math::SVec3 &, math::SVec3 &, RealType) const noexcept override
Gets the constant RCS value.
math::SVec3 getRotation(const RealType time) const
Retrieves the rotation of the object.
Base class for radar targets.
std::unique_ptr< RcsModel > _model
The RCS fluctuation model for the target.
double RealType
Type for real numbers.
Classes and operations for 3D geometry.
Wrapper for managing XML documents and elements using libxml2.
Header file for the logging system.
@ FATAL
Fatal level for severe error events.
Defines classes for radar targets and their Radar Cross-Section (RCS) models.