Lemma is an Electromagnetics API
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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 01:51:50 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 TEMSURVEY_INC
  18. #define TEMSURVEY_INC
  19. #include "LemmaObject.h"
  20. #include "TEMSurveyLine.h"
  21. #include "TEMSurveyData.h"
  22. #include "layeredearthem.h"
  23. #ifdef HAVE_YAMLCPP
  24. #include "yaml-cpp/yaml.h"
  25. #endif
  26. namespace Lemma {
  27. /**
  28. \brief Describes a TEM survey.
  29. \details This class aims to encapulate any type of TEM survey.
  30. */
  31. class TEMSurvey : public LemmaObject {
  32. friend std::ostream &operator<<(std::ostream &stream,
  33. const TEMSurvey &ob);
  34. public:
  35. // ==================== LIFECYCLE =======================
  36. /**
  37. * @copybrief LemmaObject::New()
  38. * @copydetails LemmaObject::New()
  39. */
  40. static TEMSurvey* New();
  41. /**
  42. * @copybrief LemmaObject::Delete()
  43. * @copydetails LemmaObject::Delete()
  44. */
  45. void Delete();
  46. // ==================== OPERATORS =======================
  47. /** @param[in] idx the index to return
  48. * @return the SurveyLine with index idx
  49. */
  50. TEMSurveyLine* operator( ) ( const int& idx ) const ;
  51. /** @param[in] iline the line index to return
  52. * @param[in] irec the line index to return
  53. * @return the SurveyLine with index iline, irec
  54. */
  55. TEMSurveyLineRecord* operator( ) ( const int& iline, const int& irec ) const;
  56. // ==================== OPERATIONS =======================
  57. /**
  58. * @param[in] nlines sets the number of lines (TEMSurveyLine) in the survey. A line is any kind of
  59. * related set of measurements. In Airborne EM, this is a flight line, but
  60. * the idea extends to ground based profile lines.
  61. */
  62. void SetNumberOfLines( const int& nlines );
  63. /**
  64. * Most basic form of forward modelling. Uses input model for ALL TEMSurveyLines and
  65. * TEMSurveyLineRecords (atomic). Most useful in the
  66. * case that there is only 1 line and 1 record. But even in that case it can be called directly from
  67. * the record. This method will likely be replaced soon.
  68. */
  69. TEMSurveyData* ForwardModel(LayeredEarthEM* model, bool additiveNoise=false);
  70. // ==================== ACCESS =======================
  71. /**
  72. * @return pointer to requested TEMSurveyLine
  73. */
  74. TEMSurveyLine* GetLine(const unsigned int& iline);
  75. // ==================== INQUIRY =======================
  76. #ifdef HAVE_YAMLCPP
  77. YAML::Node Serialize() const;
  78. static TEMSurvey* DeSerialize(const YAML::Node& node);
  79. #endif
  80. protected:
  81. // ==================== LIFECYCLE =======================
  82. /** Default protected constructor, use New */
  83. TEMSurvey (const std::string& name);
  84. #ifdef HAVE_YAMLCPP
  85. /** Default protected constructor, use New */
  86. TEMSurvey (const YAML::Node& node);
  87. #endif
  88. /** Default protected destructor, use Delete */
  89. ~TEMSurvey ();
  90. /**
  91. * @copybrief LemmaObject::Release()
  92. * @copydetails LemmaObject::Release()
  93. */
  94. void Release();
  95. private:
  96. // ==================== DATA MEMBERS =========================
  97. std::vector<TEMSurveyLine*> Lines;
  98. }; // ----- end of class TEMSurvey -----
  99. } // ----- end of Lemma name -----
  100. #endif // ----- #ifndef TEMSURVEY_INC -----