fullwave25 1.0.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of fullwave25 might be problematic. Click here for more details.

Files changed (225) hide show
  1. fullwave/__init__.py +28 -0
  2. fullwave/constants/__init__.py +5 -0
  3. fullwave/constants/material_properties.py +112 -0
  4. fullwave/grid.py +222 -0
  5. fullwave/medium.py +1042 -0
  6. fullwave/medium_builder/__init__.py +12 -0
  7. fullwave/medium_builder/domain.py +151 -0
  8. fullwave/medium_builder/medium_builder.py +198 -0
  9. fullwave/medium_builder/presets/__init__.py +8 -0
  10. fullwave/medium_builder/presets/data/.keep +0 -0
  11. fullwave/medium_builder/presets/data/abdominal_wall/i2365f_etfw1.mat +0 -0
  12. fullwave/medium_builder/presets/domain_abdominal_wall.py +293 -0
  13. fullwave/medium_builder/presets/domain_background.py +140 -0
  14. fullwave/medium_builder/presets/domain_scatterer.py +179 -0
  15. fullwave/medium_builder/presets/domain_simple.py +92 -0
  16. fullwave/medium_builder/presets/domain_water_gel.py +1 -0
  17. fullwave/sensor.py +161 -0
  18. fullwave/solver/__init__.py +1 -0
  19. fullwave/solver/bins/database/relaxation_params_database_num_relax=2_20251027_1437.mat +0 -0
  20. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenu +0 -0
  21. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_100_cuda129 +0 -0
  22. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_101_cuda129 +0 -0
  23. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_120_cuda129 +0 -0
  24. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_61_cuda118 +0 -0
  25. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_61_cuda124 +0 -0
  26. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_61_cuda126 +0 -0
  27. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_61_cuda129 +0 -0
  28. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_70_cuda118 +0 -0
  29. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_70_cuda124 +0 -0
  30. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_70_cuda126 +0 -0
  31. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_70_cuda129 +0 -0
  32. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_75_cuda118 +0 -0
  33. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_75_cuda124 +0 -0
  34. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_75_cuda126 +0 -0
  35. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_75_cuda129 +0 -0
  36. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_80_cuda118 +0 -0
  37. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_80_cuda124 +0 -0
  38. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_80_cuda126 +0 -0
  39. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_80_cuda129 +0 -0
  40. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_86_cuda118 +0 -0
  41. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_86_cuda124 +0 -0
  42. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_86_cuda126 +0 -0
  43. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_86_cuda129 +0 -0
  44. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_89_cuda118 +0 -0
  45. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_89_cuda126 +0 -0
  46. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_89_cuda129 +0 -0
  47. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_90_cuda118 +0 -0
  48. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_90_cuda124 +0 -0
  49. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_90_cuda126 +0 -0
  50. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_90_cuda129 +0 -0
  51. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_100_cuda129 +0 -0
  52. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_101_cuda129 +0 -0
  53. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_120_cuda129 +0 -0
  54. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_61_cuda118 +0 -0
  55. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_61_cuda124 +0 -0
  56. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_61_cuda126 +0 -0
  57. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_61_cuda129 +0 -0
  58. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_70_cuda118 +0 -0
  59. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_70_cuda124 +0 -0
  60. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_70_cuda126 +0 -0
  61. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_70_cuda129 +0 -0
  62. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_75_cuda118 +0 -0
  63. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_75_cuda124 +0 -0
  64. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_75_cuda126 +0 -0
  65. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_75_cuda129 +0 -0
  66. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_80_cuda118 +0 -0
  67. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_80_cuda124 +0 -0
  68. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_80_cuda126 +0 -0
  69. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_80_cuda129 +0 -0
  70. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_86_cuda118 +0 -0
  71. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_86_cuda124 +0 -0
  72. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_86_cuda126 +0 -0
  73. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_86_cuda129 +0 -0
  74. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_89_cuda118 +0 -0
  75. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_89_cuda124 +0 -0
  76. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_89_cuda126 +0 -0
  77. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_89_cuda129 +0 -0
  78. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_90_cuda118 +0 -0
  79. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_90_cuda124 +0 -0
  80. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_90_cuda126 +0 -0
  81. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_90_cuda129 +0 -0
  82. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_100_cuda129 +0 -0
  83. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_101_cuda129 +0 -0
  84. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_120_cuda129 +0 -0
  85. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_61_cuda118 +0 -0
  86. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_61_cuda124 +0 -0
  87. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_61_cuda126 +0 -0
  88. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_61_cuda129 +0 -0
  89. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_70_cuda118 +0 -0
  90. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_70_cuda124 +0 -0
  91. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_70_cuda126 +0 -0
  92. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_70_cuda129 +0 -0
  93. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_75_cuda118 +0 -0
  94. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_75_cuda124 +0 -0
  95. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_75_cuda126 +0 -0
  96. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_75_cuda129 +0 -0
  97. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_80_cuda118 +0 -0
  98. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_80_cuda124 +0 -0
  99. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_80_cuda126 +0 -0
  100. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_80_cuda129 +0 -0
  101. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_86_cuda118 +0 -0
  102. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_86_cuda124 +0 -0
  103. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_86_cuda126 +0 -0
  104. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_86_cuda129 +0 -0
  105. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_89_cuda118 +0 -0
  106. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_89_cuda124 +0 -0
  107. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_89_cuda126 +0 -0
  108. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_89_cuda129 +0 -0
  109. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_90_cuda118 +0 -0
  110. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_90_cuda124 +0 -0
  111. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_90_cuda126 +0 -0
  112. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_90_cuda129 +0 -0
  113. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_100_cuda129 +0 -0
  114. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_101_cuda129 +0 -0
  115. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_120_cuda129 +0 -0
  116. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_61_cuda118 +0 -0
  117. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_61_cuda124 +0 -0
  118. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_61_cuda126 +0 -0
  119. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_61_cuda129 +0 -0
  120. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_70_cuda118 +0 -0
  121. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_70_cuda124 +0 -0
  122. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_70_cuda126 +0 -0
  123. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_70_cuda129 +0 -0
  124. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_75_cuda118 +0 -0
  125. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_75_cuda124 +0 -0
  126. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_75_cuda126 +0 -0
  127. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_75_cuda129 +0 -0
  128. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_80_cuda118 +0 -0
  129. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_80_cuda124 +0 -0
  130. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_80_cuda126 +0 -0
  131. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_80_cuda129 +0 -0
  132. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_86_cuda118 +0 -0
  133. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_86_cuda124 +0 -0
  134. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_86_cuda126 +0 -0
  135. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_86_cuda129 +0 -0
  136. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_89_cuda118 +0 -0
  137. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_89_cuda124 +0 -0
  138. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_89_cuda126 +0 -0
  139. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_89_cuda129 +0 -0
  140. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_90_cuda118 +0 -0
  141. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_90_cuda124 +0 -0
  142. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_90_cuda126 +0 -0
  143. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_90_cuda129 +0 -0
  144. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_100_cuda129 +0 -0
  145. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_101_cuda129 +0 -0
  146. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_120_cuda129 +0 -0
  147. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_61_cuda118 +0 -0
  148. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_61_cuda124 +0 -0
  149. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_61_cuda126 +0 -0
  150. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_61_cuda129 +0 -0
  151. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_70_cuda118 +0 -0
  152. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_70_cuda124 +0 -0
  153. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_70_cuda126 +0 -0
  154. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_70_cuda129 +0 -0
  155. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_75_cuda118 +0 -0
  156. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_75_cuda124 +0 -0
  157. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_75_cuda126 +0 -0
  158. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_75_cuda129 +0 -0
  159. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_80_cuda118 +0 -0
  160. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_80_cuda124 +0 -0
  161. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_80_cuda126 +0 -0
  162. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_80_cuda129 +0 -0
  163. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_86_cuda118 +0 -0
  164. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_86_cuda124 +0 -0
  165. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_86_cuda126 +0 -0
  166. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_86_cuda129 +0 -0
  167. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_89_cuda118 +0 -0
  168. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_89_cuda124 +0 -0
  169. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_89_cuda126 +0 -0
  170. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_89_cuda129 +0 -0
  171. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_90_cuda118 +0 -0
  172. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_90_cuda124 +0 -0
  173. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_90_cuda126 +0 -0
  174. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_90_cuda129 +0 -0
  175. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_100_cuda129 +0 -0
  176. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_101_cuda129 +0 -0
  177. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_120_cuda129 +0 -0
  178. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_61_cuda118 +0 -0
  179. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_61_cuda124 +0 -0
  180. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_61_cuda126 +0 -0
  181. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_61_cuda129 +0 -0
  182. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_70_cuda118 +0 -0
  183. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_70_cuda124 +0 -0
  184. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_70_cuda126 +0 -0
  185. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_70_cuda129 +0 -0
  186. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_75_cuda118 +0 -0
  187. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_75_cuda124 +0 -0
  188. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_75_cuda126 +0 -0
  189. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_75_cuda129 +0 -0
  190. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_80_cuda118 +0 -0
  191. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_80_cuda124 +0 -0
  192. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_80_cuda126 +0 -0
  193. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_80_cuda129 +0 -0
  194. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_86_cuda118 +0 -0
  195. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_86_cuda124 +0 -0
  196. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_86_cuda126 +0 -0
  197. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_86_cuda129 +0 -0
  198. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_89_cuda118 +0 -0
  199. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_89_cuda124 +0 -0
  200. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_89_cuda126 +0 -0
  201. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_89_cuda129 +0 -0
  202. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_90_cuda118 +0 -0
  203. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_90_cuda124 +0 -0
  204. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_90_cuda126 +0 -0
  205. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_90_cuda129 +0 -0
  206. fullwave/solver/cuda_utils.py +392 -0
  207. fullwave/solver/input_file_writer.py +853 -0
  208. fullwave/solver/launcher.py +134 -0
  209. fullwave/solver/pml_builder.py +1923 -0
  210. fullwave/solver/solver.py +750 -0
  211. fullwave/solver/utils.py +83 -0
  212. fullwave/source.py +173 -0
  213. fullwave/transducer.py +1003 -0
  214. fullwave/utils/__init__.py +12 -0
  215. fullwave/utils/check_functions.py +48 -0
  216. fullwave/utils/coordinates.py +155 -0
  217. fullwave/utils/memory_tempfile.py +439 -0
  218. fullwave/utils/numerical.py +111 -0
  219. fullwave/utils/plot_utils.py +1122 -0
  220. fullwave/utils/pulse.py +72 -0
  221. fullwave/utils/relaxation_parameters.py +212 -0
  222. fullwave/utils/signal_process.py +197 -0
  223. fullwave25-1.0.7.dist-info/METADATA +292 -0
  224. fullwave25-1.0.7.dist-info/RECORD +225 -0
  225. fullwave25-1.0.7.dist-info/WHEEL +4 -0
@@ -0,0 +1,72 @@
1
+ """Module for generating pulse signals used in the Fullwave simulation."""
2
+
3
+ import numpy as np
4
+ from numpy.typing import NDArray
5
+
6
+
7
+ def gaussian_modulated_sinusoidal_signal(
8
+ nt: int,
9
+ duration: float,
10
+ ncycles: int,
11
+ drop_off: int,
12
+ f0: float,
13
+ p0: float,
14
+ delay_sec: float = 0.0,
15
+ i_layer: int | None = None,
16
+ dt_for_layer_delay: float | None = None,
17
+ cfl_for_layer_delay: float | None = None,
18
+ ) -> NDArray[np.float64]:
19
+ """Generate a pulse signal based on input parameters.
20
+
21
+ Parameters
22
+ ----------
23
+ nt: int
24
+ Number of time samples of the simulation.
25
+ duration: float
26
+ Total duration of the simulation.
27
+ ncycles: int
28
+ Number of cycles in the pulse.
29
+ drop_off: int
30
+ Controls the pulse decay.
31
+ f0: float
32
+ Frequency of the pulse.
33
+ p0: float
34
+ Amplitude scaling factor.
35
+ delay_sec: float
36
+ Delay in seconds. Default is 0.0.
37
+ i_layer: int
38
+ Index of the layer where the source is located. Default is None.
39
+ This variable is used to shift the pulse signal in time
40
+ so that the signal is emmitted within the transducer layer correctly.
41
+ dt_for_layer_delay: float
42
+ Time step of the simulation. Default is None.
43
+ This variable is used to shift the pulse signal in time
44
+ so that the signal is emmitted within the transducer layer correctly.
45
+ cfl_for_layer_delay: float
46
+ Courant-Friedrichs-Lewy number. Default is None.
47
+ This variable is used to shift the pulse signal in time
48
+ so that the signal is emmitted within the transducer layer correctly.
49
+
50
+ Returns
51
+ -------
52
+ NDArray[np.float64]: The generated pulse signal.
53
+
54
+ """
55
+ t = (np.arange(0, nt)) / nt * duration - ncycles / f0
56
+ t = t - delay_sec
57
+
58
+ if i_layer:
59
+ assert dt_for_layer_delay, "dt must be provided if i_layer is provided"
60
+ assert cfl_for_layer_delay, "cfl must be provided if i_layer is provided"
61
+ t = t - (dt_for_layer_delay / cfl_for_layer_delay) * i_layer
62
+
63
+ omega0 = 2 * np.pi * f0
64
+ return (
65
+ np.multiply(
66
+ np.exp(
67
+ -((1.05 * t * omega0 / (ncycles * np.pi)) ** (2 * drop_off)),
68
+ ),
69
+ np.sin(t * omega0),
70
+ )
71
+ * p0
72
+ )
@@ -0,0 +1,212 @@
1
+ """Module for generating relaxation parameters.
2
+
3
+ using a precomputed lookup table and input attenuation values.
4
+ """
5
+
6
+ import warnings
7
+ from pathlib import Path
8
+
9
+ import numpy as np
10
+ from numpy.typing import NDArray
11
+ from scipy.io import loadmat
12
+
13
+ from fullwave.solver.utils import initialize_relaxation_param_dict
14
+
15
+
16
+ def _map_parameters_search(
17
+ input_tensor: NDArray[np.float64],
18
+ look_up_table: NDArray[np.float64],
19
+ alpha_list: NDArray[np.float64],
20
+ power_list: NDArray[np.float64],
21
+ ) -> NDArray[np.float64]:
22
+ """Map (nx, ny, 2) input tensor to (nx, ny, 11) using LUT.
23
+
24
+ Parameters
25
+ ----------
26
+ input_tensor: NDArray[np.float64]
27
+ Normalized input tensor [0, 1]^2
28
+ look_up_table: NDArray[np.float64]
29
+ Precomputed parameter table shape (B1, B2, 4 * n_relaxation + 2)
30
+ alpha_list: NDArray[np.float64]
31
+ List of alpha values for the lookup table.
32
+ power_list: NDArray[np.float64]
33
+ List of power values for the lookup table.
34
+
35
+ Returns
36
+ -------
37
+ NDArray[np.float64]
38
+ Output tensor with shape (nx, ny, 4 * n_relaxation + 2)
39
+
40
+ """
41
+ # search nearest in alpha_list and power_list.
42
+ # alpha is in input_tensor[:, :, 0]
43
+ # power is in input_tensor[:, :, 1]
44
+ # the index corresponds to lookup table
45
+ alpha_index = np.searchsorted(alpha_list[0].round(10), input_tensor[..., 0])
46
+ power_index = np.searchsorted(power_list[0].round(10), input_tensor[..., 1])
47
+ # Clip indices to valid range
48
+ alpha_index = np.clip(alpha_index, 0, len(alpha_list[0]) - 1)
49
+ power_index = np.clip(power_index, 0, len(power_list[0]) - 1)
50
+ # Advanced indexing for 2D parameter space
51
+ return look_up_table[alpha_index, power_index, :]
52
+
53
+
54
+ def generate_relaxation_params(
55
+ alpha_coeff: NDArray[np.float64],
56
+ alpha_power: NDArray[np.float64],
57
+ n_relaxation_mechanisms: int = 2,
58
+ path_database: Path = Path(__file__).parent
59
+ / "bins"
60
+ / "relaxation_params_database_num_relax=2_20251027_1437.mat",
61
+ ) -> dict[str, NDArray[np.float64]]:
62
+ """Generate relaxation parameters using a precomputed lookup table and input attenuation values.
63
+
64
+ The binning of the attenuation value depends
65
+ on the number of bins used to generate the lookup table.
66
+
67
+ Parameters
68
+ ----------
69
+ alpha_coeff : NDArray[np.float64]
70
+ Array of attenuation coefficients.
71
+ alpha_power : NDArray[np.float64]
72
+ Array of attenuation power values.
73
+ n_relaxation_mechanisms : int, optional
74
+ Number of relaxation mechanisms (default is 4).
75
+ path_database : Path, optional
76
+ Path to the relaxation parameters database.
77
+
78
+ Returns
79
+ -------
80
+ dict[str, NDArray[np.float64]]
81
+ A dictionary containing the computed relaxation parameters.
82
+
83
+ """
84
+ relaxation_parameters_generator = RelaxationParametersGenerator(
85
+ n_relaxation_mechanisms=n_relaxation_mechanisms,
86
+ path_database=path_database,
87
+ )
88
+ return relaxation_parameters_generator.generate(alpha_coeff, alpha_power)
89
+
90
+
91
+ class RelaxationParametersGenerator:
92
+ """Class for generating relaxation parameters."""
93
+
94
+ def __init__(
95
+ self,
96
+ *,
97
+ n_relaxation_mechanisms: int = 2,
98
+ path_database: Path = Path(__file__).parent
99
+ / "bins"
100
+ / "database"
101
+ / "relaxation_params_database_num_relax=2_20251027_1437.mat",
102
+ ) -> None:
103
+ """Initialize the relaxation parameters generator.
104
+
105
+ Parameters
106
+ ----------
107
+ n_relaxation_mechanisms : int, optional
108
+ Number of relaxation mechanisms (default is 4).
109
+ path_database : Path, optional
110
+ Path to the relaxation parameters database.
111
+
112
+ Raises
113
+ ------
114
+ FileNotFoundError
115
+ If the relaxation parameters database is not found at the specified path.
116
+
117
+ """
118
+ if not path_database.exists():
119
+ error_msg = f"Relaxation parameters database not found at {path_database}."
120
+ raise FileNotFoundError(error_msg)
121
+
122
+ self.n_relaxation_mechanisms = n_relaxation_mechanisms
123
+ self.path_database = path_database
124
+
125
+ self.database = loadmat(self.path_database)
126
+ self.look_up_table = self.database["database"]
127
+ self.alpha_list = self.database["alpha_0_list"]
128
+ self.power_list = self.database["power_list"]
129
+ self.alpha_min = self.alpha_list.min()
130
+ self.alpha_max = self.alpha_list.max()
131
+ self.power_min = self.power_list.min()
132
+ self.power_max = self.power_list.max().round(4)
133
+
134
+ self._check_database()
135
+
136
+ def _check_database(self) -> None:
137
+ """Check the integrity of the lookup table.
138
+
139
+ Raises
140
+ ------
141
+ ValueError: If the lookup table is not 3-dimensional.
142
+ ValueError: If the lookup table does not have (4 * n_relaxation_mechanisms + 2) columns.
143
+ ValueError: If the lookup table contains NaN values.
144
+
145
+ """
146
+ if self.look_up_table.ndim != 3:
147
+ error_msg = "look_up_table must have 3 dimensions."
148
+ raise ValueError(error_msg)
149
+ if self.look_up_table.shape[2] != 4 * self.n_relaxation_mechanisms + 2:
150
+ error_msg = "look_up_table must have 4 * n_relaxation_mechanisms + 2 columns."
151
+ raise ValueError(error_msg)
152
+ if np.isnan(self.look_up_table).any():
153
+ error_msg = "look_up_table must not contain NaN values."
154
+ raise ValueError(error_msg)
155
+
156
+ def generate(
157
+ self,
158
+ alpha_coeff: NDArray[np.float64],
159
+ alpha_power: NDArray[np.float64],
160
+ ) -> dict[str, NDArray[np.float64]]:
161
+ """Generate relaxation parameters based on attenuation values.
162
+
163
+ Parameters
164
+ ----------
165
+ alpha_coeff : NDArray[np.float64]
166
+ Array of attenuation coefficients.
167
+ alpha_power : NDArray[np.float64]
168
+ Array of attenuation power values.
169
+
170
+ Returns
171
+ -------
172
+ dict[str, NDArray[np.float64]]
173
+ A dictionary containing the computed relaxation parameters.
174
+
175
+ """
176
+ if np.any(alpha_coeff < self.alpha_min) or np.any(alpha_power < self.power_min):
177
+ error_msg = (
178
+ "attenuation is out of range."
179
+ "the out-of-range values will be clipped to the min value."
180
+ f"alpha minimum: {self.alpha_min}, "
181
+ f"power minimum: {self.power_min}"
182
+ )
183
+ warnings.warn(error_msg, UserWarning, stacklevel=2)
184
+ if np.any(alpha_coeff > self.alpha_max) or np.any(alpha_power > self.power_max):
185
+ error_msg = (
186
+ "attenuation is out of range."
187
+ "the out-of-range values will be clipped to the max value."
188
+ f"alpha maximum: {self.alpha_max}, "
189
+ f"power maximum: {self.power_max}"
190
+ )
191
+ warnings.warn(error_msg, UserWarning, stacklevel=2)
192
+
193
+ alpha_coeff = np.clip(alpha_coeff, self.alpha_min, self.alpha_max)
194
+ alpha_power = np.clip(alpha_power, self.power_min, self.power_max)
195
+
196
+ # # Normalize to [0, 1] for the lookup table
197
+ # alpha_coeff = (alpha_coeff - self.alpha_min) / (self.alpha_max - self.alpha_min)
198
+ # alpha_power = (alpha_power - self.power_min) / (self.power_max - self.power_min)
199
+
200
+ input_data = np.stack([alpha_coeff, alpha_power], axis=-1)
201
+ # output = _map_parameters(input_data, self.look_up_table, self.alpha_list, self.power_list)
202
+ output = _map_parameters_search(
203
+ input_data,
204
+ self.look_up_table,
205
+ self.alpha_list,
206
+ self.power_list,
207
+ )
208
+
209
+ relaxation_param_dict = initialize_relaxation_param_dict(self.n_relaxation_mechanisms)
210
+ for i, key in enumerate(relaxation_param_dict.keys()):
211
+ relaxation_param_dict[key] = output[..., i]
212
+ return relaxation_param_dict
@@ -0,0 +1,197 @@
1
+ """Signal utilities."""
2
+
3
+ import numpy as np
4
+ from numpy.typing import NDArray
5
+
6
+ from fullwave.grid import Grid
7
+
8
+
9
+ def signed_power_compression(x: NDArray[np.float64], power: float = 1 / 3) -> NDArray[np.float64]:
10
+ """Apply signed power compression to the input array.
11
+
12
+ The function applies a power compression to the absolute value of the input array,
13
+ while preserving the sign of the original values.
14
+
15
+ Parameters
16
+ ----------
17
+ x: NDArray[np.float32]
18
+ Input array to apply power compression to.
19
+ power: float
20
+ Power compression factor. Default is 1/3.
21
+
22
+ Returns
23
+ -------
24
+ NDArray[np.float32]
25
+ Array with power compression applied.
26
+
27
+ """
28
+ return np.sign(x) * np.abs(x) ** power
29
+
30
+
31
+ def reshape_whole_sensor_to_nx_ny_nt(
32
+ sensor_output: NDArray[np.float64],
33
+ grid: Grid,
34
+ ) -> NDArray[np.float64]:
35
+ """Reshape sensor output to nx, ny, nt.
36
+
37
+ Parameters
38
+ ----------
39
+ sensor_output: NDArray[np.float64]
40
+ Sensor output.
41
+ grid: Grid
42
+ Grid instance.
43
+
44
+ Returns
45
+ -------
46
+ NDArray[np.float64]
47
+ Sensor output reshaped to [nx, ny, nt]
48
+
49
+ """
50
+ return sensor_output.reshape((grid.ny, grid.nx, sensor_output.shape[-1])).transpose(
51
+ 1,
52
+ 0,
53
+ 2,
54
+ )
55
+
56
+
57
+ def reshape_whole_sensor_to_nt_nx_ny(
58
+ sensor_output: NDArray[np.float64],
59
+ grid: Grid = None,
60
+ nx: int | None = None,
61
+ ny: int | None = None,
62
+ *,
63
+ use_grid: bool = True,
64
+ ) -> NDArray[np.float64]:
65
+ """Reshape sensor output to nt, nx, ny.
66
+
67
+ Parameters
68
+ ----------
69
+ sensor_output: NDArray[np.float64]
70
+ Sensor output.
71
+ grid: Grid
72
+ Grid instance.
73
+ nx: int | None
74
+ Number of grid points in x direction. If None, will use grid.nx.
75
+ ny: int | None
76
+ Number of grid points in y direction. If None, will use grid.ny.
77
+ use_grid: bool
78
+ If True, will use grid.nx and grid.ny. If False, will use nx and ny parameters.
79
+ Default is True.
80
+
81
+ Raises
82
+ ------
83
+ ValueError
84
+ If neither grid nor both nx and ny are provided.
85
+
86
+ Returns
87
+ -------
88
+ NDArray[np.float64]
89
+ Sensor output reshaped to [nt, nx, ny]
90
+
91
+ """
92
+ if grid is not None and (nx is not None or ny is not None):
93
+ error_msg = "Either grid or both nx and ny must be provided, not both."
94
+ raise ValueError(error_msg)
95
+
96
+ if use_grid:
97
+ nx = grid.nx
98
+ ny = grid.ny
99
+ elif nx is None or ny is None:
100
+ error_msg = "Either grid or both nx and ny must be provided."
101
+ raise ValueError(error_msg)
102
+ else:
103
+ nx = int(nx)
104
+ ny = int(ny)
105
+ return sensor_output.reshape((nx, ny, sensor_output.shape[-1])).transpose(
106
+ 2,
107
+ 0,
108
+ 1,
109
+ )
110
+
111
+
112
+ # def reshape_whole_sensor_to_nt_nx_ny_nz(
113
+ # sensor_output: NDArray[np.float64],
114
+ # grid: Grid,
115
+ # ) -> NDArray[np.float64]:
116
+ # """Reshape sensor output to nt, nx, ny.
117
+
118
+ # Parameters
119
+ # ----------
120
+ # sensor_output: NDArray[np.float64]
121
+ # Sensor output.
122
+ # grid: Grid
123
+ # Grid instance.
124
+
125
+ # Returns
126
+ # -------
127
+ # NDArray[np.float64]
128
+ # Sensor output reshaped to [nt, nx, ny]
129
+
130
+ # """
131
+ # return sensor_output.reshape((grid.nz, grid.ny, grid.nx, sensor_output.shape[-1])).transpose(
132
+ # 3,
133
+ # 2,
134
+ # 1,
135
+ # 0,
136
+ # )
137
+
138
+
139
+ def reshape_whole_sensor_to_nt_nx_ny_nz(
140
+ sensor_output: NDArray[np.float64],
141
+ grid: Grid = None,
142
+ nx: int | None = None,
143
+ ny: int | None = None,
144
+ nz: int | None = None,
145
+ *,
146
+ use_grid: bool = True,
147
+ ) -> NDArray[np.float64]:
148
+ """Reshape sensor output to nt, nx, ny.
149
+
150
+ Parameters
151
+ ----------
152
+ sensor_output: NDArray[np.float64]
153
+ Sensor output.
154
+ grid: Grid
155
+ Grid instance.
156
+ nx: int | None
157
+ Number of grid points in x direction. If None, will use grid.nx.
158
+ ny: int | None
159
+ Number of grid points in y direction. If None, will use grid.ny.
160
+ nz: int | None
161
+ Number of grid points in z direction. If None, will use grid.nz.
162
+ use_grid: bool
163
+ If True, will use grid.nx and grid.ny. If False, will use nx and ny parameters.
164
+ Default is True.
165
+
166
+ Raises
167
+ ------
168
+ ValueError
169
+ If neither grid nor both nx and ny are provided.
170
+
171
+ Returns
172
+ -------
173
+ NDArray[np.float64]
174
+ Sensor output reshaped to [nt, nx, ny]
175
+
176
+ """
177
+ if grid is not None and (nx is not None or ny is not None):
178
+ error_msg = "Either grid or both nx and ny must be provided, not both."
179
+ raise ValueError(error_msg)
180
+
181
+ if use_grid:
182
+ nx = grid.nx
183
+ ny = grid.ny
184
+ nz = grid.nz
185
+ elif nx is None or ny is None:
186
+ error_msg = "Either grid or both nx and ny must be provided."
187
+ raise ValueError(error_msg)
188
+ else:
189
+ nx = int(nx)
190
+ ny = int(ny)
191
+ nz = int(nz)
192
+ return sensor_output.reshape((nx, ny, nz, sensor_output.shape[-1])).transpose(
193
+ 3,
194
+ 0,
195
+ 1,
196
+ 2,
197
+ )