api
lib.prospecting — 勘探/储量模块
BlockDataError
Bases: RuntimeError
块段模型操作异常基类
Source code in dimine_python_sdk\lib\prospecting\block_model.py
48 49 50 | |
BlockModelCommonParams
Bases: ParamModel
块段模型估值通用参数基类(距离幂/克里格共用)
Source code in dimine_python_sdk\lib\prospecting\models.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
model_dump_json(**kwargs)
序列化为 JSON 字符串,默认使用 alias 输出旧字段名以兼容 C++ 后端
Source code in dimine_python_sdk\lib\prospecting\models.py
39 40 41 42 | |
BlockModelCreateError
Bases: BlockDataError
创建块段模型失败
Source code in dimine_python_sdk\lib\prospecting\block_model.py
53 54 55 | |
BlockModelDistancePowerParams
Bases: BlockModelCommonParams
距离幂估值专属参数类(继承通用参数+新增距离幂特有参数)
Source code in dimine_python_sdk\lib\prospecting\models.py
50 51 52 53 | |
BlockModelEvaluator
块段模型估值与储量计算器
所有方法接受块段模型文件路径,失败时抛出自定义异常(不返回 tuple):
evaluator = BlockModelEvaluator()
result = evaluator.distance_power_evaluation(
"model.dmb", constraint, idw_params
)
# result -> {"success": True, "message": "..."}
Raises:
| Type | Description |
|---|---|
BlockModelEvaluationError
|
估值失败 |
Source code in dimine_python_sdk\lib\prospecting\block_model.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | |
distance_power_evaluation(block_model_file, constraint_params, evaluation_params, overwrite_result=True)
staticmethod
距离幂估值计算
Returns:
| Name | Type | Description |
|---|---|---|
DistancePowerEvaluationResult |
DistancePowerEvaluationResult
|
估值结果对象,包含 success / message / elements |
Source code in dimine_python_sdk\lib\prospecting\block_model.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | |
kriging_evaluation(block_model_file, constraint_params, evaluation_params, overwrite_result=True)
staticmethod
克里格估值计算
克里格算法底层仅支持单元素估值,当 variables 包含多个元素(逗号分隔)时, 自动按元素拆分,依次调用底层接口实现多元素估值效果。
Source code in dimine_python_sdk\lib\prospecting\block_model.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | |
BlockModelKrigingParams
Bases: BlockModelCommonParams
克里格估值专属参数类(继承通用参数+新增克里格特有参数)
Source code in dimine_python_sdk\lib\prospecting\models.py
56 57 58 59 60 61 62 63 64 65 | |
CreateBlockModelParams
Bases: ParamModel
创建空块段模型参数,即 注意:为什么没有输入文件,因为这只是创建空块段模型,只需要矿体包围盒范围即可
Source code in dimine_python_sdk\lib\prospecting\models.py
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | |
DTMConstraint
Bases: ParamModel
DTM 约束 (type=1):基于 DTM 模型的上部/下部空间约束
Source code in dimine_python_sdk\lib\prospecting\models.py
86 87 88 89 90 91 92 93 94 95 96 | |
DrillFunctionWrapper
钻孔相关功能的封装器,提供更简洁的接口
Source code in dimine_python_sdk\lib\prospecting\drill_db.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
extra_high_grade_process(params)
staticmethod
特高品位处理
Source code in dimine_python_sdk\lib\prospecting\drill_db.py
58 59 60 61 62 63 | |
sample_length_combine(params)
staticmethod
样长组合
Source code in dimine_python_sdk\lib\prospecting\drill_db.py
40 41 42 43 44 45 46 47 48 | |
step_combine(params)
staticmethod
台阶组合
Source code in dimine_python_sdk\lib\prospecting\drill_db.py
50 51 52 53 54 55 56 | |
EntityConstraint
Bases: ParamModel
实体约束 (type=0):基于实体模型的内部/外部空间约束
Source code in dimine_python_sdk\lib\prospecting\models.py
73 74 75 76 77 78 79 80 81 82 83 | |
FieldDefinition
Bases: ParamModel
块段模型属性字段定义
Source code in dimine_python_sdk\lib\prospecting\models.py
207 208 209 210 211 212 213 214 | |
HighGradeParams
dataclass
特高品位处理参数
Attributes:
| Name | Type | Description |
|---|---|---|
grade_field |
str
|
品位字段名(如 "CU"、"TFe") |
group_mode |
GroupMode
|
分组维度 - "by_hole": 按工程号分组 - "by_section": 按勘探线分组(需传入 collar_df) - "global": 全矿区统一计算(默认) |
use_average_multiple |
bool
|
启用平均值倍数法 |
average_multiple |
Optional[int]
|
倍数系数。设为 None(默认)时按品位变化系数(CV)自动判定: CV<0.5→6倍, 0.5≤CV<1.0→7倍, CV≥1.0→8倍。 也可手动指定 6/7/8。 |
use_frequency |
bool
|
启用累积频率法 |
frequency |
float
|
累积频率阈值(常用 0.95 / 0.975 / 0.977) |
replace_method |
ReplaceMethod
|
替换方式 0 - 剔除法(设为 NaN) 1 - 给定值法 2 - 相邻样品平均值法(默认,长度加权) 3 - 矿体平均品位法 4 - 单一工程法 5 - 截止品位法(cap 到阈值) |
assign_value |
float
|
方法 1 的给定值 |
max_adjacent_search |
int
|
方法 2 相邻搜索最大扩展步数(默认 3) |
max_depth_gap |
float
|
方法 2 深度连续性容差(m)。候选样品与当前样品的 FROM/TO 间隙超过此值则视为不连续,跳过该候选。 默认 0.5m;设为 0 表示要求严格连续。 |
average_method |
AverageMethod
|
均值计算方式 - "arithmetic": 算术平均 - "length_weighted": 长度加权平均(默认) |
result_field |
Optional[str]
|
结果字段名(None 时默认为 {grade_field} 即源品位字段名,处理后的结果会把原始数据覆盖) |
Source code in dimine_python_sdk\lib\prospecting\high_grade.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
HighGradeProcessParam
Bases: ParamModel
特高品位处理参数
Source code in dimine_python_sdk\lib\prospecting\models.py
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | |
HighGradeProcessor
特高品位处理器
对样品表 DataFrame 执行特高品位识别与替换,支持: - 平均值倍数法 / 累积频率法双阈值策略 - 六种替换方法(剔除、给定值、相邻平均、矿体平均、单一工程、截止品位) - 单次处理,不做迭代收敛
Source code in dimine_python_sdk\lib\prospecting\high_grade.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 | |
process(sample_df, collar_df=None)
执行特高品位处理(单次处理,不迭代)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample_df
|
DataFrame
|
样品表 DataFrame,需包含 [工程号, 样本编号, 起始, 结束] 及品位列。 |
required |
collar_df
|
Optional[DataFrame]
|
孔口表 DataFrame(group_mode="by_section" 时必需)。 |
None
|
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
(processed_df, summary) 元组: processed_df — 处理后的完整样品 DataFrame(新增 result_field 列) summary — 汇总统计 dict |
.. deprecated:: 此方法为纯 Python 实现,已废弃。请改用 C++ 原生接口: DrillFunctionWrapper.extra_high_grade_process() 或 DrillFunctionWrapper.extra_high_grade_process()。
Source code in dimine_python_sdk\lib\prospecting\high_grade.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | |
ParamModel
Bases: BaseModel
参数模型基类,提供 model_dump 的 to_dict 别名以兼容旧代码
Source code in dimine_python_sdk\lib\_base.py
15 16 17 18 19 20 21 | |
PlaneConstraint
Bases: ParamModel
平面约束 (type=4):由平面方程 ax+by+cz+d=0 定义的上部/下部约束
Source code in dimine_python_sdk\lib\prospecting\models.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 | |
PolylineConstraint
Bases: ParamModel
闭合多段线约束 (type=3):基于闭合多段线 + 坐标轴范围的约束
Source code in dimine_python_sdk\lib\prospecting\models.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
ReservesCalculateParam
Bases: ParamModel
估值算量参数
Source code in dimine_python_sdk\lib\prospecting\models.py
198 199 200 201 202 203 204 | |
SampleCompositingParams
dataclass
样长组合参数
Attributes:
| Name | Type | Description |
|---|---|---|
composite_length |
float
|
组合样长度(米),必须 > 0。 建议取值为块体尺寸的 1/4 到 1/3。 |
grade_fields |
List[str]
|
需要做长度加权平均的品位字段名列表。 字段必须存在于样品表中,且为数值类型。 |
combine_percent |
float
|
最小覆盖率(0-1),组合区间内实际样品覆盖长度 低于此比例时标记为低质量组合样。 默认 0.75(与 DIMINE C++ 接口默认值一致)。 |
start_mode |
str
|
组合起始模式。 - 'first_sample': 从每个钻孔第一个样品起始深度开始(默认) - 'collar': 从孔口(深度0)开始 - 数字: 从指定的绝对深度开始(如 5.0) |
discard_low_coverage |
bool
|
尾部截断模式。 为 True 时,从孔口方向找到最后一个满足覆盖率要求的区间, 丢弃其之后的所有区间(即"尾部截断")。 注意:截断点之前的中间低覆盖率区间仍会被保留。 为 False 时保留所有区间,通过 "低覆盖率" 列标记。 |
include_3d_coords |
bool
|
是否计算组合样段中点的三维坐标。 需要提供 survey 和 collar 表。 |
min_samples_per_composite |
int
|
每个组合样最少包含的原始样品数(警告阈值)。 |
auto_detect_grade_fields |
bool
|
是否自动检测样品表中的数值型品位字段。 为 True 时,grade_fields 中未列出的数值列也会被组合。 自动排除标准列(工程号、样本编号、坐标等)。 |
Source code in dimine_python_sdk\lib\prospecting\compositing.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
SampleCompositingProcessor
样长组合处理器
对钻孔样品表执行样长组合操作。核心流程:
1. 数据预处理(NaN 清理、类型转换、数据校验)
2. 按钻孔(工程号)分组
3. 对每个钻孔独立执行长度加权组合
4. 汇总所有钻孔的组合结果
5. 生成统计报告
Usage
params = SampleCompositingParams( composite_length=2.0, grade_fields=['TFe', 'TiO2'], ) processor = SampleCompositingProcessor(params) result = processor.process(sample_df, survey_df, collar_df)
Source code in dimine_python_sdk\lib\prospecting\compositing.py
654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 | |
__init__(params=None, **kwargs)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
Optional[SampleCompositingParams]
|
SampleCompositingParams 参数对象。 为 None 时从 **kwargs 构建。 |
None
|
**kwargs
|
直接传入 SampleCompositingParams 的参数。 |
{}
|
Source code in dimine_python_sdk\lib\prospecting\compositing.py
674 675 676 677 678 679 680 681 682 683 | |
process(sample_df, survey_df=None, collar_df=None)
执行样长组合。
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample_df
|
DataFrame
|
样品表 DataFrame(中文标准列名:工程号, 起始, 结束, ...) |
required |
survey_df
|
Optional[DataFrame]
|
测斜表 DataFrame(可选,用于计算3D坐标) |
None
|
collar_df
|
Optional[DataFrame]
|
孔口表 DataFrame(可选,用于计算3D坐标) |
None
|
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
(composited_df, summary) 元组: composited_df — 组合后的样品 DataFrame |
Dict[str, Any]
|
summary — 汇总统计 dict |
.. deprecated:: 此方法为纯 Python 实现,已废弃。请改用 C++ 原生接口: DrillFunctionWrapper.sample_length_combine() 或 DrillFunctionWrapper.sample_length_combine()。
Source code in dimine_python_sdk\lib\prospecting\compositing.py
689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 | |
SampleLengthCombineParam
Bases: ParamModel
样长组合参数
Source code in dimine_python_sdk\lib\prospecting\models.py
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | |
SearchEllipsoidParams
Bases: ParamModel
搜索椭球体参数,可直接映射到 BlockModelDistancePowerParams。
三个角度依次为 Z-Y-X 欧拉角序列: R = Rz(π/2 − ellipsoid_azimuth) × Ry(ellipsoid_plunge) × Rx(ellipsoid_dip)
其中 R 的列向量为 [PC1, PC2, PC3]。
Source code in dimine_python_sdk\lib\prospecting\ellipsoid.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
center
instance-attribute
椭球体中心坐标 (x, y, z)
ellipsoid_azimuth = Field(..., alias='angle_main')
class-attribute
instance-attribute
方位角(°),主轴水平投影方向,0°=正北,90°=正东
ellipsoid_dip = Field(..., alias='angle_short')
class-attribute
instance-attribute
倾角(°),椭球体绕主轴旋转角,控制短轴(厚度方向)的侧倾
ellipsoid_main_radius = Field(..., alias='main_radius')
class-attribute
instance-attribute
主轴半径(m),椭球体最长半轴
ellipsoid_plunge = Field(..., alias='angle_second')
class-attribute
instance-attribute
倾伏角(°),主轴与水平面夹角,正值=向上,0°=水平,90°=垂直
ellipsoid_second_main_rate = Field(..., alias='second_main_rate')
class-attribute
instance-attribute
次轴/主轴比例
ellipsoid_short_main_rate = Field(..., alias='short_main_rate')
class-attribute
instance-attribute
短轴/主轴比例
pc1_direction
instance-attribute
主轴方向单位向量(走向方向)
pc2_direction
instance-attribute
次轴方向单位向量(倾向方向)
pc3_direction
instance-attribute
短轴方向单位向量(厚度方向)
second_radius
instance-attribute
次轴半径(m),椭球体中等半轴
short_radius
instance-attribute
短轴半径(m),椭球体最短半轴
to_block_model_params()
提取 BlockModelDistancePowerParams 所需的 6 个字段。
Returns:
| Type | Description |
|---|---|
dict
|
dict,包含 main_radius、second_main_rate、short_main_rate、 |
dict
|
angle_main、angle_second、angle_short |
Source code in dimine_python_sdk\lib\prospecting\ellipsoid.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
StepCombineParam
Bases: ParamModel
台阶组合参数
Source code in dimine_python_sdk\lib\prospecting\models.py
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | |
ThresholdConstraint
Bases: ParamModel
阈值约束 (type=2):基于属性值比较的约束
Source code in dimine_python_sdk\lib\prospecting\models.py
99 100 101 102 103 104 105 106 107 108 109 | |
XPlaneConstraint
Bases: ParamModel
X 平面约束 (type=5):基于 X 坐标值的上部/下部约束,一种特殊的平面约束
Source code in dimine_python_sdk\lib\prospecting\models.py
146 147 148 149 150 151 152 153 154 155 156 | |
YPlaneConstraint
Bases: ParamModel
Y 平面约束 (type=6):基于 Y 坐标值的上部/下部约束,一种特殊的平面约束
Source code in dimine_python_sdk\lib\prospecting\models.py
159 160 161 162 163 164 165 166 167 168 169 | |
ZPlaneConstraint
Bases: ParamModel
Z 平面约束 (type=7):基于 Z 坐标值(高程)的上部/下部约束,一种特殊的平面约束
Source code in dimine_python_sdk\lib\prospecting\models.py
172 173 174 175 176 177 178 179 180 181 182 | |
block_constrain_to_dmc_file(block_model_file, constrain_params, constrain_result_file)
块约束保存到约束结果 dmc 文件
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
block_model_file
|
str
|
块段模型文件路径 |
required |
constrain_params
|
list[BlockModelConstraintItem] | BlockModelConstraintItem
|
约束参数 |
required |
constrain_result_file
|
str
|
约束结果文件路径 |
required |
Returns:
| Type | Description |
|---|---|
bool
|
bool |
Source code in dimine_python_sdk\lib\prospecting\block_model.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
composite_samples(db_or_samples, composite_length=2.0, grade_fields=None, combine_percent=0.75, discard_low_coverage=False, start_mode='first_sample', include_3d_coords=True, auto_detect_grade_fields=True, survey_df=None, collar_df=None)
样长组合便捷函数。
支持两种输入模式: 1. 从 DmdFile 直接传入: result = composite_samples(dmd, composite_length=2.0, grade_fields=['TFe']) 2. 从独立的 DataFrame 传入: result = composite_samples( sample_df, composite_length=2.0, grade_fields=['TFe', 'TiO2'], survey_df=survey_df, collar_df=collar_df )
discard_low_coverage 策略: - False(默认):保留所有组合区间,通过 "低覆盖率" 列标记 - True:尾部截断——找到最后一个合格区间,丢弃其之后的所有区间。 如需丢弃所有不合格区间(包括中间的),请在结果上执行: df = df[~df['低覆盖率']]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db_or_samples
|
DmdFile 实例 或 样品表 pd.DataFrame |
required | |
composite_length
|
float
|
组合样长度(米),默认 2.0 |
2.0
|
grade_fields
|
Optional[List[str]]
|
品位字段列表。为 None 时自动检测数值列 |
None
|
combine_percent
|
float
|
最小覆盖率(0-1),默认 0.75 |
0.75
|
discard_low_coverage
|
bool
|
尾部截断模式,默认 False |
False
|
start_mode
|
str
|
起始模式,默认 'first_sample' |
'first_sample'
|
include_3d_coords
|
bool
|
是否计算3D坐标 |
True
|
auto_detect_grade_fields
|
bool
|
是否自动检测品位字段 |
True
|
survey_df
|
Optional[DataFrame]
|
测斜表(仅当 db_or_samples 为 DataFrame 时需要) |
None
|
collar_df
|
Optional[DataFrame]
|
孔口表(仅当 db_or_samples 为 DataFrame 时需要) |
None
|
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
(composited_df, summary) 元组 |
.. deprecated:: 此函数为纯 Python 实现,已废弃。请改用 C++ 原生接口。
Source code in dimine_python_sdk\lib\prospecting\compositing.py
884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 | |
compute_search_ellipsoid(points, voxel_size=5.0)
从点云计算搜索椭球体参数。
流程:体素降采样 → MVEE → 角度分解。
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
points
|
ndarray
|
点云坐标,shape=(N, 3),(x=东, y=北, z=高程) |
required |
voxel_size
|
Optional[float]
|
体素降采样尺寸(米),设为 None 或 0 则跳过降采样。 推荐 5.0 m,可有效消除三角网密度不均的影响。 |
5.0
|
Returns:
| Type | Description |
|---|---|
SearchEllipsoidParams
|
SearchEllipsoidParams,包含 6 个核心参数及辅助信息 |
Raises:
| Type | Description |
|---|---|
ValueError
|
点云数量不足(< 4) |
Example::
params = compute_search_ellipsoid(points, voxel_size=5.0)
# 直接用于距离幂估值
eval_params = BlockModelDistancePowerParams(
**params.to_block_model_params(),
sample_file="样品.dmg",
variables=["CU"],
extra_attributes="样品点数目",
)
Source code in dimine_python_sdk\lib\prospecting\ellipsoid.py
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 | |
compute_search_ellipsoid_from_dmf(dmf_path, voxel_size=5.0)
从 DMF 矿体模型文件直接计算搜索椭球体参数。
自动提取所有 Shell 实体的顶点,执行体素降采样与 MVEE 计算。
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dmf_path
|
str
|
DMF 矿体模型文件路径 |
required |
voxel_size
|
float
|
体素降采样尺寸(米),推荐 5.0 m |
5.0
|
Returns:
| Type | Description |
|---|---|
SearchEllipsoidParams
|
SearchEllipsoidParams |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
DMF 文件不存在 |
ValueError
|
DMF 中无 Shell 实体 |
Source code in dimine_python_sdk\lib\prospecting\ellipsoid.py
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 | |
create_block_model(params)
创建空块段模型
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
CreateBlockModelParams
|
CreateBlockModelParams 参数实例 |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
创建结果 {"state": "ok", ...} |
Raises:
| Type | Description |
|---|---|
BlockModelCreateError
|
创建失败时抛出 |
Source code in dimine_python_sdk\lib\prospecting\block_model.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | |
钻孔数据库 DMD 转 DMG
除上述应用层 API 外,可使用 dimine_python_sdk.lib.io.file_converter 中的 convert_file() 函数完成 .dmd → .dmg 转换:
from dimine_python_sdk.lib.io import convert_file
convert_file("input.dmd", "output.dmg")