Surface NMR forward modelling
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

DataFID.h 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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 08/28/2017 01:04:12 PM
  11. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email tirons@egi.utah.edu
  14. * @copyright Copyright (c) 2017, University of Utah
  15. * @copyright Copyright (c) 2017, Lemma Software, LLC
  16. */
  17. #ifndef DATAFID_INC
  18. #define DATAFID_INC
  19. #pragma once
  20. #include "MerlinObject.h"
  21. namespace Lemma {
  22. /**
  23. * \ingroup Merlin
  24. * \brief Base class for representation of FID data in Merlin.
  25. * \details Simplest form of FID data used in Merlin. Field data derives
  26. from this class for specific instrumentation details. See
  27. the Akvo project for further details (akvo.lemmasoftware.org).
  28. */
  29. class DataFID : public MerlinObject {
  30. friend std::ostream &operator<<(std::ostream &stream, const DataFID &ob);
  31. friend class ForwardFID;
  32. protected:
  33. /*
  34. * This key is used to lock the constructor. It is protected so that inhereted
  35. * classes also have the key to contruct their base class.
  36. */
  37. struct ctor_key {};
  38. public:
  39. // ==================== LIFECYCLE =======================
  40. /**
  41. * Default constructor.
  42. * @note This method is locked, and cannot be called directly.
  43. * The reason that the method is public is to enable the use
  44. * of make_shared whilst enforcing the use of shared_ptr,
  45. * in c++-17, this curiosity may be resolved.
  46. * @see DataFID::NewSP
  47. */
  48. explicit DataFID ( const ctor_key& );
  49. /**
  50. * DeSerializing constructor.
  51. * @note This method is locked, and cannot be called directly.
  52. * The reason that the method is public is to enable the use
  53. * of make_shared whilst enforcing the use of shared_ptr,
  54. * in c++-17, this curiosity may be resolved.
  55. * @see DataFID::DeSerialize
  56. */
  57. DataFID ( const YAML::Node& node, const ctor_key& );
  58. /**
  59. * Default destructor.
  60. * @note This method should never be called due to the mandated
  61. * use of smart pointers. It is necessary to keep the method
  62. * public in order to allow for the use of the more efficient
  63. * make_shared constructor.
  64. */
  65. virtual ~DataFID ();
  66. /**
  67. * Uses YAML to serialize this object.
  68. * @return a YAML::Node
  69. * @see DataFID::DeSerialize
  70. */
  71. virtual YAML::Node Serialize() const;
  72. /*
  73. * Factory method for generating concrete class.
  74. * @return a std::shared_ptr of type DataFID
  75. */
  76. static std::shared_ptr< DataFID > NewSP();
  77. /**
  78. * Constructs an DataFID object from a YAML::Node.
  79. * @see DataFID::Serialize
  80. */
  81. static std::shared_ptr<DataFID> DeSerialize(const YAML::Node& node);
  82. // ==================== OPERATORS =======================
  83. // ==================== OPERATIONS =======================
  84. // ==================== ACCESS =======================
  85. // ==================== INQUIRY =======================
  86. /**
  87. * Returns the name of the underlying class, similiar to Python's type
  88. * @return string of class name
  89. */
  90. virtual inline std::string GetName() const {
  91. return CName;
  92. }
  93. protected:
  94. // ==================== LIFECYCLE =======================
  95. /** Copy is disabled */
  96. DataFID( const DataFID& ) = delete;
  97. // ==================== DATA MEMBERS =========================
  98. private:
  99. /** ASCII string representation of the class name */
  100. static constexpr auto CName = "DataFID";
  101. /** Holds the actual data */
  102. MatrixXcr FIDData;
  103. /** Estimate of noise for each datum */
  104. MatrixXr NoiseEstimate;
  105. /** Forward model matrix */
  106. MatrixXcr Qt;
  107. VectorXr TrueModel;
  108. VectorXr WindowCentres;
  109. VectorXr WindowEdges;
  110. VectorXr PulseMoment;
  111. }; // ----- end of class DataFID -----
  112. } // ----- end of namespace Lemma ----
  113. /* vim: set tabstop=4 expandtab: */
  114. /* vim: set filetype=cpp: */
  115. #endif // ----- #ifndef DATAFID_INC -----