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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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 02/11/2014 03:33:08 PM
  11. * @author Trevor Irons (ti)
  12. * @email Trevor.Irons@lemmasoftware.org
  13. * @copyright Copyright (c) 2014, Trevor Irons
  14. */
  15. #ifndef FHTKEY201_INC
  16. #define FHTKEY201_INC
  17. #include "HankelTransform.h"
  18. #include "CubicSplineInterpolator.h"
  19. namespace Lemma {
  20. /**
  21. \ingroup FDEM1D
  22. \brief Impliments the fast Hankel transform as outlines by Key 2011
  23. \details This filter uses 51, 101, or 201 filter points and supports both lagged and related
  24. kernel arguments. This algorithm is a port of code carrying the following copyright
  25. and restriction:
  26. %------------------------------------------------------------------%
  27. % Copyright (c) 2012 by the Society of Exploration Geophysicists. %
  28. % For more information, go to http://software.seg.org/2012/0003 . %
  29. % You must read and accept usage terms at: %
  30. % http://software.seg.org/disclaimer.txt before use. %
  31. %------------------------------------------------------------------%
  32. */
  33. class FHTKey201 : public HankelTransform {
  34. friend std::ostream &operator<<(std::ostream &stream, const FHTKey201 &ob);
  35. // ==================== LIFECYCLE =======================
  36. public:
  37. /** Default locked constructor, use NewSP */
  38. FHTKey201 ( const ctor_key& );
  39. /** DeSerializing locked constructor, use DeSerialize */
  40. FHTKey201 ( const YAML::Node& node, const ctor_key& );
  41. /** Default destructor */
  42. ~FHTKey201 ();
  43. /**
  44. * Factory method for generating objects.
  45. * @return std::shared_ptr< FHTKey201 >
  46. */
  47. static std::shared_ptr<FHTKey201> NewSP();
  48. /** YAML Serializing method
  49. */
  50. YAML::Node Serialize() const;
  51. /**
  52. * Constructs an object from a YAML::Node.
  53. */
  54. static std::shared_ptr< FHTKey201 > DeSerialize(const YAML::Node& node);
  55. // ==================== OPERATORS =======================
  56. // ==================== OPERATIONS =======================
  57. Complex Zgauss(const int &ikk, const EMMODE &imode,
  58. const int &itype, const Real &rho,
  59. const Real &wavef, KernelEM1DBase* Kernel);
  60. /// Computes related kernels, if applicable, otherwise this is
  61. /// just a dummy function.
  62. void ComputeRelated(const Real& rho, std::shared_ptr<KernelEM1DBase> Kernel);
  63. void ComputeRelated(const Real& rho, std::vector< std::shared_ptr<KernelEM1DBase> > KernelVec);
  64. void ComputeRelated(const Real& rho, std::shared_ptr<KernelEM1DManager> KernelManager);
  65. void ComputeLaggedRelated(const Real& rho, const int& nlag, std::shared_ptr<KernelEM1DManager> KernelManager);
  66. // ==================== ACCESS =======================
  67. // ==================== INQUIRY =======================
  68. Real GetABSER();
  69. void SetLaggedArg(const Real& rho);
  70. /** Returns the name of the underlying class, similiar to Python's type */
  71. virtual std::string GetName() const;
  72. protected:
  73. // ==================== LIFECYCLE =======================
  74. private:
  75. // ==================== DATA MEMBERS =========================
  76. // Shared Filter Weights
  77. static const Eigen::Matrix<Real, 201, 3> WT201;
  78. /// Spines for lagged convolutions (real part)
  79. std::vector <std::shared_ptr<CubicSplineInterpolator> > splineVecReal;
  80. /// Spines for lagged convolutions (imaginary part)
  81. std::vector < std::shared_ptr<CubicSplineInterpolator> > splineVecImag;
  82. /// Holds answer, dimensions are NumConv, and NumberRelated.
  83. Eigen::Matrix<Complex, Eigen::Dynamic, Eigen::Dynamic> Zans;
  84. /** ASCII string representation of the class name */
  85. static constexpr auto CName = "FHTKey201";
  86. }; // ----- end of class FHTKey201 -----
  87. } // ----- end of Lemma name -----
  88. #endif // ----- #ifndef FHTKEY201_INC -----