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ů.

KernelV0-2.cpp 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 11/11/2016 02:44:37 PM
  11. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email tirons@egi.utah.edu
  14. * @copyright Copyright (c) 2016, University of Utah
  15. * @copyright Copyright (c) 2016, Lemma Software, LLC
  16. */
  17. #include <Merlin>
  18. using namespace Lemma;
  19. int main(int argc, char** argv) {
  20. if (argc<3) {
  21. std::cout << "./KernelV0-2 Kernel.yaml TxString RxString \n";
  22. return(EXIT_SUCCESS);
  23. }
  24. std::cout << "Using kernel paramaters: " << argv[1] << std::endl;
  25. auto Kern = KernelV0::DeSerialize( YAML::LoadFile(argv[1]) );
  26. std::vector<std::string> tx = {std::string(argv[2])};
  27. std::vector<std::string> rx = {std::string(argv[3])};
  28. Kern->CalculateK0( tx, rx, false ); // 3rd argument is vtk output
  29. // TODO fix python post-processing so this is not necessary
  30. // Save in simplified format for easy python plotting
  31. std::ofstream dout = std::ofstream(std::string("Rx-")+std::string(argv[3])+std::string(".dat"));
  32. dout << "# Transmitters: ";
  33. for (auto lp : tx) {
  34. dout << lp << "\t";
  35. }
  36. dout << "\n# Receivers: ";
  37. for (auto lp : rx) {
  38. dout << lp << "\t";
  39. }
  40. dout << "\n# Tolerance: " << Kern->GetTolerance() << std::endl;
  41. dout << Kern->GetInterfaces().transpose() << std::endl;
  42. dout << Kern->GetPulseDuration()*Kern->GetPulseCurrent().transpose() << std::endl;
  43. dout << "#real\n";
  44. dout << Kern->GetKernel().real() << std::endl;
  45. dout << "#imag\n";
  46. dout << Kern->GetKernel().imag() << std::endl;
  47. dout.close();
  48. // Save YAML kernel
  49. std::ofstream out = std::ofstream(std::string("Rx-")+std::string(argv[2])+std::string(".yaml"));
  50. out << *Kern;
  51. out.close();
  52. }