Surface NMR forward modelling
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

DataFID.cpp 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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:19 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. #include "DataFID.h"
  18. namespace Lemma {
  19. // ==================== FRIEND METHODS =====================
  20. std::ostream &operator << (std::ostream &stream, const DataFID &ob) {
  21. stream << ob.Serialize() << "\n---\n"; // End of doc ---
  22. return stream;
  23. }
  24. // ==================== LIFECYCLE =======================
  25. //--------------------------------------------------------------------------------------
  26. // Class: DataFID
  27. // Method: DataFID
  28. // Description: constructor (locked)
  29. //--------------------------------------------------------------------------------------
  30. DataFID::DataFID (const ctor_key&) : MerlinObject( ) {
  31. } // ----- end of method DataFID::DataFID (constructor) -----
  32. //--------------------------------------------------------------------------------------
  33. // Class: DataFID
  34. // Method: DataFID
  35. // Description: DeSerializing constructor (locked)
  36. //--------------------------------------------------------------------------------------
  37. DataFID::DataFID (const YAML::Node& node, const ctor_key&) : MerlinObject(node) {
  38. } // ----- end of method DataFID::DataFID (constructor) -----
  39. //--------------------------------------------------------------------------------------
  40. // Class: DataFID
  41. // Method: NewSP()
  42. // Description: public constructor returing a shared_ptr
  43. //--------------------------------------------------------------------------------------
  44. std::shared_ptr< DataFID > DataFID::NewSP() {
  45. return std::make_shared< DataFID >( ctor_key() );
  46. }
  47. //--------------------------------------------------------------------------------------
  48. // Class: DataFID
  49. // Method: ~DataFID
  50. // Description: destructor (protected)
  51. //--------------------------------------------------------------------------------------
  52. DataFID::~DataFID () {
  53. } // ----- end of method DataFID::~DataFID (destructor) -----
  54. //--------------------------------------------------------------------------------------
  55. // Class: DataFID
  56. // Method: Serialize
  57. //--------------------------------------------------------------------------------------
  58. YAML::Node DataFID::Serialize ( ) const {
  59. YAML::Node node = MerlinObject::Serialize();
  60. node.SetTag( GetName() );
  61. // FILL IN CLASS SPECIFICS HERE
  62. node["FID_REAL"] = FIDData.real().eval();
  63. node["FID_IMAG"] = FIDData.imag().eval();
  64. node["WindowCentres"] = WindowCentres;
  65. node["WindowEdges"] = WindowEdges;
  66. node["PulseMoment"] = PulseMoment;
  67. return node;
  68. } // ----- end of method DataFID::Serialize -----
  69. //--------------------------------------------------------------------------------------
  70. // Class: DataFID
  71. // Method: DeSerialize
  72. //--------------------------------------------------------------------------------------
  73. std::shared_ptr<DataFID> DataFID::DeSerialize ( const YAML::Node& node ) {
  74. if (node.Tag() != "DataFID" ) {
  75. throw DeSerializeTypeMismatch( "DataFID", node.Tag());
  76. }
  77. return std::make_shared< DataFID > ( node, ctor_key() );
  78. } // ----- end of method DataFID::DeSerialize -----
  79. } // ---- end of namespace Lemma ----
  80. /* vim: set tabstop=4 expandtab: */
  81. /* vim: set filetype=cpp: */