parq_blockmodel.reblocking.reblocking.downsample_blockmodel

parq_blockmodel.reblocking.reblocking.downsample_blockmodel#

parq_blockmodel.reblocking.reblocking.downsample_blockmodel(blockmodel, new_block_size, aggregation_config)[source]#

Downsample a block model to a coarser grid with specified aggregation methods for each attribute. This function supports downsampling of both categorical and numeric attributes. :type blockmodel: :param blockmodel: ParquetBlockModel instance. :type new_block_size: :param new_block_size: tuple of floats (dx, dy, dz) for the new block size. :type aggregation_config: :param aggregation_config: dict mapping attribute names to aggregation methods.

Use basis for weighted_mean configurations.

Example

aggregation_config = {

‘grade’: {‘method’: ‘weighted_mean’, ‘basis’: ‘dry_mass’}, ‘density’: {‘method’: ‘weighted_mean’, ‘basis’: ‘volume’}, ‘dry_mass’: {‘method’: ‘sum’}, ‘volume’: {‘method’: ‘sum’}, ‘rock_type’: {‘method’: ‘mode’}

}

Returns:

A new ParquetBlockModel instance with the downsampled grid.

Return type:

ParquetBlockModel