Main Lemma Repository
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

TEMReceiver.h 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. /* This file is part of Lemma, a geophysical modelling and inversion API.
  2. * More information is available at http://lemmasoftware.org
  3. */
  4. /* This Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  7. */
  8. /**
  9. * @file
  10. * @date 10/08/2014 02:36:47 PM
  11. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email Trevor.Irons@xri-geo.com
  14. * @copyright Copyright (c) 2014, XRI Geophysics, LLC
  15. * @copyright Copyright (c) 2014, Trevor Irons
  16. */
  17. #ifndef TEMRECEIVER_INC
  18. #define TEMRECEIVER_INC
  19. #include "receiverpoints.h"
  20. #include <boost/random.hpp>
  21. #include <boost/random/normal_distribution.hpp>
  22. namespace Lemma {
  23. #ifdef HAVE_YAMLCPP
  24. #include "yaml-cpp/yaml.h"
  25. #endif
  26. /**
  27. \brief
  28. \details
  29. */
  30. class TEMReceiver : public ReceiverPoints {
  31. friend std::ostream &operator<<(std::ostream &stream,
  32. const TEMReceiver &ob);
  33. public:
  34. // ==================== LIFECYCLE =======================
  35. /**
  36. * @copybrief LemmaObject::New()
  37. * @copydetails LemmaObject::New()
  38. */
  39. static TEMReceiver* New();
  40. /**
  41. * @return a deep copy of this
  42. */
  43. TEMReceiver* Clone();
  44. /**
  45. * @copybrief LemmaObject::Delete()
  46. * @copydetails LemmaObject::Delete()
  47. */
  48. void Delete();
  49. // ==================== OPERATORS =======================
  50. // ==================== OPERATIONS =======================
  51. /**
  52. * Uses the standard deviations provided to provide an instance
  53. * of the expected noise. A realisation of the noise.
  54. */
  55. VectorXr SampleNoise();
  56. // ==================== ACCESS =======================
  57. /**
  58. * Sets the gate integration windows
  59. */
  60. void SetWindows(const VectorXr& centres, const VectorXr& widths, const TIMEUNITS& Units);
  61. /**
  62. * Sets the moment of the receiver. Defaults to 1 for normalized response.
  63. */
  64. void SetMoment( const Real& moment);
  65. /**
  66. * Sets std deviation values for noise channels.
  67. * @param[in] noise must be of the same length as the number of windows.
  68. */
  69. void SetNoiseSTD( const VectorXr& noise );
  70. /**
  71. * Gets std deviation values for noise channels.
  72. * @return noise std dev.
  73. */
  74. VectorXr GetNoiseSTD( );
  75. /**
  76. * @param[in] refTime sets the reference time, defaults to 0
  77. */
  78. void SetReferenceTime( const Real& refTime, const TIMEUNITS& units );
  79. /**
  80. * What field component to return
  81. */
  82. void SetComponent ( const FIELDCOMPONENT& COMP );
  83. /**
  84. * @param[in] loc is the location of the dipole receiver
  85. */
  86. void SetRxLocation ( const Vector3r& loc );
  87. // ==================== INQUIRY =======================
  88. #ifdef HAVE_YAMLCPP
  89. /**
  90. * Uses YAML to serialize this object.
  91. * @return a YAML::Node
  92. */
  93. YAML::Node Serialize() const;
  94. /**
  95. * Constructs an object from a YAML::Node.
  96. */
  97. static TEMReceiver* DeSerialize(const YAML::Node& node);
  98. #endif
  99. /**
  100. * @return centre point of gates in sec
  101. */
  102. VectorXr GetWindowCentres();
  103. /**
  104. * @return width of gates in sec
  105. */
  106. VectorXr GetWindowWidths();
  107. /**
  108. * @return the reference time
  109. */
  110. Real GetReferenceTime();
  111. protected:
  112. // ==================== LIFECYCLE =======================
  113. /** Default protected constructor, use New */
  114. TEMReceiver (const std::string& name);
  115. #ifdef HAVE_YAMLCPP
  116. /** Default protected de-serializing constructor, use factory DeSerialize */
  117. TEMReceiver (const YAML::Node& node);
  118. #endif
  119. /** Default protected destructor, use Delete */
  120. ~TEMReceiver ();
  121. /**
  122. * @copybrief LemmaObject::Release()
  123. * @copydetails LemmaObject::Release()
  124. */
  125. void Release();
  126. private:
  127. // ==================== DATA MEMBERS =========================
  128. Real moment;
  129. Real referenceTime;
  130. Vector3r nHat;
  131. FIELDCOMPONENT component;
  132. VectorXr windowCentres;
  133. VectorXr windowWidths;
  134. VectorXr noiseSTD;
  135. //Vector3r location;
  136. }; // ----- end of class TEMReceiver -----
  137. } // ----- end of Lemma name -----
  138. #endif // ----- #ifndef TEMRECEIVER_INC -----