Skip to content

iscc.sample.spatialize

spatialize(cell_data, section_frac=1.0, jitter=0.5, seed=0)

Give each cell a sub-deme (row, col) position, optionally thinning to a section.

Each deme's cells are scattered uniformly within the deme's unit cell (its integer coordinate ± jitter); the count engine tracks only per-deme counts, so the intra-deme layout is cosmetic while the composition (and the sampled section depth) is exact. When section_frac < 1 a random section_frac of each deme's cells is kept, modelling a thin flat section through the 3-D cell column.

Parameters:

Name Type Description Default
cell_data dict

Per-cell ground-truth tables from the sampling stage; uses cell_deme (deme id per cell) and cell_crd (integer deme coordinates). All per-cell tables are carried over.

required
section_frac float

Fraction of each deme's cells kept in the flat section. 1.0 keeps the whole column; smaller values model a thinner slice (fewer cells, so each spot pools fewer of them).

1.0
jitter float

Half-width of the uniform scatter within a deme's unit cell. 0 leaves a deme's cells stacked at its centre; 0.5 fills the whole unit cell.

0.5
seed int

RNG seed for the per-deme section subsample and the jitter.

0

Returns:

Type Description
dict

A copy of cell_data restricted to the section's cells, with cell_crd replaced by continuous sub-deme (row, col) positions.