block_model
业务层:块段模型管理器
直接调用 native 层 dimine_python_sdk.lib.native.prospecting,
不经过 _adapter。
职责:Pydantic 参数模型序列化、异常翻译、用户友好的 API
BlockDataError
Bases: RuntimeError
块段模型操作异常基类
Source code in dimine_python_sdk\lib\prospecting\block_model.py
45 46 47 | |
BlockModelCreateError
Bases: BlockDataError
创建块段模型失败
Source code in dimine_python_sdk\lib\prospecting\block_model.py
55 56 57 | |
BlockModelEvaluationError
Bases: BlockDataError
块段模型估值失败
Source code in dimine_python_sdk\lib\prospecting\block_model.py
60 61 62 63 64 | |
BlockModelEvaluator
块段模型估值与储量计算器
所有方法接受块段模型文件路径,失败时抛出自定义异常(不返回 tuple):
evaluator = BlockModelEvaluator()
result = evaluator.distance_power_evaluation(
"model.dmb", constraint, idw_params
)
# result -> {"success": True, "message": "..."}
Raises:
| Type | Description |
|---|---|
BlockModelEvaluationError
|
估值失败 |
ReservesCalculateError
|
储量计算失败 |
Source code in dimine_python_sdk\lib\prospecting\block_model.py
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 | |
calculate_reserves(block_model_file, constraint_params, reserve_params)
staticmethod
储量计算
Source code in dimine_python_sdk\lib\prospecting\block_model.py
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 | |
distance_power_evaluation(block_model_file, constraint_params, evaluation_params, overwrite_result=True)
staticmethod
距离幂估值计算
Source code in dimine_python_sdk\lib\prospecting\block_model.py
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | |
kriging_evaluation(block_model_file, constraint_params, evaluation_params, overwrite_result=True)
staticmethod
克里格估值计算
Source code in dimine_python_sdk\lib\prospecting\block_model.py
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | |
BlockModelLoadError
Bases: BlockDataError
加载块段模型失败
Source code in dimine_python_sdk\lib\prospecting\block_model.py
50 51 52 | |
DmBlockData
块段模型管理器
管理单个块段模型的加载与属性访问。所有几何数据属性直接返回, 无需 getter 前缀:
block = DmBlockData("model.dmb")
origin = block.origin # np.ndarray
xyz_len = block.xyz_length # list[float]
max_level = block.max_level # int
fc = block.field_definitions # list[dict]
total = block.total_block_count # int
# 遍历块段数据
for data in block.iter_blocks("品位"):
print(data)
静态方法(无需实例化): result = DmBlockData.create_block_model(params) DmBlockData.block_constrain_to_dmc_file(block_file, constraint, output)
Source code in dimine_python_sdk\lib\prospecting\block_model.py
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 116 117 118 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 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 | |
field_definitions
property
字段定义列表
max_level
property
模型最大精度层级
min_size
property
最小块段尺寸
origin
property
模型原点坐标
rotation
property
模型旋转角度
total_block_count
property
块段总数量
xyz_length
property
模型 X/Y/Z 方向总长度
__init__(file_path=None)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str | None
|
块段模型文件路径。为 None 时需手动调用 open() |
None
|
Source code in dimine_python_sdk\lib\prospecting\block_model.py
114 115 116 117 118 119 120 121 | |
block_constrain_to_dmc_file(block_model_file, constrain_params, constrain_result_file)
staticmethod
块约束保存到约束结果 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
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 | |
create_block_model(params)
staticmethod
创建空块段模型
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
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | |
iter_blocks(field_name)
遍历块段模型的所有块段数据
Source code in dimine_python_sdk\lib\prospecting\block_model.py
188 189 190 191 | |
open(file_path)
加载块段模型文件
Raises:
| Type | Description |
|---|---|
BlockModelLoadError
|
加载失败时抛出 |
Source code in dimine_python_sdk\lib\prospecting\block_model.py
123 124 125 126 127 128 129 130 131 132 133 | |
ReservesCalculateError
Bases: BlockDataError
储量计算失败
Source code in dimine_python_sdk\lib\prospecting\block_model.py
67 68 69 70 71 | |