prospecting
Native Layer v2 勘探模块
钻孔数据库与块段模型封装,对外只暴露 pd.DataFrame / dict / numpy。
BlockModelSession
块段模型会话,内部持有 C++ dmBlockDataNew 对象
Source code in dimine_python_sdk\lib\native\prospecting.py
637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 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 | |
field_definitions
property
字段定义列表
max_level
property
最大精度层级
min_size
property
最小块段尺寸(对应 max_level 层级的块段尺寸)
origin
property
模型原点
rotation
property
模型旋转角度
total_block_count
property
块段总数量
xyz_length
property
模型 X/Y/Z 方向总长度
close()
释放 C++ 对象,解除文件占用
Source code in dimine_python_sdk\lib\native\prospecting.py
740 741 742 743 | |
get_level_size(level)
获取指定层级的块段尺寸 [size_x, size_y, size_z]
以 min_size(= max_level 时的尺寸)为基准反推: size_at_level(L) = min_size * 2^(max_level - L)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
int
|
层级(0 ~ max_level),0 为最粗粒度、max_level 为最细粒度 |
required |
Returns:
| Type | Description |
|---|---|
list[float]
|
[size_x, size_y, size_z] |
Raises:
| Type | Description |
|---|---|
ValueError
|
level 超出 [0, max_level] 范围 |
Source code in dimine_python_sdk\lib\native\prospecting.py
675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 | |
iter_blocks(field_name=None)
遍历所有块段,逐块返回指定字段数据
Source code in dimine_python_sdk\lib\native\prospecting.py
721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 | |
level_size_map()
获取 0 ~ max_level 所有层级的块段尺寸对照表
Returns:
| Type | Description |
|---|---|
dict[int, list[float]]
|
{level: [size_x, size_y, size_z], ...} |
Source code in dimine_python_sdk\lib\native\prospecting.py
697 698 699 700 701 702 703 | |
open(file_path)
classmethod
加载块段模型
Source code in dimine_python_sdk\lib\native\prospecting.py
644 645 646 647 648 649 650 | |
DrillSession
钻孔数据库会话,内部持有 C++ dmGeoDrillData 对象
Source code in dimine_python_sdk\lib\native\prospecting.py
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 | |
extend_table_count
property
扩展表数量
file_path
property
DMD 文件路径
close()
释放 C++ 对象,解除文件占用
Source code in dimine_python_sdk\lib\native\prospecting.py
419 420 421 422 423 424 | |
collar_table()
获取孔口表
Source code in dimine_python_sdk\lib\native\prospecting.py
349 350 351 352 353 354 355 356 357 | |
create_empty()
classmethod
创建空钻孔数据库
Source code in dimine_python_sdk\lib\native\prospecting.py
161 162 163 164 | |
extend_table_metas()
返回扩展表元数据列表(不含 DataFrame)。
Returns:
| Type | Description |
|---|---|
list[NativeExtendTableMeta]
|
list of NativeExtendTableMeta |
Source code in dimine_python_sdk\lib\native\prospecting.py
237 238 239 240 241 242 243 | |
extend_tables()
加载全部扩展表,返回含数据和元数据的完整列表。
DMT 文件路径根据 dmd 文件所在目录 + dmt_filename 拼接。
Returns:
| Type | Description |
|---|---|
list[NativeExtendTable]
|
list of NativeExtendTable |
Source code in dimine_python_sdk\lib\native\prospecting.py
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 | |
get_extend_table(index)
按索引加载扩展表数据。
从 DMT 文件加载数据,保留原始列名不做重命名。
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
扩展表索引(0-based) |
required |
Returns:
| Type | Description |
|---|---|
'pd.DataFrame'
|
pd.DataFrame,文件不存在或无元数据时返回空 DataFrame |
Source code in dimine_python_sdk\lib\native\prospecting.py
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 | |
lithology_table()
获取岩性表
Source code in dimine_python_sdk\lib\native\prospecting.py
377 378 379 380 381 382 383 384 385 | |
load(file_path)
classmethod
加载钻孔数据库
Source code in dimine_python_sdk\lib\native\prospecting.py
152 153 154 155 156 157 158 159 | |
sample_table()
获取样品表
Source code in dimine_python_sdk\lib\native\prospecting.py
391 392 393 394 395 396 397 398 399 | |
save_as_dmg(file_path)
保存为 .dmg 格式
先通过 GetDisplayDB 获取 dmDbDatabase 对象,保存为临时 .dmf 文件, 再将 .dmf 拷贝并重命名为 .dmg。
Source code in dimine_python_sdk\lib\native\prospecting.py
405 406 407 408 409 410 411 412 413 414 415 416 417 | |
set_collar_table(df)
设置孔口表
Source code in dimine_python_sdk\lib\native\prospecting.py
359 360 361 | |
set_lithology_table(df)
设置岩性表
Source code in dimine_python_sdk\lib\native\prospecting.py
387 388 389 | |
set_sample_table(df)
设置样品表
Source code in dimine_python_sdk\lib\native\prospecting.py
401 402 403 | |
set_survey_table(df)
设置测斜表
Source code in dimine_python_sdk\lib\native\prospecting.py
373 374 375 | |
survey_table()
获取测斜表
Source code in dimine_python_sdk\lib\native\prospecting.py
363 364 365 366 367 368 369 370 371 | |
block_constrain_to_dmc_file(block_model_file, constraint_json, output_file)
块约束保存到约束结果 dmc 文件
Source code in dimine_python_sdk\lib\native\prospecting.py
757 758 759 760 761 762 763 764 765 766 767 | |
calculate_reserves(block_model_file, constraint_json, reserve_json)
储量计算
Source code in dimine_python_sdk\lib\native\prospecting.py
815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 | |
create_block_model(params)
创建空块段模型
Source code in dimine_python_sdk\lib\native\prospecting.py
750 751 752 753 754 | |
distance_power_evaluation(block_model_file, constraint_json, evaluation_json, overwrite=True)
距离幂估值
Source code in dimine_python_sdk\lib\native\prospecting.py
781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 | |
extra_high_grade_process(param)
特高品位处理
Source code in dimine_python_sdk\lib\native\prospecting.py
450 451 452 453 454 455 456 457 458 459 | |
kriging_evaluation(block_model_file, constraint_json, evaluation_json, overwrite=True)
克里格估值
Source code in dimine_python_sdk\lib\native\prospecting.py
798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 | |
sample_length_combine(param)
样长组合
Source code in dimine_python_sdk\lib\native\prospecting.py
438 439 440 441 | |
save_drill_database(collar_df, survey_df, lithology_df, save_path, sample_df=None, extend_tables=None)
保存钻孔数据库:子表 .dmt + .dmd 引用文件。
完全走 Python 层,不调用 C++ geo_drill_save;直接通过
NativeDataTableHandle 与底层 CDataTable 交互。
Parameters
extend_tables : list[dict], optional 扩展表列表,每个元素为 dict: - df: pd.DataFrame 扩展表数据 - dmt_filename: str .dmt 文件名(如 "分层表.dmt") - field_list: str 字段元数据("孔号列,从列,至列,标题"),可为空 - hole_id_column: str|null 钻孔编号对应列名(field_list 为空时用于自动构造) - from_column: str|null 起始深度对应列名 - to_column: str|null 结束深度对应列名 - display_title: str|null 标题名称(Dimine UI 显示用) 用于隐式地层建模等场景,最终写入 ExtendTableCount / ExtendTable{N}Path 等引用字段。
Source code in dimine_python_sdk\lib\native\prospecting.py
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 620 621 622 623 624 625 626 627 628 629 630 | |
step_combine(param)
台阶组合
Source code in dimine_python_sdk\lib\native\prospecting.py
444 445 446 447 | |