CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
TimeDomainAntenna.hpp
1 /*
2  * (c) Copyright 2022 CORSIKA Project, corsika-project@lists.kit.edu
3  *
4  * This software is distributed under the terms of the GNU General Public
5  * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
6  * the license.
7  */
8 #pragma once
9 
10 #include <corsika/modules/radio/antennas/Antenna.hpp>
11 #include <yaml-cpp/yaml.h>
12 #include <vector>
13 
14 namespace corsika {
15 
21  class TimeDomainAntenna : public Antenna<TimeDomainAntenna> {
22 
23  TimeType const start_time_;
24  TimeType const duration_;
25  InverseTimeType const sample_rate_;
26  TimeType const ground_hit_time_;
27  uint64_t const num_bins_;
28  std::vector<double> waveformEX_;
29  std::vector<double> waveformEY_;
30  std::vector<double> waveformEZ_;
31  std::vector<long double> const
32  time_axis_;
33 
34  public:
35  // import the methods from the antenna
38 
52  TimeDomainAntenna(std::string const& name, Point const& location,
53  CoordinateSystemPtr coordinateSystem, TimeType const& start_time,
54  TimeType const& duration, InverseTimeType const& sample_rate,
55  TimeType const ground_hit_time);
56 
68  // TODO: rethink this method a bit. If the endpoint is at the end of the antenna
69  // resolution then you get the startpoint signal but you lose the endpoint signal!
70  void receive(TimeType const time, Vector<dimensionless_d> const& receive_vector,
71  ElectricFieldVector const& efield);
72 
73  void receive(TimeType const time, Vector<dimensionless_d> const& receive_vector,
74  VectorPotential const& vectorP);
75 
81  auto const& getWaveformX() const;
82 
88  auto const& getWaveformY() const;
89 
95  auto const& getWaveformZ() const;
96 
103  std::string const getDomainLabel();
104 
110  std::vector<long double> createTimeAxis() const;
111 
117  auto const getAxis() const;
118 
122  InverseTimeType const& getSampleRate() const;
123 
127  TimeType const& getStartTime() const;
128 
132  void reset();
133 
137  YAML::Node getConfig() const;
138 
139  }; // END: class TimeDomainAntenna
140 
141 } // namespace corsika
142 
143 #include <corsika/detail/modules/radio/antennas/TimeDomainAntenna.inl>
auto const getAxis() const
Return the time-units of each waveform.
TimeDomainAntenna(std::string const &name, Point const &location, CoordinateSystemPtr coordinateSystem, TimeType const &start_time, TimeType const &duration, InverseTimeType const &sample_rate, TimeType const ground_hit_time)
Construct a new TimeDomainAntenna.
An implementation of a time-domain antenna that has a customized start time, sampling rate...
std::vector< long double > createTimeAxis() const
Creates time-units of each waveform.
void receive(TimeType const time, Vector< dimensionless_d > const &receive_vector, ElectricFieldVector const &efield)
Receive an electric field at this antenna.
auto const & getWaveformY() const
Return the time-units of each waveform for Y polarization.
void reset()
Reset the antenna before starting a new simulation.
YAML::Node getConfig() const
Return a YAML configuration for this antenna.
`, since they are used everywhere as integral part of the framework.
InverseTimeType const & getSampleRate() const
Returns the sampling rate of the time domain antenna.
auto const & getWaveformX() const
Return the time-units of each waveform for X polarization.
std::shared_ptr< CoordinateSystem const > CoordinateSystemPtr
To refer to CoordinateSystems, only the CoordinateSystemPtr must be used.
std::string const getDomainLabel()
Return a label that indicates that this is a time domain antenna.
auto const & getWaveformZ() const
Return the time-units of each waveform for Z polarization.
A common abstract interface for radio antennas.
Definition: Antenna.hpp:25
TimeType const & getStartTime() const
Returns the start time of detection for the time domain antenna.