🌊 Binary Tree Sampling for Seismic Data

Seismic Data Context

Imagine you have 64 seismic slices from a 3D cube. Instead of taking consecutive slices (which might miss geological features), binary tree sampling ensures good spatial coverage:

Selected slices (red) are distributed across the entire volume

20
7

Dataset Visualization

Red lines show selected sample positions in the dataset

Binary Tree Structure

Each level shows how the algorithm recursively divides the range and selects samples

Algorithm Steps:

Step 1: Find midpoint of range [start, end] and select it
Step 2: Calculate remaining budget (size - 1)
Step 3: Split remaining budget between left and right halves using ceil/floor
Step 4: Recursively sample left half [start, midpoint) and right half (midpoint, end]
Step 5: Combine all samples and optionally sort them

Why This Works for Seismic Data: