Skip to content

lucem_ops::analytics

Columnar & tabular analytics powered by Apache Arrow (arrow) and Polars (polars).

Bridges GPU measurement outputs from crate::measure, crate::core::histogram, and crate::metric into typed Arrow RecordBatches and Polars DataFrames for zero-copy tabular inspection, filtering, sorting, and export in lucem-app and lucem-cli.

pub fn region_features_arrow_schema() -> Schema

Builds the canonical Apache Arrow Schema for connected-component RegionFeatures.

pub fn regions_to_record_batch(regions: &[RegionFeatures]) -> OpsResult<RecordBatch>

Converts a slice of RegionFeatures into an Apache Arrow RecordBatch.

pub fn regions_to_dataframe(regions: &[RegionFeatures]) -> OpsResult<DataFrame>

Converts a slice of RegionFeatures into a Polars DataFrame for fast filtering, sorting, and statistical aggregation.

pub fn histogram_to_dataframe(
bin_centers: &[f64],
counts: &[u32],
) -> OpsResult<(RecordBatch, DataFrame)>

Converts device histogram bin_centers and counts into both an Apache Arrow RecordBatch and a Polars DataFrame with normalized probability density density.

pub fn profile_to_dataframe(distances: &[f64], intensities: &[f64]) -> OpsResult<DataFrame>

Converts a 1-D intensity line profile into a Polars DataFrame with columns ("distance_px", "intensity").