xtgeo 4.13.1__cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.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 xtgeo might be problematic. Click here for more details.

Files changed (654) hide show
  1. cxtgeo.py +558 -0
  2. cxtgeoPYTHON_wrap.c +19537 -0
  3. xtgeo/__init__.py +246 -0
  4. xtgeo/_cxtgeo.cpython-313-aarch64-linux-gnu.so +0 -0
  5. xtgeo/_internal.cpython-313-aarch64-linux-gnu.so +0 -0
  6. xtgeo/common/__init__.py +19 -0
  7. xtgeo/common/_angles.py +29 -0
  8. xtgeo/common/_xyz_enum.py +50 -0
  9. xtgeo/common/calc.py +396 -0
  10. xtgeo/common/constants.py +30 -0
  11. xtgeo/common/exceptions.py +42 -0
  12. xtgeo/common/log.py +93 -0
  13. xtgeo/common/sys.py +166 -0
  14. xtgeo/common/types.py +18 -0
  15. xtgeo/common/version.py +34 -0
  16. xtgeo/common/xtgeo_dialog.py +604 -0
  17. xtgeo/cube/__init__.py +9 -0
  18. xtgeo/cube/_cube_export.py +214 -0
  19. xtgeo/cube/_cube_import.py +532 -0
  20. xtgeo/cube/_cube_roxapi.py +180 -0
  21. xtgeo/cube/_cube_utils.py +287 -0
  22. xtgeo/cube/_cube_window_attributes.py +273 -0
  23. xtgeo/cube/cube1.py +1023 -0
  24. xtgeo/grid3d/__init__.py +15 -0
  25. xtgeo/grid3d/_ecl_grid.py +774 -0
  26. xtgeo/grid3d/_ecl_inte_head.py +152 -0
  27. xtgeo/grid3d/_ecl_logi_head.py +71 -0
  28. xtgeo/grid3d/_ecl_output_file.py +81 -0
  29. xtgeo/grid3d/_egrid.py +1004 -0
  30. xtgeo/grid3d/_find_gridprop_in_eclrun.py +625 -0
  31. xtgeo/grid3d/_grdecl_format.py +309 -0
  32. xtgeo/grid3d/_grdecl_grid.py +400 -0
  33. xtgeo/grid3d/_grid3d.py +29 -0
  34. xtgeo/grid3d/_grid3d_fence.py +284 -0
  35. xtgeo/grid3d/_grid3d_utils.py +228 -0
  36. xtgeo/grid3d/_grid_boundary.py +76 -0
  37. xtgeo/grid3d/_grid_etc1.py +1595 -0
  38. xtgeo/grid3d/_grid_export.py +222 -0
  39. xtgeo/grid3d/_grid_hybrid.py +50 -0
  40. xtgeo/grid3d/_grid_import.py +79 -0
  41. xtgeo/grid3d/_grid_import_ecl.py +101 -0
  42. xtgeo/grid3d/_grid_import_roff.py +135 -0
  43. xtgeo/grid3d/_grid_import_xtgcpgeom.py +375 -0
  44. xtgeo/grid3d/_grid_refine.py +258 -0
  45. xtgeo/grid3d/_grid_roxapi.py +292 -0
  46. xtgeo/grid3d/_grid_translate_coords.py +154 -0
  47. xtgeo/grid3d/_grid_wellzone.py +165 -0
  48. xtgeo/grid3d/_gridprop_export.py +202 -0
  49. xtgeo/grid3d/_gridprop_import_eclrun.py +164 -0
  50. xtgeo/grid3d/_gridprop_import_grdecl.py +130 -0
  51. xtgeo/grid3d/_gridprop_import_roff.py +52 -0
  52. xtgeo/grid3d/_gridprop_import_xtgcpprop.py +168 -0
  53. xtgeo/grid3d/_gridprop_lowlevel.py +171 -0
  54. xtgeo/grid3d/_gridprop_op1.py +272 -0
  55. xtgeo/grid3d/_gridprop_roxapi.py +301 -0
  56. xtgeo/grid3d/_gridprop_value_init.py +140 -0
  57. xtgeo/grid3d/_gridprops_import_eclrun.py +344 -0
  58. xtgeo/grid3d/_gridprops_import_roff.py +83 -0
  59. xtgeo/grid3d/_roff_grid.py +470 -0
  60. xtgeo/grid3d/_roff_parameter.py +303 -0
  61. xtgeo/grid3d/grid.py +2957 -0
  62. xtgeo/grid3d/grid_properties.py +699 -0
  63. xtgeo/grid3d/grid_property.py +1313 -0
  64. xtgeo/grid3d/types.py +15 -0
  65. xtgeo/include/eigen3/Eigen/Cholesky +45 -0
  66. xtgeo/include/eigen3/Eigen/CholmodSupport +48 -0
  67. xtgeo/include/eigen3/Eigen/Core +384 -0
  68. xtgeo/include/eigen3/Eigen/Dense +7 -0
  69. xtgeo/include/eigen3/Eigen/Eigen +2 -0
  70. xtgeo/include/eigen3/Eigen/Eigenvalues +60 -0
  71. xtgeo/include/eigen3/Eigen/Geometry +59 -0
  72. xtgeo/include/eigen3/Eigen/Householder +29 -0
  73. xtgeo/include/eigen3/Eigen/IterativeLinearSolvers +48 -0
  74. xtgeo/include/eigen3/Eigen/Jacobi +32 -0
  75. xtgeo/include/eigen3/Eigen/KLUSupport +41 -0
  76. xtgeo/include/eigen3/Eigen/LU +47 -0
  77. xtgeo/include/eigen3/Eigen/MetisSupport +35 -0
  78. xtgeo/include/eigen3/Eigen/OrderingMethods +70 -0
  79. xtgeo/include/eigen3/Eigen/PaStiXSupport +49 -0
  80. xtgeo/include/eigen3/Eigen/PardisoSupport +35 -0
  81. xtgeo/include/eigen3/Eigen/QR +50 -0
  82. xtgeo/include/eigen3/Eigen/QtAlignedMalloc +39 -0
  83. xtgeo/include/eigen3/Eigen/SPQRSupport +34 -0
  84. xtgeo/include/eigen3/Eigen/SVD +50 -0
  85. xtgeo/include/eigen3/Eigen/Sparse +34 -0
  86. xtgeo/include/eigen3/Eigen/SparseCholesky +37 -0
  87. xtgeo/include/eigen3/Eigen/SparseCore +69 -0
  88. xtgeo/include/eigen3/Eigen/SparseLU +50 -0
  89. xtgeo/include/eigen3/Eigen/SparseQR +36 -0
  90. xtgeo/include/eigen3/Eigen/StdDeque +27 -0
  91. xtgeo/include/eigen3/Eigen/StdList +26 -0
  92. xtgeo/include/eigen3/Eigen/StdVector +27 -0
  93. xtgeo/include/eigen3/Eigen/SuperLUSupport +64 -0
  94. xtgeo/include/eigen3/Eigen/UmfPackSupport +40 -0
  95. xtgeo/include/eigen3/Eigen/src/Cholesky/LDLT.h +688 -0
  96. xtgeo/include/eigen3/Eigen/src/Cholesky/LLT.h +558 -0
  97. xtgeo/include/eigen3/Eigen/src/Cholesky/LLT_LAPACKE.h +99 -0
  98. xtgeo/include/eigen3/Eigen/src/CholmodSupport/CholmodSupport.h +682 -0
  99. xtgeo/include/eigen3/Eigen/src/Core/ArithmeticSequence.h +413 -0
  100. xtgeo/include/eigen3/Eigen/src/Core/Array.h +417 -0
  101. xtgeo/include/eigen3/Eigen/src/Core/ArrayBase.h +226 -0
  102. xtgeo/include/eigen3/Eigen/src/Core/ArrayWrapper.h +209 -0
  103. xtgeo/include/eigen3/Eigen/src/Core/Assign.h +90 -0
  104. xtgeo/include/eigen3/Eigen/src/Core/AssignEvaluator.h +1010 -0
  105. xtgeo/include/eigen3/Eigen/src/Core/Assign_MKL.h +178 -0
  106. xtgeo/include/eigen3/Eigen/src/Core/BandMatrix.h +353 -0
  107. xtgeo/include/eigen3/Eigen/src/Core/Block.h +448 -0
  108. xtgeo/include/eigen3/Eigen/src/Core/BooleanRedux.h +162 -0
  109. xtgeo/include/eigen3/Eigen/src/Core/CommaInitializer.h +164 -0
  110. xtgeo/include/eigen3/Eigen/src/Core/ConditionEstimator.h +175 -0
  111. xtgeo/include/eigen3/Eigen/src/Core/CoreEvaluators.h +1741 -0
  112. xtgeo/include/eigen3/Eigen/src/Core/CoreIterators.h +132 -0
  113. xtgeo/include/eigen3/Eigen/src/Core/CwiseBinaryOp.h +183 -0
  114. xtgeo/include/eigen3/Eigen/src/Core/CwiseNullaryOp.h +1001 -0
  115. xtgeo/include/eigen3/Eigen/src/Core/CwiseTernaryOp.h +197 -0
  116. xtgeo/include/eigen3/Eigen/src/Core/CwiseUnaryOp.h +103 -0
  117. xtgeo/include/eigen3/Eigen/src/Core/CwiseUnaryView.h +132 -0
  118. xtgeo/include/eigen3/Eigen/src/Core/DenseBase.h +701 -0
  119. xtgeo/include/eigen3/Eigen/src/Core/DenseCoeffsBase.h +685 -0
  120. xtgeo/include/eigen3/Eigen/src/Core/DenseStorage.h +652 -0
  121. xtgeo/include/eigen3/Eigen/src/Core/Diagonal.h +258 -0
  122. xtgeo/include/eigen3/Eigen/src/Core/DiagonalMatrix.h +391 -0
  123. xtgeo/include/eigen3/Eigen/src/Core/DiagonalProduct.h +28 -0
  124. xtgeo/include/eigen3/Eigen/src/Core/Dot.h +318 -0
  125. xtgeo/include/eigen3/Eigen/src/Core/EigenBase.h +160 -0
  126. xtgeo/include/eigen3/Eigen/src/Core/ForceAlignedAccess.h +150 -0
  127. xtgeo/include/eigen3/Eigen/src/Core/Fuzzy.h +155 -0
  128. xtgeo/include/eigen3/Eigen/src/Core/GeneralProduct.h +465 -0
  129. xtgeo/include/eigen3/Eigen/src/Core/GenericPacketMath.h +1040 -0
  130. xtgeo/include/eigen3/Eigen/src/Core/GlobalFunctions.h +194 -0
  131. xtgeo/include/eigen3/Eigen/src/Core/IO.h +258 -0
  132. xtgeo/include/eigen3/Eigen/src/Core/IndexedView.h +237 -0
  133. xtgeo/include/eigen3/Eigen/src/Core/Inverse.h +117 -0
  134. xtgeo/include/eigen3/Eigen/src/Core/Map.h +171 -0
  135. xtgeo/include/eigen3/Eigen/src/Core/MapBase.h +310 -0
  136. xtgeo/include/eigen3/Eigen/src/Core/MathFunctions.h +2057 -0
  137. xtgeo/include/eigen3/Eigen/src/Core/MathFunctionsImpl.h +200 -0
  138. xtgeo/include/eigen3/Eigen/src/Core/Matrix.h +565 -0
  139. xtgeo/include/eigen3/Eigen/src/Core/MatrixBase.h +547 -0
  140. xtgeo/include/eigen3/Eigen/src/Core/NestByValue.h +85 -0
  141. xtgeo/include/eigen3/Eigen/src/Core/NoAlias.h +109 -0
  142. xtgeo/include/eigen3/Eigen/src/Core/NumTraits.h +335 -0
  143. xtgeo/include/eigen3/Eigen/src/Core/PartialReduxEvaluator.h +232 -0
  144. xtgeo/include/eigen3/Eigen/src/Core/PermutationMatrix.h +605 -0
  145. xtgeo/include/eigen3/Eigen/src/Core/PlainObjectBase.h +1128 -0
  146. xtgeo/include/eigen3/Eigen/src/Core/Product.h +191 -0
  147. xtgeo/include/eigen3/Eigen/src/Core/ProductEvaluators.h +1179 -0
  148. xtgeo/include/eigen3/Eigen/src/Core/Random.h +218 -0
  149. xtgeo/include/eigen3/Eigen/src/Core/Redux.h +515 -0
  150. xtgeo/include/eigen3/Eigen/src/Core/Ref.h +381 -0
  151. xtgeo/include/eigen3/Eigen/src/Core/Replicate.h +142 -0
  152. xtgeo/include/eigen3/Eigen/src/Core/Reshaped.h +454 -0
  153. xtgeo/include/eigen3/Eigen/src/Core/ReturnByValue.h +119 -0
  154. xtgeo/include/eigen3/Eigen/src/Core/Reverse.h +217 -0
  155. xtgeo/include/eigen3/Eigen/src/Core/Select.h +164 -0
  156. xtgeo/include/eigen3/Eigen/src/Core/SelfAdjointView.h +365 -0
  157. xtgeo/include/eigen3/Eigen/src/Core/SelfCwiseBinaryOp.h +47 -0
  158. xtgeo/include/eigen3/Eigen/src/Core/Solve.h +188 -0
  159. xtgeo/include/eigen3/Eigen/src/Core/SolveTriangular.h +235 -0
  160. xtgeo/include/eigen3/Eigen/src/Core/SolverBase.h +168 -0
  161. xtgeo/include/eigen3/Eigen/src/Core/StableNorm.h +251 -0
  162. xtgeo/include/eigen3/Eigen/src/Core/StlIterators.h +463 -0
  163. xtgeo/include/eigen3/Eigen/src/Core/Stride.h +116 -0
  164. xtgeo/include/eigen3/Eigen/src/Core/Swap.h +68 -0
  165. xtgeo/include/eigen3/Eigen/src/Core/Transpose.h +464 -0
  166. xtgeo/include/eigen3/Eigen/src/Core/Transpositions.h +386 -0
  167. xtgeo/include/eigen3/Eigen/src/Core/TriangularMatrix.h +1001 -0
  168. xtgeo/include/eigen3/Eigen/src/Core/VectorBlock.h +96 -0
  169. xtgeo/include/eigen3/Eigen/src/Core/VectorwiseOp.h +784 -0
  170. xtgeo/include/eigen3/Eigen/src/Core/Visitor.h +381 -0
  171. xtgeo/include/eigen3/Eigen/src/Core/arch/AVX/Complex.h +372 -0
  172. xtgeo/include/eigen3/Eigen/src/Core/arch/AVX/MathFunctions.h +228 -0
  173. xtgeo/include/eigen3/Eigen/src/Core/arch/AVX/PacketMath.h +1574 -0
  174. xtgeo/include/eigen3/Eigen/src/Core/arch/AVX/TypeCasting.h +115 -0
  175. xtgeo/include/eigen3/Eigen/src/Core/arch/AVX512/Complex.h +422 -0
  176. xtgeo/include/eigen3/Eigen/src/Core/arch/AVX512/MathFunctions.h +362 -0
  177. xtgeo/include/eigen3/Eigen/src/Core/arch/AVX512/PacketMath.h +2303 -0
  178. xtgeo/include/eigen3/Eigen/src/Core/arch/AVX512/TypeCasting.h +89 -0
  179. xtgeo/include/eigen3/Eigen/src/Core/arch/AltiVec/Complex.h +417 -0
  180. xtgeo/include/eigen3/Eigen/src/Core/arch/AltiVec/MathFunctions.h +90 -0
  181. xtgeo/include/eigen3/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2937 -0
  182. xtgeo/include/eigen3/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +221 -0
  183. xtgeo/include/eigen3/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +629 -0
  184. xtgeo/include/eigen3/Eigen/src/Core/arch/AltiVec/PacketMath.h +2711 -0
  185. xtgeo/include/eigen3/Eigen/src/Core/arch/CUDA/Complex.h +258 -0
  186. xtgeo/include/eigen3/Eigen/src/Core/arch/Default/BFloat16.h +700 -0
  187. xtgeo/include/eigen3/Eigen/src/Core/arch/Default/ConjHelper.h +117 -0
  188. xtgeo/include/eigen3/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1649 -0
  189. xtgeo/include/eigen3/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +110 -0
  190. xtgeo/include/eigen3/Eigen/src/Core/arch/Default/Half.h +942 -0
  191. xtgeo/include/eigen3/Eigen/src/Core/arch/Default/Settings.h +49 -0
  192. xtgeo/include/eigen3/Eigen/src/Core/arch/Default/TypeCasting.h +120 -0
  193. xtgeo/include/eigen3/Eigen/src/Core/arch/GPU/MathFunctions.h +103 -0
  194. xtgeo/include/eigen3/Eigen/src/Core/arch/GPU/PacketMath.h +1685 -0
  195. xtgeo/include/eigen3/Eigen/src/Core/arch/GPU/TypeCasting.h +80 -0
  196. xtgeo/include/eigen3/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
  197. xtgeo/include/eigen3/Eigen/src/Core/arch/MSA/Complex.h +648 -0
  198. xtgeo/include/eigen3/Eigen/src/Core/arch/MSA/MathFunctions.h +387 -0
  199. xtgeo/include/eigen3/Eigen/src/Core/arch/MSA/PacketMath.h +1233 -0
  200. xtgeo/include/eigen3/Eigen/src/Core/arch/NEON/Complex.h +584 -0
  201. xtgeo/include/eigen3/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +183 -0
  202. xtgeo/include/eigen3/Eigen/src/Core/arch/NEON/MathFunctions.h +75 -0
  203. xtgeo/include/eigen3/Eigen/src/Core/arch/NEON/PacketMath.h +4587 -0
  204. xtgeo/include/eigen3/Eigen/src/Core/arch/NEON/TypeCasting.h +1419 -0
  205. xtgeo/include/eigen3/Eigen/src/Core/arch/SSE/Complex.h +351 -0
  206. xtgeo/include/eigen3/Eigen/src/Core/arch/SSE/MathFunctions.h +199 -0
  207. xtgeo/include/eigen3/Eigen/src/Core/arch/SSE/PacketMath.h +1505 -0
  208. xtgeo/include/eigen3/Eigen/src/Core/arch/SSE/TypeCasting.h +142 -0
  209. xtgeo/include/eigen3/Eigen/src/Core/arch/SVE/MathFunctions.h +44 -0
  210. xtgeo/include/eigen3/Eigen/src/Core/arch/SVE/PacketMath.h +752 -0
  211. xtgeo/include/eigen3/Eigen/src/Core/arch/SVE/TypeCasting.h +49 -0
  212. xtgeo/include/eigen3/Eigen/src/Core/arch/SYCL/InteropHeaders.h +232 -0
  213. xtgeo/include/eigen3/Eigen/src/Core/arch/SYCL/MathFunctions.h +301 -0
  214. xtgeo/include/eigen3/Eigen/src/Core/arch/SYCL/PacketMath.h +670 -0
  215. xtgeo/include/eigen3/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +694 -0
  216. xtgeo/include/eigen3/Eigen/src/Core/arch/SYCL/TypeCasting.h +85 -0
  217. xtgeo/include/eigen3/Eigen/src/Core/arch/ZVector/Complex.h +426 -0
  218. xtgeo/include/eigen3/Eigen/src/Core/arch/ZVector/MathFunctions.h +233 -0
  219. xtgeo/include/eigen3/Eigen/src/Core/arch/ZVector/PacketMath.h +1060 -0
  220. xtgeo/include/eigen3/Eigen/src/Core/functors/AssignmentFunctors.h +177 -0
  221. xtgeo/include/eigen3/Eigen/src/Core/functors/BinaryFunctors.h +541 -0
  222. xtgeo/include/eigen3/Eigen/src/Core/functors/NullaryFunctors.h +189 -0
  223. xtgeo/include/eigen3/Eigen/src/Core/functors/StlFunctors.h +166 -0
  224. xtgeo/include/eigen3/Eigen/src/Core/functors/TernaryFunctors.h +25 -0
  225. xtgeo/include/eigen3/Eigen/src/Core/functors/UnaryFunctors.h +1131 -0
  226. xtgeo/include/eigen3/Eigen/src/Core/products/GeneralBlockPanelKernel.h +2645 -0
  227. xtgeo/include/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix.h +517 -0
  228. xtgeo/include/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +317 -0
  229. xtgeo/include/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +145 -0
  230. xtgeo/include/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +124 -0
  231. xtgeo/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h +518 -0
  232. xtgeo/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +136 -0
  233. xtgeo/include/eigen3/Eigen/src/Core/products/Parallelizer.h +180 -0
  234. xtgeo/include/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +544 -0
  235. xtgeo/include/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +295 -0
  236. xtgeo/include/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector.h +262 -0
  237. xtgeo/include/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +118 -0
  238. xtgeo/include/eigen3/Eigen/src/Core/products/SelfadjointProduct.h +133 -0
  239. xtgeo/include/eigen3/Eigen/src/Core/products/SelfadjointRank2Update.h +94 -0
  240. xtgeo/include/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix.h +472 -0
  241. xtgeo/include/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +317 -0
  242. xtgeo/include/eigen3/Eigen/src/Core/products/TriangularMatrixVector.h +350 -0
  243. xtgeo/include/eigen3/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +255 -0
  244. xtgeo/include/eigen3/Eigen/src/Core/products/TriangularSolverMatrix.h +337 -0
  245. xtgeo/include/eigen3/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +167 -0
  246. xtgeo/include/eigen3/Eigen/src/Core/products/TriangularSolverVector.h +148 -0
  247. xtgeo/include/eigen3/Eigen/src/Core/util/BlasUtil.h +583 -0
  248. xtgeo/include/eigen3/Eigen/src/Core/util/ConfigureVectorization.h +512 -0
  249. xtgeo/include/eigen3/Eigen/src/Core/util/Constants.h +563 -0
  250. xtgeo/include/eigen3/Eigen/src/Core/util/DisableStupidWarnings.h +106 -0
  251. xtgeo/include/eigen3/Eigen/src/Core/util/ForwardDeclarations.h +322 -0
  252. xtgeo/include/eigen3/Eigen/src/Core/util/IndexedViewHelper.h +186 -0
  253. xtgeo/include/eigen3/Eigen/src/Core/util/IntegralConstant.h +272 -0
  254. xtgeo/include/eigen3/Eigen/src/Core/util/MKL_support.h +137 -0
  255. xtgeo/include/eigen3/Eigen/src/Core/util/Macros.h +1464 -0
  256. xtgeo/include/eigen3/Eigen/src/Core/util/Memory.h +1163 -0
  257. xtgeo/include/eigen3/Eigen/src/Core/util/Meta.h +812 -0
  258. xtgeo/include/eigen3/Eigen/src/Core/util/NonMPL2.h +3 -0
  259. xtgeo/include/eigen3/Eigen/src/Core/util/ReenableStupidWarnings.h +31 -0
  260. xtgeo/include/eigen3/Eigen/src/Core/util/ReshapedHelper.h +51 -0
  261. xtgeo/include/eigen3/Eigen/src/Core/util/StaticAssert.h +221 -0
  262. xtgeo/include/eigen3/Eigen/src/Core/util/SymbolicIndex.h +293 -0
  263. xtgeo/include/eigen3/Eigen/src/Core/util/XprHelper.h +856 -0
  264. xtgeo/include/eigen3/Eigen/src/Eigenvalues/ComplexEigenSolver.h +346 -0
  265. xtgeo/include/eigen3/Eigen/src/Eigenvalues/ComplexSchur.h +462 -0
  266. xtgeo/include/eigen3/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +91 -0
  267. xtgeo/include/eigen3/Eigen/src/Eigenvalues/EigenSolver.h +622 -0
  268. xtgeo/include/eigen3/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +418 -0
  269. xtgeo/include/eigen3/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +226 -0
  270. xtgeo/include/eigen3/Eigen/src/Eigenvalues/HessenbergDecomposition.h +374 -0
  271. xtgeo/include/eigen3/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +158 -0
  272. xtgeo/include/eigen3/Eigen/src/Eigenvalues/RealQZ.h +657 -0
  273. xtgeo/include/eigen3/Eigen/src/Eigenvalues/RealSchur.h +558 -0
  274. xtgeo/include/eigen3/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +77 -0
  275. xtgeo/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +904 -0
  276. xtgeo/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +87 -0
  277. xtgeo/include/eigen3/Eigen/src/Eigenvalues/Tridiagonalization.h +561 -0
  278. xtgeo/include/eigen3/Eigen/src/Geometry/AlignedBox.h +486 -0
  279. xtgeo/include/eigen3/Eigen/src/Geometry/AngleAxis.h +247 -0
  280. xtgeo/include/eigen3/Eigen/src/Geometry/EulerAngles.h +114 -0
  281. xtgeo/include/eigen3/Eigen/src/Geometry/Homogeneous.h +501 -0
  282. xtgeo/include/eigen3/Eigen/src/Geometry/Hyperplane.h +282 -0
  283. xtgeo/include/eigen3/Eigen/src/Geometry/OrthoMethods.h +235 -0
  284. xtgeo/include/eigen3/Eigen/src/Geometry/ParametrizedLine.h +232 -0
  285. xtgeo/include/eigen3/Eigen/src/Geometry/Quaternion.h +870 -0
  286. xtgeo/include/eigen3/Eigen/src/Geometry/Rotation2D.h +199 -0
  287. xtgeo/include/eigen3/Eigen/src/Geometry/RotationBase.h +206 -0
  288. xtgeo/include/eigen3/Eigen/src/Geometry/Scaling.h +188 -0
  289. xtgeo/include/eigen3/Eigen/src/Geometry/Transform.h +1563 -0
  290. xtgeo/include/eigen3/Eigen/src/Geometry/Translation.h +202 -0
  291. xtgeo/include/eigen3/Eigen/src/Geometry/Umeyama.h +166 -0
  292. xtgeo/include/eigen3/Eigen/src/Geometry/arch/Geometry_SIMD.h +168 -0
  293. xtgeo/include/eigen3/Eigen/src/Householder/BlockHouseholder.h +110 -0
  294. xtgeo/include/eigen3/Eigen/src/Householder/Householder.h +176 -0
  295. xtgeo/include/eigen3/Eigen/src/Householder/HouseholderSequence.h +545 -0
  296. xtgeo/include/eigen3/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +226 -0
  297. xtgeo/include/eigen3/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +212 -0
  298. xtgeo/include/eigen3/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +229 -0
  299. xtgeo/include/eigen3/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +394 -0
  300. xtgeo/include/eigen3/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +453 -0
  301. xtgeo/include/eigen3/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +444 -0
  302. xtgeo/include/eigen3/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +198 -0
  303. xtgeo/include/eigen3/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +117 -0
  304. xtgeo/include/eigen3/Eigen/src/Jacobi/Jacobi.h +483 -0
  305. xtgeo/include/eigen3/Eigen/src/KLUSupport/KLUSupport.h +358 -0
  306. xtgeo/include/eigen3/Eigen/src/LU/Determinant.h +117 -0
  307. xtgeo/include/eigen3/Eigen/src/LU/FullPivLU.h +877 -0
  308. xtgeo/include/eigen3/Eigen/src/LU/InverseImpl.h +432 -0
  309. xtgeo/include/eigen3/Eigen/src/LU/PartialPivLU.h +624 -0
  310. xtgeo/include/eigen3/Eigen/src/LU/PartialPivLU_LAPACKE.h +83 -0
  311. xtgeo/include/eigen3/Eigen/src/LU/arch/InverseSize4.h +351 -0
  312. xtgeo/include/eigen3/Eigen/src/MetisSupport/MetisSupport.h +137 -0
  313. xtgeo/include/eigen3/Eigen/src/OrderingMethods/Amd.h +435 -0
  314. xtgeo/include/eigen3/Eigen/src/OrderingMethods/Eigen_Colamd.h +1863 -0
  315. xtgeo/include/eigen3/Eigen/src/OrderingMethods/Ordering.h +153 -0
  316. xtgeo/include/eigen3/Eigen/src/PaStiXSupport/PaStiXSupport.h +678 -0
  317. xtgeo/include/eigen3/Eigen/src/PardisoSupport/PardisoSupport.h +545 -0
  318. xtgeo/include/eigen3/Eigen/src/QR/ColPivHouseholderQR.h +674 -0
  319. xtgeo/include/eigen3/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +97 -0
  320. xtgeo/include/eigen3/Eigen/src/QR/CompleteOrthogonalDecomposition.h +635 -0
  321. xtgeo/include/eigen3/Eigen/src/QR/FullPivHouseholderQR.h +713 -0
  322. xtgeo/include/eigen3/Eigen/src/QR/HouseholderQR.h +434 -0
  323. xtgeo/include/eigen3/Eigen/src/QR/HouseholderQR_LAPACKE.h +68 -0
  324. xtgeo/include/eigen3/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +335 -0
  325. xtgeo/include/eigen3/Eigen/src/SVD/BDCSVD.h +1366 -0
  326. xtgeo/include/eigen3/Eigen/src/SVD/JacobiSVD.h +812 -0
  327. xtgeo/include/eigen3/Eigen/src/SVD/JacobiSVD_LAPACKE.h +91 -0
  328. xtgeo/include/eigen3/Eigen/src/SVD/SVDBase.h +376 -0
  329. xtgeo/include/eigen3/Eigen/src/SVD/UpperBidiagonalization.h +414 -0
  330. xtgeo/include/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky.h +697 -0
  331. xtgeo/include/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +174 -0
  332. xtgeo/include/eigen3/Eigen/src/SparseCore/AmbiVector.h +378 -0
  333. xtgeo/include/eigen3/Eigen/src/SparseCore/CompressedStorage.h +274 -0
  334. xtgeo/include/eigen3/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +352 -0
  335. xtgeo/include/eigen3/Eigen/src/SparseCore/MappedSparseMatrix.h +67 -0
  336. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseAssign.h +270 -0
  337. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseBlock.h +571 -0
  338. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseColEtree.h +206 -0
  339. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseCompressedBase.h +370 -0
  340. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +722 -0
  341. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +150 -0
  342. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseDenseProduct.h +342 -0
  343. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseDiagonalProduct.h +138 -0
  344. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseDot.h +98 -0
  345. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseFuzzy.h +29 -0
  346. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseMap.h +305 -0
  347. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseMatrix.h +1518 -0
  348. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseMatrixBase.h +398 -0
  349. xtgeo/include/eigen3/Eigen/src/SparseCore/SparsePermutation.h +178 -0
  350. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseProduct.h +181 -0
  351. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseRedux.h +49 -0
  352. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseRef.h +397 -0
  353. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseSelfAdjointView.h +659 -0
  354. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseSolverBase.h +124 -0
  355. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +198 -0
  356. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseTranspose.h +92 -0
  357. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseTriangularView.h +189 -0
  358. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseUtil.h +186 -0
  359. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseVector.h +478 -0
  360. xtgeo/include/eigen3/Eigen/src/SparseCore/SparseView.h +254 -0
  361. xtgeo/include/eigen3/Eigen/src/SparseCore/TriangularSolver.h +315 -0
  362. xtgeo/include/eigen3/Eigen/src/SparseLU/SparseLU.h +923 -0
  363. xtgeo/include/eigen3/Eigen/src/SparseLU/SparseLUImpl.h +66 -0
  364. xtgeo/include/eigen3/Eigen/src/SparseLU/SparseLU_Memory.h +226 -0
  365. xtgeo/include/eigen3/Eigen/src/SparseLU/SparseLU_Structs.h +110 -0
  366. xtgeo/include/eigen3/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +375 -0
  367. xtgeo/include/eigen3/Eigen/src/SparseLU/SparseLU_Utils.h +80 -0
  368. xtgeo/include/eigen3/Eigen/src/SparseLU/SparseLU_column_bmod.h +181 -0
  369. xtgeo/include/eigen3/Eigen/src/SparseLU/SparseLU_column_dfs.h +179 -0
  370. xtgeo/include/eigen3/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +107 -0
  371. xtgeo/include/eigen3/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +280 -0
  372. xtgeo/include/eigen3/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +126 -0
  373. xtgeo/include/eigen3/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +130 -0
  374. xtgeo/include/eigen3/Eigen/src/SparseLU/SparseLU_panel_bmod.h +223 -0
  375. xtgeo/include/eigen3/Eigen/src/SparseLU/SparseLU_panel_dfs.h +258 -0
  376. xtgeo/include/eigen3/Eigen/src/SparseLU/SparseLU_pivotL.h +137 -0
  377. xtgeo/include/eigen3/Eigen/src/SparseLU/SparseLU_pruneL.h +136 -0
  378. xtgeo/include/eigen3/Eigen/src/SparseLU/SparseLU_relax_snode.h +83 -0
  379. xtgeo/include/eigen3/Eigen/src/SparseQR/SparseQR.h +758 -0
  380. xtgeo/include/eigen3/Eigen/src/StlSupport/StdDeque.h +116 -0
  381. xtgeo/include/eigen3/Eigen/src/StlSupport/StdList.h +106 -0
  382. xtgeo/include/eigen3/Eigen/src/StlSupport/StdVector.h +131 -0
  383. xtgeo/include/eigen3/Eigen/src/StlSupport/details.h +84 -0
  384. xtgeo/include/eigen3/Eigen/src/SuperLUSupport/SuperLUSupport.h +1025 -0
  385. xtgeo/include/eigen3/Eigen/src/UmfPackSupport/UmfPackSupport.h +642 -0
  386. xtgeo/include/eigen3/Eigen/src/misc/Image.h +82 -0
  387. xtgeo/include/eigen3/Eigen/src/misc/Kernel.h +79 -0
  388. xtgeo/include/eigen3/Eigen/src/misc/RealSvd2x2.h +55 -0
  389. xtgeo/include/eigen3/Eigen/src/misc/blas.h +440 -0
  390. xtgeo/include/eigen3/Eigen/src/misc/lapack.h +152 -0
  391. xtgeo/include/eigen3/Eigen/src/misc/lapacke.h +16292 -0
  392. xtgeo/include/eigen3/Eigen/src/misc/lapacke_mangling.h +17 -0
  393. xtgeo/include/eigen3/Eigen/src/plugins/ArrayCwiseBinaryOps.h +358 -0
  394. xtgeo/include/eigen3/Eigen/src/plugins/ArrayCwiseUnaryOps.h +696 -0
  395. xtgeo/include/eigen3/Eigen/src/plugins/BlockMethods.h +1442 -0
  396. xtgeo/include/eigen3/Eigen/src/plugins/CommonCwiseBinaryOps.h +115 -0
  397. xtgeo/include/eigen3/Eigen/src/plugins/CommonCwiseUnaryOps.h +177 -0
  398. xtgeo/include/eigen3/Eigen/src/plugins/IndexedViewMethods.h +262 -0
  399. xtgeo/include/eigen3/Eigen/src/plugins/MatrixCwiseBinaryOps.h +152 -0
  400. xtgeo/include/eigen3/Eigen/src/plugins/MatrixCwiseUnaryOps.h +95 -0
  401. xtgeo/include/eigen3/Eigen/src/plugins/ReshapedMethods.h +149 -0
  402. xtgeo/include/eigen3/signature_of_eigen3_matrix_library +1 -0
  403. xtgeo/include/eigen3/unsupported/Eigen/AdolcForward +159 -0
  404. xtgeo/include/eigen3/unsupported/Eigen/AlignedVector3 +234 -0
  405. xtgeo/include/eigen3/unsupported/Eigen/ArpackSupport +30 -0
  406. xtgeo/include/eigen3/unsupported/Eigen/AutoDiff +46 -0
  407. xtgeo/include/eigen3/unsupported/Eigen/BVH +95 -0
  408. xtgeo/include/eigen3/unsupported/Eigen/CXX11/Tensor +137 -0
  409. xtgeo/include/eigen3/unsupported/Eigen/CXX11/TensorSymmetry +42 -0
  410. xtgeo/include/eigen3/unsupported/Eigen/CXX11/ThreadPool +74 -0
  411. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/Tensor.h +554 -0
  412. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h +329 -0
  413. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h +247 -0
  414. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h +1176 -0
  415. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h +1559 -0
  416. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h +1093 -0
  417. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h +518 -0
  418. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h +377 -0
  419. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h +1023 -0
  420. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionBlocking.h +73 -0
  421. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionCuda.h +6 -0
  422. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionGpu.h +1413 -0
  423. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h +575 -0
  424. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionSycl.h +1650 -0
  425. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +1679 -0
  426. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h +456 -0
  427. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h +1132 -0
  428. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorConvolutionSycl.h +544 -0
  429. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorCostModel.h +214 -0
  430. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorCustomOp.h +347 -0
  431. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDevice.h +137 -0
  432. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceCuda.h +6 -0
  433. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceDefault.h +104 -0
  434. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceGpu.h +389 -0
  435. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h +1048 -0
  436. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +409 -0
  437. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDimensionList.h +236 -0
  438. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h +490 -0
  439. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorEvalTo.h +236 -0
  440. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h +983 -0
  441. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h +703 -0
  442. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorExpr.h +388 -0
  443. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorFFT.h +669 -0
  444. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h +379 -0
  445. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h +237 -0
  446. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorForwardDeclarations.h +191 -0
  447. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h +488 -0
  448. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h +302 -0
  449. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorGlobalFunctions.h +33 -0
  450. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h +99 -0
  451. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaUndefines.h +44 -0
  452. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorIO.h +79 -0
  453. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h +603 -0
  454. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h +738 -0
  455. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorInflation.h +247 -0
  456. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorInitializer.h +82 -0
  457. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h +263 -0
  458. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorLayoutSwap.h +216 -0
  459. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h +98 -0
  460. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h +327 -0
  461. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h +311 -0
  462. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h +1102 -0
  463. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h +708 -0
  464. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h +291 -0
  465. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorRandom.h +322 -0
  466. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h +998 -0
  467. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h +6 -0
  468. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReductionGpu.h +966 -0
  469. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReductionSycl.h +582 -0
  470. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorRef.h +454 -0
  471. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h +465 -0
  472. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h +528 -0
  473. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorScanSycl.h +513 -0
  474. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +471 -0
  475. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h +161 -0
  476. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h +346 -0
  477. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorTrace.h +303 -0
  478. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h +264 -0
  479. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorUInt128.h +249 -0
  480. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h +629 -0
  481. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/TensorSymmetry/DynamicSymmetry.h +293 -0
  482. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/TensorSymmetry/StaticSymmetry.h +236 -0
  483. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/TensorSymmetry/Symmetry.h +338 -0
  484. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/TensorSymmetry/util/TemplateGroupTheory.h +669 -0
  485. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/Barrier.h +67 -0
  486. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/EventCount.h +249 -0
  487. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h +486 -0
  488. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/RunQueue.h +236 -0
  489. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadCancel.h +23 -0
  490. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadEnvironment.h +40 -0
  491. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadLocal.h +301 -0
  492. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadPoolInterface.h +48 -0
  493. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadYield.h +20 -0
  494. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/util/CXX11Meta.h +537 -0
  495. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/util/CXX11Workarounds.h +88 -0
  496. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/util/EmulateArray.h +261 -0
  497. xtgeo/include/eigen3/unsupported/Eigen/CXX11/src/util/MaxSizeVector.h +158 -0
  498. xtgeo/include/eigen3/unsupported/Eigen/EulerAngles +43 -0
  499. xtgeo/include/eigen3/unsupported/Eigen/FFT +419 -0
  500. xtgeo/include/eigen3/unsupported/Eigen/IterativeSolvers +51 -0
  501. xtgeo/include/eigen3/unsupported/Eigen/KroneckerProduct +36 -0
  502. xtgeo/include/eigen3/unsupported/Eigen/LevenbergMarquardt +49 -0
  503. xtgeo/include/eigen3/unsupported/Eigen/MPRealSupport +213 -0
  504. xtgeo/include/eigen3/unsupported/Eigen/MatrixFunctions +504 -0
  505. xtgeo/include/eigen3/unsupported/Eigen/MoreVectorization +24 -0
  506. xtgeo/include/eigen3/unsupported/Eigen/NonLinearOptimization +140 -0
  507. xtgeo/include/eigen3/unsupported/Eigen/NumericalDiff +56 -0
  508. xtgeo/include/eigen3/unsupported/Eigen/OpenGLSupport +322 -0
  509. xtgeo/include/eigen3/unsupported/Eigen/Polynomials +137 -0
  510. xtgeo/include/eigen3/unsupported/Eigen/Skyline +39 -0
  511. xtgeo/include/eigen3/unsupported/Eigen/SparseExtra +54 -0
  512. xtgeo/include/eigen3/unsupported/Eigen/SpecialFunctions +103 -0
  513. xtgeo/include/eigen3/unsupported/Eigen/Splines +35 -0
  514. xtgeo/include/eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffJacobian.h +108 -0
  515. xtgeo/include/eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +730 -0
  516. xtgeo/include/eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffVector.h +220 -0
  517. xtgeo/include/eigen3/unsupported/Eigen/src/BVH/BVAlgorithms.h +293 -0
  518. xtgeo/include/eigen3/unsupported/Eigen/src/BVH/KdBVH.h +223 -0
  519. xtgeo/include/eigen3/unsupported/Eigen/src/Eigenvalues/ArpackSelfAdjointEigenSolver.h +790 -0
  520. xtgeo/include/eigen3/unsupported/Eigen/src/EulerAngles/EulerAngles.h +355 -0
  521. xtgeo/include/eigen3/unsupported/Eigen/src/EulerAngles/EulerSystem.h +305 -0
  522. xtgeo/include/eigen3/unsupported/Eigen/src/FFT/ei_fftw_impl.h +261 -0
  523. xtgeo/include/eigen3/unsupported/Eigen/src/FFT/ei_kissfft_impl.h +449 -0
  524. xtgeo/include/eigen3/unsupported/Eigen/src/IterativeSolvers/ConstrainedConjGrad.h +187 -0
  525. xtgeo/include/eigen3/unsupported/Eigen/src/IterativeSolvers/DGMRES.h +511 -0
  526. xtgeo/include/eigen3/unsupported/Eigen/src/IterativeSolvers/GMRES.h +335 -0
  527. xtgeo/include/eigen3/unsupported/Eigen/src/IterativeSolvers/IDRS.h +436 -0
  528. xtgeo/include/eigen3/unsupported/Eigen/src/IterativeSolvers/IncompleteLU.h +90 -0
  529. xtgeo/include/eigen3/unsupported/Eigen/src/IterativeSolvers/IterationController.h +154 -0
  530. xtgeo/include/eigen3/unsupported/Eigen/src/IterativeSolvers/MINRES.h +267 -0
  531. xtgeo/include/eigen3/unsupported/Eigen/src/IterativeSolvers/Scaling.h +193 -0
  532. xtgeo/include/eigen3/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h +305 -0
  533. xtgeo/include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LMcovar.h +84 -0
  534. xtgeo/include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LMonestep.h +202 -0
  535. xtgeo/include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LMpar.h +160 -0
  536. xtgeo/include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LMqrsolv.h +188 -0
  537. xtgeo/include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LevenbergMarquardt.h +396 -0
  538. xtgeo/include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h +441 -0
  539. xtgeo/include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h +569 -0
  540. xtgeo/include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h +373 -0
  541. xtgeo/include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h +705 -0
  542. xtgeo/include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h +368 -0
  543. xtgeo/include/eigen3/unsupported/Eigen/src/MatrixFunctions/StemFunction.h +117 -0
  544. xtgeo/include/eigen3/unsupported/Eigen/src/MoreVectorization/MathFunctions.h +95 -0
  545. xtgeo/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/HybridNonLinearSolver.h +601 -0
  546. xtgeo/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/LevenbergMarquardt.h +657 -0
  547. xtgeo/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/chkder.h +66 -0
  548. xtgeo/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/covar.h +70 -0
  549. xtgeo/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/dogleg.h +107 -0
  550. xtgeo/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/fdjac1.h +79 -0
  551. xtgeo/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/lmpar.h +298 -0
  552. xtgeo/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/qrsolv.h +91 -0
  553. xtgeo/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/r1mpyq.h +30 -0
  554. xtgeo/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/r1updt.h +99 -0
  555. xtgeo/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/rwupdt.h +49 -0
  556. xtgeo/include/eigen3/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h +130 -0
  557. xtgeo/include/eigen3/unsupported/Eigen/src/Polynomials/Companion.h +280 -0
  558. xtgeo/include/eigen3/unsupported/Eigen/src/Polynomials/PolynomialSolver.h +428 -0
  559. xtgeo/include/eigen3/unsupported/Eigen/src/Polynomials/PolynomialUtils.h +143 -0
  560. xtgeo/include/eigen3/unsupported/Eigen/src/Skyline/SkylineInplaceLU.h +352 -0
  561. xtgeo/include/eigen3/unsupported/Eigen/src/Skyline/SkylineMatrix.h +862 -0
  562. xtgeo/include/eigen3/unsupported/Eigen/src/Skyline/SkylineMatrixBase.h +212 -0
  563. xtgeo/include/eigen3/unsupported/Eigen/src/Skyline/SkylineProduct.h +295 -0
  564. xtgeo/include/eigen3/unsupported/Eigen/src/Skyline/SkylineStorage.h +259 -0
  565. xtgeo/include/eigen3/unsupported/Eigen/src/Skyline/SkylineUtil.h +89 -0
  566. xtgeo/include/eigen3/unsupported/Eigen/src/SparseExtra/BlockOfDynamicSparseMatrix.h +122 -0
  567. xtgeo/include/eigen3/unsupported/Eigen/src/SparseExtra/BlockSparseMatrix.h +1079 -0
  568. xtgeo/include/eigen3/unsupported/Eigen/src/SparseExtra/DynamicSparseMatrix.h +404 -0
  569. xtgeo/include/eigen3/unsupported/Eigen/src/SparseExtra/MarketIO.h +282 -0
  570. xtgeo/include/eigen3/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h +247 -0
  571. xtgeo/include/eigen3/unsupported/Eigen/src/SparseExtra/RandomSetter.h +349 -0
  572. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsArrayAPI.h +286 -0
  573. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsBFloat16.h +68 -0
  574. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsFunctors.h +357 -0
  575. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsHalf.h +66 -0
  576. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsImpl.h +1959 -0
  577. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsPacketMath.h +118 -0
  578. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/HipVectorCompatibility.h +67 -0
  579. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsArrayAPI.h +167 -0
  580. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsBFloat16.h +58 -0
  581. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsFunctors.h +330 -0
  582. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsHalf.h +58 -0
  583. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsImpl.h +2045 -0
  584. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsPacketMath.h +79 -0
  585. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/AVX/BesselFunctions.h +46 -0
  586. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/AVX/SpecialFunctions.h +16 -0
  587. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/AVX512/BesselFunctions.h +46 -0
  588. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/AVX512/SpecialFunctions.h +16 -0
  589. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/GPU/SpecialFunctions.h +369 -0
  590. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/NEON/BesselFunctions.h +54 -0
  591. xtgeo/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/NEON/SpecialFunctions.h +34 -0
  592. xtgeo/include/eigen3/unsupported/Eigen/src/Splines/Spline.h +507 -0
  593. xtgeo/include/eigen3/unsupported/Eigen/src/Splines/SplineFitting.h +431 -0
  594. xtgeo/include/eigen3/unsupported/Eigen/src/Splines/SplineFwd.h +93 -0
  595. xtgeo/io/__init__.py +1 -0
  596. xtgeo/io/_file.py +594 -0
  597. xtgeo/metadata/__init__.py +17 -0
  598. xtgeo/metadata/metadata.py +435 -0
  599. xtgeo/roxutils/__init__.py +7 -0
  600. xtgeo/roxutils/_roxar_loader.py +54 -0
  601. xtgeo/roxutils/_roxutils_etc.py +122 -0
  602. xtgeo/roxutils/roxutils.py +207 -0
  603. xtgeo/share/eigen3/cmake/Eigen3Config.cmake +37 -0
  604. xtgeo/share/eigen3/cmake/Eigen3ConfigVersion.cmake +65 -0
  605. xtgeo/share/eigen3/cmake/Eigen3Targets.cmake +106 -0
  606. xtgeo/share/eigen3/cmake/UseEigen3.cmake +6 -0
  607. xtgeo/share/pkgconfig/eigen3.pc +9 -0
  608. xtgeo/surface/__init__.py +18 -0
  609. xtgeo/surface/_regsurf_boundary.py +26 -0
  610. xtgeo/surface/_regsurf_cube.py +210 -0
  611. xtgeo/surface/_regsurf_cube_window.py +391 -0
  612. xtgeo/surface/_regsurf_cube_window_v2.py +297 -0
  613. xtgeo/surface/_regsurf_cube_window_v3.py +360 -0
  614. xtgeo/surface/_regsurf_export.py +388 -0
  615. xtgeo/surface/_regsurf_grid3d.py +275 -0
  616. xtgeo/surface/_regsurf_gridding.py +347 -0
  617. xtgeo/surface/_regsurf_ijxyz_parser.py +278 -0
  618. xtgeo/surface/_regsurf_import.py +347 -0
  619. xtgeo/surface/_regsurf_lowlevel.py +122 -0
  620. xtgeo/surface/_regsurf_oper.py +538 -0
  621. xtgeo/surface/_regsurf_roxapi.py +241 -0
  622. xtgeo/surface/_regsurf_utils.py +81 -0
  623. xtgeo/surface/_surfs_import.py +43 -0
  624. xtgeo/surface/_zmap_parser.py +138 -0
  625. xtgeo/surface/regular_surface.py +2962 -0
  626. xtgeo/surface/surfaces.py +276 -0
  627. xtgeo/well/__init__.py +24 -0
  628. xtgeo/well/_blockedwell_roxapi.py +241 -0
  629. xtgeo/well/_blockedwells_roxapi.py +68 -0
  630. xtgeo/well/_well_aux.py +30 -0
  631. xtgeo/well/_well_io.py +327 -0
  632. xtgeo/well/_well_oper.py +483 -0
  633. xtgeo/well/_well_roxapi.py +304 -0
  634. xtgeo/well/_wellmarkers.py +486 -0
  635. xtgeo/well/_wells_utils.py +158 -0
  636. xtgeo/well/blocked_well.py +220 -0
  637. xtgeo/well/blocked_wells.py +134 -0
  638. xtgeo/well/well1.py +1516 -0
  639. xtgeo/well/wells.py +211 -0
  640. xtgeo/xyz/__init__.py +6 -0
  641. xtgeo/xyz/_polygons_oper.py +272 -0
  642. xtgeo/xyz/_xyz.py +758 -0
  643. xtgeo/xyz/_xyz_data.py +646 -0
  644. xtgeo/xyz/_xyz_io.py +737 -0
  645. xtgeo/xyz/_xyz_lowlevel.py +42 -0
  646. xtgeo/xyz/_xyz_oper.py +613 -0
  647. xtgeo/xyz/_xyz_roxapi.py +766 -0
  648. xtgeo/xyz/points.py +698 -0
  649. xtgeo/xyz/polygons.py +827 -0
  650. xtgeo-4.13.1.dist-info/METADATA +146 -0
  651. xtgeo-4.13.1.dist-info/RECORD +654 -0
  652. xtgeo-4.13.1.dist-info/WHEEL +6 -0
  653. xtgeo-4.13.1.dist-info/licenses/LICENSE.md +165 -0
  654. xtgeo.libs/libgomp-a49a47f9.so.1.0.0 +0 -0
@@ -0,0 +1,1595 @@
1
+ """Private module, Grid ETC 1 methods, info/modify/report."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from copy import deepcopy
6
+ from functools import lru_cache
7
+ from math import atan2, degrees
8
+ from typing import TYPE_CHECKING, Literal, no_type_check
9
+
10
+ import numpy as np
11
+ import pandas as pd
12
+ from packaging.version import parse as versionparse
13
+
14
+ import xtgeo._internal as _internal # type: ignore
15
+ from xtgeo import _cxtgeo
16
+ from xtgeo._internal.geometry import PointInHexahedronMethod as M # type: ignore
17
+ from xtgeo.common.constants import UNDEF_INT, UNDEF_LIMIT
18
+ from xtgeo.common.log import null_logger
19
+ from xtgeo.common.types import Dimensions
20
+ from xtgeo.grid3d.grid_properties import GridProperties
21
+ from xtgeo.xyz.polygons import Polygons
22
+
23
+ from . import _gridprop_lowlevel
24
+ from .grid_property import GridProperty
25
+
26
+ if TYPE_CHECKING:
27
+ from xtgeo.grid3d import Grid
28
+ from xtgeo.grid3d.types import METRIC
29
+ from xtgeo.surface.regular_surface import RegularSurface
30
+ from xtgeo.surface.surfaces import Surfaces
31
+ from xtgeo.xyz.points import Points
32
+
33
+ logger = null_logger(__name__)
34
+
35
+
36
+ def create_box(
37
+ dimension: Dimensions,
38
+ origin: tuple[float, float, float],
39
+ oricenter: bool,
40
+ increment: tuple[int, int, int],
41
+ rotation: float,
42
+ flip: Literal[1, -1],
43
+ ) -> dict[str, np.ndarray]:
44
+ """Create a shoebox grid from cubi'sh spec, xtgformat=2."""
45
+
46
+ from xtgeo.cube.cube1 import Cube
47
+
48
+ ncol, nrow, nlay = dimension
49
+ nncol = ncol + 1
50
+ nnrow = nrow + 1
51
+ nnlay = nlay + 1
52
+
53
+ coordsv = np.zeros((nncol, nnrow, 6), dtype=np.float64)
54
+ zcornsv = np.zeros((nncol, nnrow, nnlay, 4), dtype=np.float32)
55
+ actnumsv = np.zeros((ncol, nrow, nlay), dtype=np.int32)
56
+
57
+ cube = Cube(
58
+ ncol=ncol,
59
+ nrow=nrow,
60
+ nlay=nlay,
61
+ xinc=increment[0],
62
+ yinc=increment[1],
63
+ zinc=increment[2],
64
+ xori=origin[0],
65
+ yori=origin[1],
66
+ zori=origin[2],
67
+ rotation=rotation,
68
+ )
69
+
70
+ cubecpp = _internal.cube.Cube(cube)
71
+ logger.debug("Calling CPP internal 'create_grid_from_cube'...")
72
+ coordsv, zcornsv, actnumsv = _internal.grid3d.create_grid_from_cube(
73
+ cubecpp, oricenter, flip
74
+ )
75
+ return {
76
+ "coordsv": coordsv,
77
+ "zcornsv": zcornsv,
78
+ "actnumsv": actnumsv.astype(np.int32),
79
+ }
80
+
81
+
82
+ def create_grid_from_surfaces(
83
+ srfs: Surfaces,
84
+ ij_dimension: tuple[int, int] | None = None,
85
+ ij_origin: tuple[float, float] | None = None,
86
+ ij_increment: tuple[float, float] | None = None,
87
+ rotation: float | None = None,
88
+ tolerance: float = _internal.numerics.TOLERANCE,
89
+ ) -> Grid:
90
+ """Use a stack of surfaces to create a nonfaulted grid.
91
+
92
+ Technically, a shoebox grid is made first, then the layers are adjusted to follow
93
+ surfaces.
94
+ """
95
+ from xtgeo.grid3d.grid import Grid, create_box_grid
96
+
97
+ n_surfaces = len(srfs.surfaces)
98
+
99
+ # ensure that surfaces are consistent
100
+ if not srfs.is_depth_consistent():
101
+ raise ValueError(
102
+ "Surfaces are not depth consistent, they must not cross is depth"
103
+ )
104
+ top = srfs.surfaces[0]
105
+ base = srfs.surfaces[-1]
106
+
107
+ zinc = (base.values.mean() - top.values.mean()) / (n_surfaces - 1)
108
+ kdim: int = n_surfaces - 1
109
+ zori = top.values.mean()
110
+ ncol: int = top.ncol - 1 # since surface are nodes while grid is cell centered
111
+ nrow: int = top.nrow - 1
112
+
113
+ if ij_dimension: # mypy needs this:
114
+ dimension = Dimensions(int(ij_dimension[0]), int(ij_dimension[1]), kdim)
115
+ else:
116
+ dimension = Dimensions(ncol, nrow, kdim)
117
+
118
+ increment = (*ij_increment, zinc) if ij_increment else (top.xinc, top.yinc, zinc)
119
+ origin = (*ij_origin, zori) if ij_origin else (top.xori, top.yori, zori)
120
+ rotation = rotation if rotation is not None else top.rotation
121
+
122
+ bgrd = create_box_grid(
123
+ dimension=dimension,
124
+ origin=origin,
125
+ increment=increment,
126
+ rotation=rotation,
127
+ oricenter=False,
128
+ flip=1,
129
+ )
130
+
131
+ # now adjust the grid to surfaces
132
+ surf_list = []
133
+ for surf in srfs.surfaces:
134
+ cpp_surf = _internal.regsurf.RegularSurface(surf)
135
+ surf_list.append(cpp_surf)
136
+
137
+ new_zcorns, new_actnum = bgrd._get_grid_cpp().adjust_boxgrid_layers_from_regsurfs(
138
+ surf_list, tolerance
139
+ )
140
+
141
+ grd = Grid(coordsv=bgrd._coordsv.copy(), zcornsv=new_zcorns, actnumsv=new_actnum)
142
+
143
+ # set the subgrid index (zones)
144
+ subgrids = {f"zone_{i + 1}": 1 for i in range(n_surfaces - 1)}
145
+ grd.set_subgrids(subgrids)
146
+
147
+ return grd
148
+
149
+
150
+ method_factory = {
151
+ "euclid": _cxtgeo.euclid_length,
152
+ "horizontal": _cxtgeo.horizontal_length,
153
+ "east west vertical": _cxtgeo.east_west_vertical_length,
154
+ "north south vertical": _cxtgeo.north_south_vertical_length,
155
+ "x projection": _cxtgeo.x_projection,
156
+ "y projection": _cxtgeo.y_projection,
157
+ "z projection": _cxtgeo.z_projection,
158
+ }
159
+
160
+
161
+ def get_dz(
162
+ self: Grid,
163
+ name: str = "dZ",
164
+ flip: bool = True,
165
+ asmasked: bool = True,
166
+ metric: METRIC = "z projection",
167
+ ) -> GridProperty:
168
+ """Get average cell height (dz) as property.
169
+
170
+ Args:
171
+ flip (bool): whether to flip the z direction, ie. increasing z is
172
+ increasing depth (defaults to True)
173
+ asmasked (bool): Whether to mask property by whether
174
+ name (str): Name of resulting grid property, defaults to "dZ".
175
+ """
176
+ if metric not in method_factory:
177
+ raise ValueError(f"Unknown metric {metric}")
178
+ metric_fun = method_factory[metric]
179
+
180
+ self._set_xtgformat2()
181
+ nx, ny, nz = self.dimensions
182
+ result = np.zeros(nx * ny * nz)
183
+ _cxtgeo.grdcp3d_calc_dz(
184
+ self._ncol,
185
+ self._nrow,
186
+ self._nlay,
187
+ self._coordsv.ravel(),
188
+ self._zcornsv.ravel(),
189
+ result,
190
+ metric_fun,
191
+ )
192
+
193
+ if not flip:
194
+ result *= -1
195
+
196
+ if asmasked:
197
+ result = np.ma.masked_array(result, self._actnumsv == 0)
198
+
199
+ return GridProperty(
200
+ ncol=self._ncol,
201
+ nrow=self._nrow,
202
+ nlay=self._nlay,
203
+ values=result.ravel(),
204
+ name=name,
205
+ discrete=False,
206
+ )
207
+
208
+
209
+ @lru_cache(maxsize=1)
210
+ def get_dx(
211
+ self: Grid, name: str = "dX", asmasked: bool = False, metric: METRIC = "horizontal"
212
+ ) -> GridProperty:
213
+ if metric not in method_factory:
214
+ raise ValueError(f"Unknown metric {metric}")
215
+ metric_fun = method_factory[metric]
216
+
217
+ self._set_xtgformat2()
218
+ nx, ny, nz = self.dimensions
219
+ result = np.zeros(nx * ny * nz)
220
+ _cxtgeo.grdcp3d_calc_dx(
221
+ self._ncol,
222
+ self._nrow,
223
+ self._nlay,
224
+ self._coordsv.ravel(),
225
+ self._zcornsv.ravel(),
226
+ result,
227
+ metric_fun,
228
+ )
229
+
230
+ result = np.ma.masked_array(result, self._actnumsv == 0 if asmasked else False)
231
+
232
+ return GridProperty(
233
+ ncol=self._ncol,
234
+ nrow=self._nrow,
235
+ nlay=self._nlay,
236
+ values=result.reshape((nx, ny, nz)),
237
+ name=name,
238
+ discrete=False,
239
+ )
240
+
241
+
242
+ @lru_cache(maxsize=1)
243
+ def get_dy(
244
+ self: Grid, name: str = "dY", asmasked: bool = False, metric: METRIC = "horizontal"
245
+ ) -> GridProperty:
246
+ if metric not in method_factory:
247
+ raise ValueError(f"Unknown metric {metric}")
248
+ metric_fun = method_factory[metric]
249
+
250
+ self._set_xtgformat2()
251
+ nx, ny, nz = self.dimensions
252
+ result = np.zeros(nx * ny * nz)
253
+ _cxtgeo.grdcp3d_calc_dy(
254
+ self._ncol,
255
+ self._nrow,
256
+ self._nlay,
257
+ self._coordsv.ravel(),
258
+ self._zcornsv.ravel(),
259
+ result,
260
+ metric_fun,
261
+ )
262
+
263
+ result = np.ma.masked_array(result, self._actnumsv == 0 if asmasked else False)
264
+
265
+ return GridProperty(
266
+ ncol=self._ncol,
267
+ nrow=self._nrow,
268
+ nlay=self._nlay,
269
+ values=result.reshape((nx, ny, nz)),
270
+ name=name,
271
+ discrete=False,
272
+ )
273
+
274
+
275
+ def get_bulk_volume(
276
+ grid: Grid,
277
+ name: str = "bulkvol",
278
+ asmasked: bool = True,
279
+ precision: Literal[1, 2, 4] = 2,
280
+ ) -> GridProperty:
281
+ """Get cell bulk volume as a GridProperty() instance."""
282
+ if precision not in (1, 2, 4):
283
+ raise ValueError("The precision key has an invalid entry, use 1, 2, or 4")
284
+
285
+ grid._set_xtgformat2()
286
+
287
+ grid_cpp = grid._get_grid_cpp()
288
+
289
+ prec_cpp = _internal.geometry.HexVolumePrecision.P2
290
+ if precision == 1:
291
+ prec_cpp = _internal.geometry.HexVolumePrecision.P1
292
+ elif precision == 4:
293
+ prec_cpp = _internal.geometry.HexVolumePrecision.P4
294
+
295
+ bulk_values = grid_cpp.get_cell_volumes(prec_cpp, asmasked)
296
+ if asmasked:
297
+ bulk_values = np.ma.masked_greater(bulk_values, UNDEF_LIMIT)
298
+
299
+ return GridProperty(
300
+ ncol=grid.ncol,
301
+ nrow=grid.nrow,
302
+ nlay=grid.nlay,
303
+ name=name,
304
+ values=bulk_values,
305
+ discrete=False,
306
+ )
307
+
308
+
309
+ def get_heights_above_ffl(
310
+ grid: Grid,
311
+ ffl: GridProperty,
312
+ option: Literal[
313
+ "cell_center_above_ffl",
314
+ "cell_corners_above_ffl",
315
+ "truncated_cell_corners_above_ffl",
316
+ ] = "cell_center_above_ffl",
317
+ ) -> tuple[GridProperty, GridProperty, GridProperty]:
318
+ """Compute delta heights for cell top, bottom and midpoints above a given level."""
319
+
320
+ valid_options = (
321
+ "cell_center_above_ffl",
322
+ "cell_corners_above_ffl",
323
+ "truncated_cell_corners_above_ffl",
324
+ )
325
+ if option not in valid_options:
326
+ raise ValueError(
327
+ f"The option key <{option}> is invalid, must be one of {valid_options}"
328
+ )
329
+ if option == "cell_center_above_ffl":
330
+ option_flag = _internal.grid3d.HeightAboveFFLOption.CellCenter
331
+ elif option == "cell_corners_above_ffl":
332
+ option_flag = _internal.grid3d.HeightAboveFFLOption.CellCorners
333
+ else:
334
+ option_flag = _internal.grid3d.HeightAboveFFLOption.TruncatedCellCorners
335
+
336
+ grid._set_xtgformat2()
337
+
338
+ grid_cpp = grid._get_grid_cpp()
339
+ htop_arr, hbot_arr, hmid_arr = grid_cpp.get_height_above_ffl(
340
+ ffl.values.ravel(), option_flag
341
+ )
342
+
343
+ htop = GridProperty(
344
+ ncol=grid.ncol,
345
+ nrow=grid.nrow,
346
+ nlay=grid.nlay,
347
+ name="htop",
348
+ values=htop_arr,
349
+ discrete=False,
350
+ )
351
+ hbot = GridProperty(
352
+ ncol=grid.ncol,
353
+ nrow=grid.nrow,
354
+ nlay=grid.nlay,
355
+ name="hbot",
356
+ values=hbot_arr,
357
+ discrete=False,
358
+ )
359
+ hmid = GridProperty(
360
+ ncol=grid.ncol,
361
+ nrow=grid.nrow,
362
+ nlay=grid.nlay,
363
+ name="hmid",
364
+ values=hmid_arr,
365
+ discrete=False,
366
+ )
367
+ return htop, hbot, hmid
368
+
369
+
370
+ def get_property_between_surfaces(
371
+ grid: Grid,
372
+ top: RegularSurface,
373
+ base: RegularSurface,
374
+ value: int = 1,
375
+ name: str = "between_surfaces",
376
+ ) -> GridProperty:
377
+ """For a grid, create a grid property with value <value> between two surfaces.
378
+
379
+ The value would be zero elsewhere, or if surfaces has inactive nodes.
380
+ """
381
+ if not isinstance(value, int) or value < 1:
382
+ raise ValueError(f"Value (integer) must be positive, >= 1, got: {value}")
383
+
384
+ grid._set_xtgformat2()
385
+ logger.debug("Creating property between surfaces...")
386
+
387
+ grid_cpp = grid._get_grid_cpp()
388
+
389
+ top_ = top
390
+ base_ = base
391
+ if top.yflip == -1:
392
+ top_ = top.copy()
393
+ top_.make_lefthanded()
394
+ logger.debug("Top surface is right-handed, flipping a copy prior to operation")
395
+ if base.yflip == -1:
396
+ base_ = base.copy()
397
+ base_.make_lefthanded()
398
+ logger.debug("Base surface is right-handed, flipping a copy prior to operation")
399
+
400
+ diff = base_ - top_
401
+ if (diff.values).all() <= 0:
402
+ raise ValueError(
403
+ "Top surface must be equal or above base surface for all nodes"
404
+ )
405
+
406
+ # array is always 0, 1 integer
407
+ array = grid_cpp.get_gridprop_value_between_surfaces(
408
+ _internal.regsurf.RegularSurface(top_),
409
+ _internal.regsurf.RegularSurface(base_),
410
+ )
411
+
412
+ logger.debug("Creating property between surfaces... done")
413
+
414
+ return GridProperty(
415
+ ncol=grid.ncol,
416
+ nrow=grid.nrow,
417
+ nlay=grid.nlay,
418
+ name=name,
419
+ values=array * value,
420
+ discrete=True,
421
+ )
422
+
423
+
424
+ def get_ijk(
425
+ self: Grid,
426
+ names: tuple[str, str, str] = ("IX", "JY", "KZ"),
427
+ asmasked: bool = True,
428
+ zerobased: bool = False,
429
+ ) -> tuple[GridProperty, GridProperty, GridProperty]:
430
+ """Get I J K as properties."""
431
+ ashape = self.dimensions
432
+
433
+ ix_idx, jy_idx, kz_idx = np.indices(ashape)
434
+
435
+ ix = ix_idx.ravel()
436
+ jy = jy_idx.ravel()
437
+ kz = kz_idx.ravel()
438
+
439
+ if asmasked:
440
+ actnum = self.get_actnum()
441
+
442
+ ix = np.ma.masked_where(actnum.values1d == 0, ix)
443
+ jy = np.ma.masked_where(actnum.values1d == 0, jy)
444
+ kz = np.ma.masked_where(actnum.values1d == 0, kz)
445
+
446
+ if not zerobased:
447
+ ix += 1
448
+ jy += 1
449
+ kz += 1
450
+
451
+ ix_gprop = GridProperty(
452
+ ncol=self._ncol,
453
+ nrow=self._nrow,
454
+ nlay=self._nlay,
455
+ values=ix.reshape(ashape),
456
+ name=names[0],
457
+ discrete=True,
458
+ )
459
+ jy_gprop = GridProperty(
460
+ ncol=self._ncol,
461
+ nrow=self._nrow,
462
+ nlay=self._nlay,
463
+ values=jy.reshape(ashape),
464
+ name=names[1],
465
+ discrete=True,
466
+ )
467
+ kz_gprop = GridProperty(
468
+ ncol=self._ncol,
469
+ nrow=self._nrow,
470
+ nlay=self._nlay,
471
+ values=kz.reshape(ashape),
472
+ name=names[2],
473
+ discrete=True,
474
+ )
475
+
476
+ # return the objects
477
+ return ix_gprop, jy_gprop, kz_gprop
478
+
479
+
480
+ def get_ijk_from_points(
481
+ self: Grid,
482
+ points: Points,
483
+ activeonly: bool = True,
484
+ zerobased: bool = False,
485
+ dataframe: bool = True,
486
+ includepoints: bool = True,
487
+ columnnames: tuple[str, str, str] = ("IX", "JY", "KZ"),
488
+ fmt: Literal["int", "float"] = "int",
489
+ undef: int = -1,
490
+ ) -> pd.DataFrame | list:
491
+ """Get I J K indices as a list of tuples or a dataframe.
492
+
493
+ It is here tried to get fast execution. This requires a preprosessing
494
+ of the grid to store a onelayer version, and maps with IJ positions. This is
495
+ stored as a cache variable we can derive.
496
+ """
497
+ logger.info("Getting IJK indices from Points...")
498
+
499
+ self._set_xtgformat2()
500
+
501
+ cache = self._get_cache()
502
+
503
+ points_df = points.get_dataframe(copy=False)
504
+
505
+ p_array = points.get_xyz_arrays()
506
+
507
+ iarr, jarr, karr = self._get_grid_cpp().get_indices_from_pointset(
508
+ _internal.xyz.PointSet(p_array),
509
+ cache.onegrid_cpp,
510
+ cache.top_i_index_cpp,
511
+ cache.top_j_index_cpp,
512
+ cache.base_i_index_cpp,
513
+ cache.base_j_index_cpp,
514
+ cache.top_depth_cpp,
515
+ cache.base_depth_cpp,
516
+ cache.threshold_magic_1,
517
+ activeonly,
518
+ M.Optimized,
519
+ )
520
+
521
+ if not zerobased:
522
+ iarr = np.where(iarr >= 0, iarr + 1, iarr)
523
+ jarr = np.where(jarr >= 0, jarr + 1, jarr)
524
+ karr = np.where(karr >= 0, karr + 1, karr)
525
+
526
+ proplist = {}
527
+ if includepoints:
528
+ proplist["X_UTME"] = points_df[points.xname].to_numpy()
529
+ proplist["Y_UTMN"] = points_df[points.yname].to_numpy()
530
+ proplist["Z_TVDSS"] = points_df[points.zname].to_numpy()
531
+
532
+ proplist[columnnames[0]] = iarr
533
+ proplist[columnnames[1]] = jarr
534
+ proplist[columnnames[2]] = karr
535
+
536
+ mydataframe = pd.DataFrame.from_dict(proplist)
537
+ mydataframe = mydataframe.replace(UNDEF_INT, -1)
538
+
539
+ if fmt == "float":
540
+ mydataframe[columnnames[0]] = mydataframe[columnnames[0]].astype("float")
541
+ mydataframe[columnnames[1]] = mydataframe[columnnames[1]].astype("float")
542
+ mydataframe[columnnames[2]] = mydataframe[columnnames[2]].astype("float")
543
+
544
+ if undef != -1:
545
+ mydataframe[columnnames[0]] = mydataframe[columnnames[0]].replace(-1, undef)
546
+ mydataframe[columnnames[1]] = mydataframe[columnnames[1]].replace(-1, undef)
547
+ mydataframe[columnnames[2]] = mydataframe[columnnames[2]].replace(-1, undef)
548
+
549
+ logger.info(
550
+ "Getting IJK indices from Points... done, found %d points", len(mydataframe)
551
+ )
552
+ if dataframe:
553
+ return mydataframe
554
+
555
+ return list(mydataframe.itertuples(index=False, name=None))
556
+
557
+
558
+ @lru_cache(maxsize=1)
559
+ def get_xyz(
560
+ self: Grid,
561
+ names: tuple[str, str, str] = ("X_UTME", "Y_UTMN", "Z_TVDSS"),
562
+ asmasked: bool = True,
563
+ ) -> tuple[GridProperty, GridProperty, GridProperty]:
564
+ """Get X Y Z as properties."""
565
+
566
+ self._set_xtgformat2()
567
+
568
+ # note: using _internal here is 2-3 times faster than using the former cxtgeo!
569
+ grid_cpp = self._get_grid_cpp()
570
+ xv, yv, zv = grid_cpp.get_cell_centers(asmasked)
571
+
572
+ xv = np.ma.masked_invalid(xv)
573
+ yv = np.ma.masked_invalid(yv)
574
+ zv = np.ma.masked_invalid(zv)
575
+
576
+ xo = GridProperty(
577
+ ncol=self._ncol,
578
+ nrow=self._nrow,
579
+ nlay=self._nlay,
580
+ values=xv,
581
+ name=names[0],
582
+ discrete=False,
583
+ )
584
+
585
+ yo = GridProperty(
586
+ ncol=self._ncol,
587
+ nrow=self._nrow,
588
+ nlay=self._nlay,
589
+ values=yv,
590
+ name=names[1],
591
+ discrete=False,
592
+ )
593
+
594
+ zo = GridProperty(
595
+ ncol=self._ncol,
596
+ nrow=self._nrow,
597
+ nlay=self._nlay,
598
+ values=zv,
599
+ name=names[2],
600
+ discrete=False,
601
+ )
602
+
603
+ # return the objects
604
+ return xo, yo, zo
605
+
606
+
607
+ def get_xyz_cell_corners_internal(
608
+ grid: Grid,
609
+ ijk: tuple[int, int, int] = (1, 1, 1),
610
+ activeonly: bool = True,
611
+ zerobased: bool = False,
612
+ ) -> tuple[int, ...] | None:
613
+ """Get X Y Z cell corners for one cell."""
614
+ grid._set_xtgformat2()
615
+
616
+ i, j, k = ijk
617
+ shift = 1 if zerobased else 0
618
+
619
+ if activeonly:
620
+ actnum = grid.get_actnum()
621
+ iact = actnum.values[i - 1 + shift, j - 1 + shift, k - 1 + shift]
622
+ if np.all(iact == 0):
623
+ return None
624
+
625
+ # there are some cases where we don't want to use cache due to recusion issues
626
+ corners = grid._get_grid_cpp().get_cell_corners_from_ijk(
627
+ i + shift - 1,
628
+ j + shift - 1,
629
+ k + shift - 1,
630
+ )
631
+
632
+ corners = corners.to_numpy().flatten().tolist()
633
+ return tuple(corners)
634
+
635
+
636
+ def get_xyz_corners(
637
+ self: Grid, names: tuple[str, str, str] = ("X_UTME", "Y_UTMN", "Z_TVDSS")
638
+ ) -> tuple[GridProperty, ...]:
639
+ """Get X Y Z cell corners for all cells (as 24 GridProperty objects)."""
640
+ self._set_xtgformat1()
641
+
642
+ ntot = self.dimensions
643
+
644
+ grid_props = []
645
+
646
+ for i in range(8):
647
+ xname = names[0] + str(i)
648
+ yname = names[1] + str(i)
649
+ zname = names[2] + str(i)
650
+ x = GridProperty(
651
+ ncol=self._ncol,
652
+ nrow=self._nrow,
653
+ nlay=self._nlay,
654
+ values=np.zeros(ntot, dtype=np.float64),
655
+ name=xname,
656
+ discrete=False,
657
+ )
658
+
659
+ y = GridProperty(
660
+ ncol=self._ncol,
661
+ nrow=self._nrow,
662
+ nlay=self._nlay,
663
+ values=np.zeros(ntot, dtype=np.float64),
664
+ name=yname,
665
+ discrete=False,
666
+ )
667
+
668
+ z = GridProperty(
669
+ ncol=self._ncol,
670
+ nrow=self._nrow,
671
+ nlay=self._nlay,
672
+ values=np.zeros(ntot, dtype=np.float64),
673
+ name=zname,
674
+ discrete=False,
675
+ )
676
+
677
+ grid_props.append(x)
678
+ grid_props.append(y)
679
+ grid_props.append(z)
680
+
681
+ ptr_coord = []
682
+ for i in range(24):
683
+ some = _cxtgeo.new_doublearray(self.ntotal)
684
+ ptr_coord.append(some)
685
+ logger.debug("SWIG object %s %s", i, some)
686
+
687
+ option = 0
688
+
689
+ # note, fool the argument list to unpack ptr_coord with * ...
690
+ _cxtgeo.grd3d_get_all_corners(
691
+ self._ncol,
692
+ self._nrow,
693
+ self._nlay,
694
+ self._coordsv,
695
+ self._zcornsv,
696
+ self._actnumsv,
697
+ *(ptr_coord + [option]),
698
+ )
699
+
700
+ for i in range(0, 24, 3):
701
+ _gridprop_lowlevel.update_values_from_carray(
702
+ grid_props[i], ptr_coord[i], np.float64, delete=True
703
+ )
704
+
705
+ _gridprop_lowlevel.update_values_from_carray(
706
+ grid_props[i + 1], ptr_coord[i + 1], np.float64, delete=True
707
+ )
708
+
709
+ _gridprop_lowlevel.update_values_from_carray(
710
+ grid_props[i + 2], ptr_coord[i + 2], np.float64, delete=True
711
+ )
712
+
713
+ # return the 24 objects (x1, y1, z1, ... x8, y8, z8)
714
+ return tuple(grid_props)
715
+
716
+
717
+ def get_vtk_esg_geometry_data(
718
+ self: Grid,
719
+ ) -> tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]:
720
+ """Get geometry data consisting of vertices and cell connectivities suitable for
721
+ use with VTK's vtkExplicitStructuredGrid.
722
+
723
+ Returned tuple contains:
724
+ - numpy array with dimensions in terms of points (not cells)
725
+ - vertex array, numpy array with vertex coordinates
726
+ - connectivity array for all the cells, numpy array with integer indices
727
+ - inactive cell indices, numpy array with integer indices
728
+ """
729
+
730
+ self._set_xtgformat2()
731
+
732
+ # Number of elements to allocate in the vertex and connectivity arrays
733
+ num_cells = self.ncol * self.nrow * self.nlay
734
+ n_vertex_arr = 3 * 8 * num_cells
735
+ n_conn_arr = 8 * num_cells
736
+
737
+ # Note first value in return tuple which is the actual number of vertices that
738
+ # was written into vertex_arr and which we'll use to shrink the array.
739
+ vertex_count, vertex_arr, conn_arr = _cxtgeo.grdcp3d_get_vtk_esg_geometry_data(
740
+ self.ncol,
741
+ self.nrow,
742
+ self.nlay,
743
+ self._coordsv,
744
+ self._zcornsv,
745
+ n_vertex_arr,
746
+ n_conn_arr,
747
+ )
748
+
749
+ # Need to shrink the vertex array
750
+ vertex_arr = np.resize(vertex_arr, 3 * vertex_count)
751
+ vertex_arr = vertex_arr.reshape(-1, 3)
752
+
753
+ point_dims = np.asarray((self.ncol, self.nrow, self.nlay)) + 1
754
+ inact_indices = self.get_actnum_indices(order="F", inverse=True)
755
+
756
+ return point_dims, vertex_arr, conn_arr, inact_indices
757
+
758
+
759
+ def get_vtk_geometries(self: Grid) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
760
+ """Return actnum, corners and dims arrays for VTK ExplicitStructuredGrid usage."""
761
+ self._set_xtgformat2()
762
+
763
+ narr = 8 * self.ncol * self.nrow * self.nlay
764
+ xarr, yarr, zarr = _cxtgeo.grdcp3d_get_vtk_grid_arrays(
765
+ self.ncol,
766
+ self.nrow,
767
+ self.nlay,
768
+ self._coordsv,
769
+ self._zcornsv,
770
+ narr,
771
+ narr,
772
+ narr,
773
+ )
774
+ corners = np.stack((xarr, yarr, zarr))
775
+ corners = corners.transpose()
776
+
777
+ dims = np.asarray((self.ncol, self.nrow, self.nlay)) + 1
778
+
779
+ actindices = self.get_actnum_indices(order="F", inverse=True)
780
+
781
+ return dims, corners, actindices
782
+
783
+
784
+ def get_cell_volume(
785
+ grid: Grid,
786
+ ijk: tuple[int, int, int] = (1, 1, 1),
787
+ activeonly: bool = True,
788
+ zerobased: bool = False,
789
+ precision: Literal[1, 2, 4] = 2,
790
+ ) -> float | None:
791
+ """Get bulk cell volume for one cell."""
792
+ if precision not in (1, 2, 4):
793
+ raise ValueError("The precision key has an invalid entry, use 1, 2, or 4")
794
+ grid._set_xtgformat2()
795
+
796
+ i, j, k = ijk
797
+ shift = 1 if zerobased else 0
798
+
799
+ if activeonly:
800
+ actnum = grid.get_actnum()
801
+ iact = actnum.values[i - 1 + shift, j - 1 + shift, k - 1 + shift]
802
+ if np.all(iact == 0):
803
+ return None
804
+
805
+ corners = grid._get_grid_cpp().get_cell_corners_from_ijk(
806
+ i + shift - 1,
807
+ j + shift - 1,
808
+ k + shift - 1,
809
+ )
810
+ prec = _internal.geometry.HexVolumePrecision.P2
811
+ if precision == 1:
812
+ prec = _internal.geometry.HexVolumePrecision.P1
813
+ elif precision == 4:
814
+ prec = _internal.geometry.HexVolumePrecision.P4
815
+
816
+ return _internal.geometry.hexahedron_volume(corners, prec)
817
+
818
+
819
+ def get_layer_slice(
820
+ self: Grid, layer: int, top: bool = True, activeonly: bool = True
821
+ ) -> tuple[np.ndarray, np.ndarray]:
822
+ """Get X Y cell corners (XY per cell; 5 per cell) as array."""
823
+ self._set_xtgformat1()
824
+ ntot = self._ncol * self._nrow * self._nlay
825
+
826
+ opt1 = 0 if top else 1
827
+ opt2 = 1 if activeonly else 0
828
+
829
+ icn, lay_array, ic_array = _cxtgeo.grd3d_get_lay_slice(
830
+ self._ncol,
831
+ self._nrow,
832
+ self._nlay,
833
+ self._coordsv,
834
+ self._zcornsv,
835
+ self._actnumsv,
836
+ layer,
837
+ opt1,
838
+ opt2,
839
+ 10 * ntot,
840
+ ntot,
841
+ )
842
+
843
+ lay_array = lay_array[: 10 * icn]
844
+ ic_array = ic_array[:icn]
845
+
846
+ lay_array = lay_array.reshape((icn, 5, 2))
847
+
848
+ return lay_array, ic_array
849
+
850
+
851
+ def get_geometrics(
852
+ self: Grid,
853
+ allcells: bool = False,
854
+ cellcenter: bool = True,
855
+ return_dict: bool = False,
856
+ _ver: Literal[1, 2] = 1,
857
+ ) -> dict | tuple:
858
+ """Getting cell geometrics."""
859
+ self._set_xtgformat1()
860
+
861
+ geom_function = _get_geometrics_v1 if _ver == 1 else _get_geometrics_v2
862
+ return geom_function(
863
+ self, allcells=allcells, cellcenter=cellcenter, return_dict=return_dict
864
+ )
865
+
866
+
867
+ def _get_geometrics_v1(
868
+ self: Grid,
869
+ allcells: bool = False,
870
+ cellcenter: bool = True,
871
+ return_dict: bool = False,
872
+ ) -> dict | tuple:
873
+ ptr_x = [_cxtgeo.new_doublepointer() for i in range(13)]
874
+
875
+ option1 = 0 if allcells else 1
876
+ option2 = 1 if cellcenter else 0
877
+
878
+ quality = _cxtgeo.grd3d_geometrics(
879
+ self._ncol,
880
+ self._nrow,
881
+ self._nlay,
882
+ self._coordsv,
883
+ self._zcornsv,
884
+ self._actnumsv,
885
+ ptr_x[0],
886
+ ptr_x[1],
887
+ ptr_x[2],
888
+ ptr_x[3],
889
+ ptr_x[4],
890
+ ptr_x[5],
891
+ ptr_x[6],
892
+ ptr_x[7],
893
+ ptr_x[8],
894
+ ptr_x[9],
895
+ ptr_x[10],
896
+ ptr_x[11],
897
+ ptr_x[12],
898
+ option1,
899
+ option2,
900
+ )
901
+
902
+ glist = [_cxtgeo.doublepointer_value(item) for item in ptr_x]
903
+ glist.append(quality)
904
+
905
+ logger.info("Cell geometrics done")
906
+
907
+ if not return_dict:
908
+ return tuple(glist)
909
+
910
+ gkeys = [
911
+ "xori",
912
+ "yori",
913
+ "zori",
914
+ "xmin",
915
+ "xmax",
916
+ "ymin",
917
+ "ymax",
918
+ "zmin",
919
+ "zmax",
920
+ "avg_rotation",
921
+ "avg_dx",
922
+ "avg_dy",
923
+ "avg_dz",
924
+ "grid_regularity_flag",
925
+ ]
926
+ return dict(zip(gkeys, glist))
927
+
928
+
929
+ def _get_geometrics_v2(
930
+ self: Grid,
931
+ allcells: bool = False,
932
+ cellcenter: bool = True,
933
+ return_dict: bool = False,
934
+ ) -> dict | tuple:
935
+ # Currently a workaround as there seems to be bugs in v1
936
+ # Will only work with allcells False and cellcenter True
937
+
938
+ glist = []
939
+ if cellcenter and allcells:
940
+ xcor, ycor, zcor = self.get_xyz(asmasked=False)
941
+ glist.append(xcor.values[0, 0, 0])
942
+ glist.append(ycor.values[0, 0, 0])
943
+ glist.append(zcor.values[0, 0, 0])
944
+ glist.append(xcor.values.min())
945
+ glist.append(xcor.values.max())
946
+ glist.append(ycor.values.min())
947
+ glist.append(ycor.values.max())
948
+ glist.append(zcor.values.min())
949
+ glist.append(zcor.values.max())
950
+
951
+ # rotation (approx) for mid column
952
+ midcol = int(self.nrow / 2)
953
+ midlay = int(self.nlay / 2)
954
+ x0 = xcor.values[0, midcol, midlay]
955
+ y0 = ycor.values[0, midcol, midlay]
956
+ x1 = xcor.values[self.ncol - 1, midcol, midlay]
957
+ y1 = ycor.values[self.ncol - 1, midcol, midlay]
958
+ glist.append(degrees(atan2(y1 - y0, x1 - x0)))
959
+
960
+ dx = self.get_dx(asmasked=False)
961
+ dy = self.get_dy(asmasked=False)
962
+ dz = self.get_dz(asmasked=False)
963
+ glist.append(dx.values.mean())
964
+ glist.append(dy.values.mean())
965
+ glist.append(dz.values.mean())
966
+ glist.append(1)
967
+
968
+ if not return_dict:
969
+ return tuple(glist)
970
+
971
+ gkeys = [
972
+ "xori",
973
+ "yori",
974
+ "zori",
975
+ "xmin",
976
+ "xmax",
977
+ "ymin",
978
+ "ymax",
979
+ "zmin",
980
+ "zmax",
981
+ "avg_rotation",
982
+ "avg_dx",
983
+ "avg_dy",
984
+ "avg_dz",
985
+ "grid_regularity_flag",
986
+ ]
987
+ return dict(zip(gkeys, glist))
988
+
989
+
990
+ def inactivate_by_dz(self: Grid, threshold: float, flip: bool = True) -> None:
991
+ """Set cell to inactive if dz does not exceed threshold.
992
+ Args:
993
+ threshold (float): The threshold for which the absolute value
994
+ of dz should exceed.
995
+ flip (bool): Whether the z-direction should be flipped.
996
+
997
+ """
998
+ self._set_xtgformat2()
999
+ dz_values = self.get_dz(asmasked=False, flip=flip).values
1000
+ self._actnumsv[dz_values.reshape(self._actnumsv.shape) < threshold] = 0
1001
+
1002
+
1003
+ def make_zconsistent(self: Grid, zsep: float | int) -> None:
1004
+ """Make consistent in z."""
1005
+ self._set_xtgformat1()
1006
+
1007
+ if isinstance(zsep, int):
1008
+ zsep = float(zsep)
1009
+
1010
+ if not isinstance(zsep, float):
1011
+ raise ValueError('The "zsep" is not a float or int')
1012
+
1013
+ _cxtgeo.grd3d_make_z_consistent(
1014
+ self.ncol,
1015
+ self.nrow,
1016
+ self.nlay,
1017
+ self._zcornsv,
1018
+ zsep,
1019
+ )
1020
+
1021
+
1022
+ def inactivate_inside(
1023
+ self: Grid,
1024
+ poly: Polygons,
1025
+ layer_range: tuple[int, int] | None = None,
1026
+ inside: bool = True,
1027
+ force_close: bool = False,
1028
+ ) -> None:
1029
+ """Inactivate inside a polygon (or outside)."""
1030
+ self._set_xtgformat1()
1031
+
1032
+ if not isinstance(poly, Polygons):
1033
+ raise ValueError("Input polygon not a XTGeo Polygons instance")
1034
+
1035
+ if layer_range is not None:
1036
+ k1, k2 = layer_range
1037
+ else:
1038
+ k1, k2 = 1, self.nlay
1039
+
1040
+ method = 0 if inside else 1
1041
+ iforce = 0 if not force_close else 1
1042
+
1043
+ # get dataframe where each polygon is ended by a 999 value
1044
+ dfxyz = poly.get_xyz_dataframe()
1045
+
1046
+ xc = dfxyz["X_UTME"].values.copy()
1047
+ yc = dfxyz["Y_UTMN"].values.copy()
1048
+
1049
+ ier = _cxtgeo.grd3d_inact_outside_pol(
1050
+ xc,
1051
+ yc,
1052
+ self.ncol,
1053
+ self.nrow,
1054
+ self.nlay,
1055
+ self._coordsv,
1056
+ self._zcornsv,
1057
+ self._actnumsv, # is modified!
1058
+ k1,
1059
+ k2,
1060
+ iforce,
1061
+ method,
1062
+ )
1063
+
1064
+ if ier == 1:
1065
+ raise RuntimeError("Problems with one or more polygons. Not closed?")
1066
+
1067
+
1068
+ def collapse_inactive_cells(self: Grid, internal: bool = True) -> None:
1069
+ """Collapse inactive cells."""
1070
+ logger.debug("Collapsing inactive cells...")
1071
+ self._set_xtgformat2()
1072
+
1073
+ grid_cpp = _internal.grid3d.Grid(self)
1074
+ new_zcornsv = grid_cpp.collapse_inactive_cells(collapse_internal=internal)
1075
+
1076
+ if new_zcornsv is not None:
1077
+ self._zcornsv = new_zcornsv
1078
+
1079
+ logger.debug("Collapsing inactive cells done")
1080
+
1081
+
1082
+ def copy(self: Grid) -> Grid:
1083
+ """Copy a grid instance.
1084
+
1085
+ Returns:
1086
+ A new instance (attached grid properties will also be unique)
1087
+ """
1088
+ self._set_xtgformat2()
1089
+
1090
+ copy_tag = " (copy)"
1091
+
1092
+ filesrc = str(self._filesrc)
1093
+ if filesrc is not None and copy_tag not in filesrc:
1094
+ filesrc += copy_tag
1095
+
1096
+ return self.__class__(
1097
+ coordsv=self._coordsv.copy(),
1098
+ zcornsv=self._zcornsv.copy(),
1099
+ actnumsv=self._actnumsv.copy(),
1100
+ subgrids=deepcopy(self.subgrids),
1101
+ dualporo=self.dualporo,
1102
+ dualperm=self.dualperm,
1103
+ name=self.name + copy_tag if self.name else None,
1104
+ roxgrid=self.roxgrid,
1105
+ roxindexer=self.roxindexer,
1106
+ props=self._props.copy() if self._props else None,
1107
+ filesrc=filesrc,
1108
+ )
1109
+
1110
+
1111
+ @no_type_check # due to some hard-to-solve issues with mypy
1112
+ def crop(
1113
+ self: Grid,
1114
+ spec: tuple[tuple[int, int], tuple[int, int], tuple[int, int]],
1115
+ props: Literal["all"] | list[GridProperty] | None = None,
1116
+ ) -> None:
1117
+ """Do cropping of geometry (and properties).
1118
+
1119
+ If props is 'all' then all properties assosiated (linked) to then
1120
+ grid are also cropped, and the instances are updated.
1121
+
1122
+ Args:
1123
+ spec (tuple): A nested tuple on the form ((i1, i2), (j1, j2), (k1, k2))
1124
+ where 1 represents start number, and 2 reperesent end. The range
1125
+ is inclusive for both ends, and the number start index is 1 based.
1126
+ props (list or str): None is default, while properties can be listed.
1127
+ If 'all', then all GridProperty objects which are linked to the
1128
+ Grid instance are updated.
1129
+
1130
+ Returns:
1131
+ The instance is updated (cropped)
1132
+ """
1133
+ self._set_xtgformat1()
1134
+
1135
+ (ic1, ic2), (jc1, jc2), (kc1, kc2) = spec
1136
+
1137
+ if (
1138
+ ic1 < 1
1139
+ or ic2 > self.ncol
1140
+ or jc1 < 1
1141
+ or jc2 > self.nrow
1142
+ or kc1 < 1
1143
+ or kc2 > self.nlay
1144
+ ):
1145
+ raise ValueError("Boundary for tuples not matching grid NCOL, NROW, NLAY")
1146
+
1147
+ oldnlay = self._nlay
1148
+
1149
+ # compute size of new cropped grid
1150
+ nncol = ic2 - ic1 + 1
1151
+ nnrow = jc2 - jc1 + 1
1152
+ nnlay = kc2 - kc1 + 1
1153
+
1154
+ ntot = nncol * nnrow * nnlay
1155
+ ncoord = (nncol + 1) * (nnrow + 1) * 2 * 3
1156
+ nzcorn = nncol * nnrow * (nnlay + 1) * 4
1157
+
1158
+ new_num_act = _cxtgeo.new_intpointer()
1159
+ new_coordsv = np.zeros(ncoord, dtype=np.float64)
1160
+ new_zcornsv = np.zeros(nzcorn, dtype=np.float64)
1161
+ new_actnumsv = np.zeros(ntot, dtype=np.int32)
1162
+
1163
+ _cxtgeo.grd3d_crop_geometry(
1164
+ self.ncol,
1165
+ self.nrow,
1166
+ self.nlay,
1167
+ self._coordsv,
1168
+ self._zcornsv,
1169
+ self._actnumsv,
1170
+ new_coordsv,
1171
+ new_zcornsv,
1172
+ new_actnumsv,
1173
+ ic1,
1174
+ ic2,
1175
+ jc1,
1176
+ jc2,
1177
+ kc1,
1178
+ kc2,
1179
+ new_num_act,
1180
+ 0,
1181
+ )
1182
+
1183
+ self._coordsv = new_coordsv
1184
+ self._zcornsv = new_zcornsv
1185
+ self._actnumsv = new_actnumsv
1186
+
1187
+ self._ncol = nncol
1188
+ self._nrow = nnrow
1189
+ self._nlay = nnlay
1190
+
1191
+ if isinstance(self.subgrids, dict):
1192
+ newsub = {}
1193
+ # easier to work with numpies than lists
1194
+ newarr = np.array(range(1, oldnlay + 1))
1195
+ newarr[newarr < kc1] = 0
1196
+ newarr[newarr > kc2] = 0
1197
+ newaxx = newarr.copy() - kc1 + 1
1198
+ for sub, arr in self.subgrids.items():
1199
+ arrx = np.array(arr)
1200
+ arrxmap = newaxx[arrx[0] - 1 : arrx[-1]]
1201
+ arrxmap = arrxmap[arrxmap > 0]
1202
+ if arrxmap.size > 0:
1203
+ newsub[sub] = arrxmap.astype(np.int32).tolist()
1204
+
1205
+ self.subgrids = newsub
1206
+
1207
+ # crop properties
1208
+ props = self.props if props == "all" else props
1209
+ if props is not None:
1210
+ for prop in props:
1211
+ logger.info("Crop %s", prop.name)
1212
+ prop.crop(spec)
1213
+
1214
+
1215
+ def reduce_to_one_layer(self: Grid) -> None:
1216
+ """Reduce the grid to one single layer.
1217
+
1218
+ This can be useful for algorithms that need to test if a point is within
1219
+ the full grid.
1220
+
1221
+ Example::
1222
+
1223
+ >>> import xtgeo
1224
+ >>> grid = xtgeo.grid_from_file(reek_dir + "/REEK.EGRID")
1225
+ >>> grid.nlay
1226
+ 14
1227
+ >>> grid.reduce_to_one_layer()
1228
+ >>> grid.nlay
1229
+ 1
1230
+
1231
+ """
1232
+ # need new pointers in C (not for coord)
1233
+ # Note this could probably be done with pure numpy operations
1234
+ self._set_xtgformat1()
1235
+
1236
+ ptr_new_num_act = _cxtgeo.new_intpointer()
1237
+
1238
+ nnum = (1 + 1) * 4
1239
+
1240
+ new_zcorn = np.zeros(self.ncol * self.nrow * nnum, dtype=np.float64)
1241
+ new_actnum = np.zeros(self.ncol * self.nrow * 1, dtype=np.int32)
1242
+
1243
+ _cxtgeo.grd3d_reduce_onelayer(
1244
+ self.ncol,
1245
+ self.nrow,
1246
+ self.nlay,
1247
+ self._zcornsv,
1248
+ new_zcorn,
1249
+ self._actnumsv,
1250
+ new_actnum,
1251
+ ptr_new_num_act,
1252
+ 0,
1253
+ )
1254
+
1255
+ self._nlay = 1
1256
+ self._zcornsv = new_zcorn
1257
+ self._actnumsv = new_actnum
1258
+ self._props = None
1259
+ self._subgrids = None
1260
+
1261
+
1262
+ def reverse_row_axis(
1263
+ self: Grid, ijk_handedness: Literal["left", "right"] | None = None
1264
+ ) -> None:
1265
+ """Flip the row-axis for xtgformat=2 grid arrays.
1266
+
1267
+ This reverses the J-direction (rows) by flipping along axis 1 for both
1268
+ coordsv and zcornsv arrays, and also handles the corner ordering within
1269
+ each pillar to maintain proper geometry.
1270
+ """
1271
+ if ijk_handedness == self.ijk_handedness:
1272
+ return
1273
+
1274
+ self._set_xtgformat2()
1275
+
1276
+ # Flip coordsv along the row axis (axis 1) and make contiguous with copy()
1277
+ self._coordsv = np.flip(self._coordsv, axis=1).copy()
1278
+
1279
+ # For zcornsv, we need to flip along row axis and also swap corner ordering
1280
+ # Original corner order: SW, SE, NW, NE (indices 0,1,2,3)
1281
+ # After row flip: NW, NE, SW, SE (should become indices 0,1,2,3)
1282
+ # So we need to rearrange: [2,3,0,1]
1283
+ zcorns_flipped = np.flip(self._zcornsv, axis=1) # Flip along row axis
1284
+ self._zcornsv = zcorns_flipped[:, :, :, [2, 3, 0, 1]].copy() # Reorder corners
1285
+
1286
+ # Also flip actnum along row axis
1287
+ self._actnumsv = np.flip(self._actnumsv, axis=1).copy()
1288
+
1289
+ # Update handedness
1290
+ if self._ijk_handedness == "left":
1291
+ self._ijk_handedness = "right"
1292
+ else:
1293
+ self._ijk_handedness = "left"
1294
+
1295
+ # Handle properties if they exist
1296
+ if self._props and self._props.props:
1297
+ for prop in self._props.props:
1298
+ prop.values = np.flip(prop.values, axis=1).copy()
1299
+
1300
+ logger.info("Reversing of row axis done")
1301
+
1302
+
1303
+ def reverse_column_axis(
1304
+ self: Grid, ijk_handedness: Literal["left", "right"] | None = None
1305
+ ) -> None:
1306
+ """Flip the column-axis for xtgformat=2 grid arrays.
1307
+
1308
+ This reverses the I-direction (columns) by flipping along axis 0 for both
1309
+ coordsv and zcornsv arrays, and also handles the corner ordering within
1310
+ each pillar to maintain proper geometry.
1311
+ """
1312
+ if ijk_handedness == self.ijk_handedness:
1313
+ return
1314
+
1315
+ self._set_xtgformat2()
1316
+
1317
+ # Flip coordsv along the column axis (axis 0) and make contiguous with copy()
1318
+ self._coordsv = np.flip(self._coordsv, axis=0).copy()
1319
+
1320
+ # For zcornsv, we need to flip along column axis and also swap corner ordering
1321
+ # Original corner order: SW, SE, NW, NE (indices 0,1,2,3)
1322
+ # After column flip: SE, SW, NE, NW (should become indices 0,1,2,3)
1323
+ # So we need to rearrange: [1,0,3,2]
1324
+ zcorns_flipped = np.flip(self._zcornsv, axis=0) # Flip along column axis
1325
+ self._zcornsv = zcorns_flipped[:, :, :, [1, 0, 3, 2]].copy() # Reorder corners
1326
+
1327
+ # Also flip actnum along column axis
1328
+ self._actnumsv = np.flip(self._actnumsv, axis=0).copy()
1329
+
1330
+ # Update handedness
1331
+ if self._ijk_handedness == "left":
1332
+ self._ijk_handedness = "right"
1333
+ else:
1334
+ self._ijk_handedness = "left"
1335
+
1336
+ # Handle properties if they exist
1337
+ if self._props and self._props.props:
1338
+ for prop in self._props.props:
1339
+ prop.values = np.flip(prop.values, axis=0).copy()
1340
+
1341
+ logger.info("Reversing of column axis done")
1342
+
1343
+
1344
+ def get_adjacent_cells(
1345
+ self: Grid,
1346
+ prop: GridProperty,
1347
+ val1: int,
1348
+ val2: int,
1349
+ activeonly: bool = True,
1350
+ ) -> GridProperty:
1351
+ """Get adjacents cells."""
1352
+ self._set_xtgformat1()
1353
+
1354
+ if not isinstance(prop, GridProperty):
1355
+ raise ValueError("The argument prop is not a xtgeo.GridPropery")
1356
+
1357
+ if prop.isdiscrete is False:
1358
+ raise ValueError("The argument prop is not a discrete property")
1359
+
1360
+ result = GridProperty(
1361
+ ncol=self._ncol,
1362
+ nrow=self._nrow,
1363
+ nlay=self._nlay,
1364
+ values=np.zeros(self.ntotal, dtype=np.int32),
1365
+ name="ADJ_CELLS",
1366
+ discrete=True,
1367
+ )
1368
+
1369
+ p_prop1 = _gridprop_lowlevel.update_carray(prop)
1370
+ p_prop2 = _cxtgeo.new_intarray(self.ntotal)
1371
+
1372
+ iflag1 = 0 if activeonly else 1
1373
+ iflag2 = 1
1374
+
1375
+ _cxtgeo.grd3d_adj_cells(
1376
+ self._ncol,
1377
+ self._nrow,
1378
+ self._nlay,
1379
+ self._coordsv,
1380
+ self._zcornsv,
1381
+ self._actnumsv,
1382
+ p_prop1,
1383
+ self.ntotal,
1384
+ val1,
1385
+ val2,
1386
+ p_prop2,
1387
+ self.ntotal,
1388
+ iflag1,
1389
+ iflag2,
1390
+ )
1391
+
1392
+ _gridprop_lowlevel.update_values_from_carray(result, p_prop2, np.int32, delete=True)
1393
+ # return the property object
1394
+ return result
1395
+
1396
+
1397
+ def estimate_design(
1398
+ self: Grid,
1399
+ nsubname: str | None = None,
1400
+ ) -> dict[str, str | float]:
1401
+ """Estimate (guess) (sub)grid design by examing DZ in median thickness column."""
1402
+ actv = self.get_actnum().values
1403
+
1404
+ dzv_raw = self.get_dz(asmasked=False).values
1405
+ # Although asmasked is False the array values will still be a masked numpy
1406
+ # Need to convert to an ordinary numpy to avoid warnings later
1407
+ dzv = np.ma.filled(dzv_raw, fill_value=0.0)
1408
+
1409
+ # treat inactive thicknesses as zero
1410
+ dzv[actv == 0] = 0.0
1411
+
1412
+ if nsubname is None:
1413
+ vrange = np.array(range(self.nlay))
1414
+ else:
1415
+ assert self.subgrids is not None
1416
+ vrange = np.array(list(self.subgrids[nsubname])) - 1
1417
+
1418
+ # find the dz for the actual subzone
1419
+ dzv = dzv[:, :, vrange]
1420
+
1421
+ # find cumulative thickness as a 2D array
1422
+ dzcum: np.ndarray = np.sum(dzv, axis=2, keepdims=False)
1423
+
1424
+ # Ensure dzcum is a regular numpy array to avoid warnings
1425
+ if isinstance(dzcum, np.ma.MaskedArray):
1426
+ dzcum = np.ma.filled(dzcum, fill_value=0.0)
1427
+ dzcum = np.asarray(dzcum)
1428
+
1429
+ # find the average thickness for nonzero thicknesses
1430
+ dzcum2 = dzcum.copy()
1431
+ dzcum2[dzcum == 0.0] = np.nan
1432
+ dzavg = np.nanmean(dzcum2) / dzv.shape[2]
1433
+
1434
+ # find the I J indices for the median value
1435
+ if versionparse(np.__version__) < versionparse("1.22"):
1436
+ median_value = np.percentile(dzcum, 50, interpolation="nearest") # type: ignore
1437
+ else:
1438
+ median_value = np.percentile(dzcum, 50, method="nearest")
1439
+
1440
+ argmed = np.stack(np.nonzero(dzcum == median_value), axis=1)
1441
+
1442
+ im, jm = argmed[0]
1443
+ # find the dz stack of the median
1444
+ dzmedian = dzv[im, jm, :]
1445
+ logger.info("DZ median column is %s", dzmedian)
1446
+
1447
+ # to compare thicknesses with (divide on 2 to assure)
1448
+ target = dzcum[im, jm] / (dzmedian.shape[0] * 2)
1449
+ eps = target / 100.0
1450
+
1451
+ logger.info("Target and EPS values are %s, %s", target, eps)
1452
+
1453
+ status = "X" # unknown or cannot determine
1454
+
1455
+ if dzmedian[0] > target and dzmedian[-1] <= eps:
1456
+ status = "T"
1457
+ dzavg = dzmedian[0]
1458
+ elif dzmedian[0] < eps and dzmedian[-1] > target:
1459
+ status = "B"
1460
+ dzavg = dzmedian[-1]
1461
+ elif dzmedian[0] > target and dzmedian[-1] > target:
1462
+ ratio = dzmedian[0] / dzmedian[-1]
1463
+ if 0.5 < ratio < 1.5:
1464
+ status = "P"
1465
+ elif dzmedian[0] < eps and dzmedian[-1] < eps:
1466
+ status = "M"
1467
+ middleindex = int(dzmedian.shape[0] / 2)
1468
+ dzavg = dzmedian[middleindex]
1469
+
1470
+ return {"design": status, "dzsimbox": dzavg}
1471
+
1472
+
1473
+ def estimate_handedness(self: Grid) -> Literal["left", "right"]:
1474
+ """Estimate if grid is left or right handed, returning string."""
1475
+ nflip = self.estimate_flip()
1476
+
1477
+ return "left" if nflip == 1 else "right"
1478
+
1479
+
1480
+ def _convert_xtgformat2to1(self: Grid) -> None:
1481
+ """Convert arrays from new structure xtgformat=2 to legacy xtgformat=1."""
1482
+ if self._xtgformat == 1:
1483
+ logger.info("No conversion, format is already xtgformat == 1 or unset")
1484
+ return
1485
+
1486
+ logger.info("Convert grid from new xtgformat to legacy format...")
1487
+
1488
+ newcoordsv = np.zeros(((self._ncol + 1) * (self._nrow + 1) * 6), dtype=np.float64)
1489
+ newzcornsv = np.zeros(
1490
+ (self._ncol * self._nrow * (self._nlay + 1) * 4), dtype=np.float64
1491
+ )
1492
+ newactnumsv = np.zeros((self._ncol * self._nrow * self._nlay), dtype=np.int32)
1493
+
1494
+ _cxtgeo.grd3cp3d_xtgformat2to1_geom(
1495
+ self._ncol,
1496
+ self._nrow,
1497
+ self._nlay,
1498
+ newcoordsv,
1499
+ self._coordsv,
1500
+ newzcornsv,
1501
+ self._zcornsv,
1502
+ newactnumsv,
1503
+ self._actnumsv,
1504
+ )
1505
+
1506
+ self._coordsv = newcoordsv
1507
+ self._zcornsv = newzcornsv
1508
+ self._actnumsv = newactnumsv
1509
+ self._xtgformat = 1
1510
+
1511
+ logger.info("Convert grid from new xtgformat to legacy format... done")
1512
+
1513
+
1514
+ def _convert_xtgformat1to2(self: Grid) -> None:
1515
+ """Convert arrays from old structure xtgformat=1 to new xtgformat=2."""
1516
+ if self._xtgformat == 2 or self._coordsv is None:
1517
+ logger.info("No conversion, format is already xtgformat == 2 or unset")
1518
+ return
1519
+
1520
+ logger.info("Convert grid from legacy xtgformat to new format...")
1521
+
1522
+ newcoordsv = np.zeros((self._ncol + 1, self._nrow + 1, 6), dtype=np.float64)
1523
+ newzcornsv = np.zeros(
1524
+ (self._ncol + 1, self._nrow + 1, self._nlay + 1, 4), dtype=np.float32
1525
+ )
1526
+ newactnumsv = np.zeros((self._ncol, self._nrow, self._nlay), dtype=np.int32)
1527
+
1528
+ _cxtgeo.grd3cp3d_xtgformat1to2_geom(
1529
+ self._ncol,
1530
+ self._nrow,
1531
+ self._nlay,
1532
+ self._coordsv,
1533
+ newcoordsv,
1534
+ self._zcornsv,
1535
+ newzcornsv,
1536
+ self._actnumsv,
1537
+ newactnumsv,
1538
+ )
1539
+
1540
+ self._coordsv = newcoordsv
1541
+ self._zcornsv = newzcornsv
1542
+ self._actnumsv = newactnumsv
1543
+ self._xtgformat = 2
1544
+
1545
+ logger.info("Convert grid from legacy xtgformat to new format... done")
1546
+
1547
+
1548
+ def get_gridquality_properties(self: Grid) -> GridProperties:
1549
+ """Get the grid quality properties."""
1550
+ self._set_xtgformat2()
1551
+
1552
+ qcnames = {
1553
+ 0: "minangle_topbase",
1554
+ 1: "maxangle_topbase",
1555
+ 2: "minangle_topbase_proj",
1556
+ 3: "maxangle_topbase_proj",
1557
+ 4: "minangle_sides",
1558
+ 5: "maxangle_sides",
1559
+ 6: "collapsed",
1560
+ 7: "faulted",
1561
+ 8: "negative_thickness",
1562
+ 9: "concave_proj",
1563
+ }
1564
+
1565
+ # some of the properties shall be discrete:
1566
+ qcdiscrete = [6, 7, 8, 9]
1567
+
1568
+ fresults = np.ones(
1569
+ (len(qcnames), self.ncol * self.nrow * self.nlay), dtype=np.float32
1570
+ )
1571
+
1572
+ _cxtgeo.grdcp3d_quality_indicators(
1573
+ self.ncol,
1574
+ self.nrow,
1575
+ self.nlay,
1576
+ self._coordsv,
1577
+ self._zcornsv,
1578
+ self._actnumsv,
1579
+ fresults,
1580
+ )
1581
+
1582
+ grdprops = GridProperties()
1583
+
1584
+ for num, name in qcnames.items():
1585
+ discrete = num in qcdiscrete
1586
+ prop = GridProperty(
1587
+ self,
1588
+ name=name,
1589
+ discrete=discrete,
1590
+ values=fresults[num, :].astype(np.int32 if discrete else np.float32),
1591
+ codes={0: "None", 1: name} if discrete else None,
1592
+ )
1593
+ grdprops.append_props([prop])
1594
+
1595
+ return grdprops