upxo.geoEntities.point_processes module
Point Process Generation Module
Generate synthetic point patterns for microstructure modeling and testing.
- Includes:
Poisson (uniform random)
Poisson cluster process
Matérn hard-core process
Regular lattice
Gibbs processes
Strauss process
Log-Gaussian Cox process (LGCP)
Thomas cluster process
Example
from upxo.pxtalops.point_processes import PoissonPointProcess, MaternHardCore
# Generate Poisson points ppp = PoissonPointProcess(intensity=0.01, window=(100, 100)) points = ppp.generate()
# Generate hard-core process mhc = MaternHardCore(intensity=0.005, hard_core_radius=5, window=(100, 100)) points = mhc.generate()
- class upxo.geoEntities.point_processes.Window(xmin: float = 0.0, xmax: float = 100.0, ymin: float = 0.0, ymax: float = 100.0)[source]
Bases:
objectSpatial window for point process
- class upxo.geoEntities.point_processes.PointProcess(window: Tuple[float, float, float, float] | None = None, seed: int | None = None)[source]
Bases:
ABCAbstract base class for point processes
- abstractmethod generate() pandas.DataFrame[source]
Generate point pattern. Returns DataFrame with columns [x, y, …]
- calculate_k_function(points: pandas.DataFrame, r_max: float = 10.0, r_count: int = 50) Dict[str, numpy.ndarray][source]
Calculates Ripley’s K-function K(r) using PySAL’s pointpats.K.
- calculate_g_r(points: pandas.DataFrame, r_max: float = 10.0, r_count: int = 50, dimension: int = 2) Dict[str, numpy.ndarray][source]
Calculates the Pair Correlation Function g(r) by deriving it numerically from the K-function obtained via pointpats.K.
- Parameters:
- Returns:
- Dictionary containing ‘r_g’ (radii for g(r))
and ‘g_r’ (the Pair Correlation function estimate).
- Return type:
Dict[str, np.ndarray]
- class upxo.geoEntities.point_processes.PoissonPointProcess(intensity: float = 0.01, window: Tuple | None = None, seed: int | None = None)[source]
Bases:
PointProcessHomogeneous Poisson point process.
Points are uniformly distributed; counts follow Poisson distribution.
- class upxo.geoEntities.point_processes.InhomogeneousPoissonPointProcess(intensity_func, max_intensity: float, window: Tuple | None = None, seed: int | None = None)[source]
Bases:
PointProcessInhomogeneous Poisson point process with spatially varying intensity.
- class upxo.geoEntities.point_processes.PoissonClusterProcess(parent_intensity: float = 0.005, n_offspring_per_parent: int = 10, offspring_radius: float = 5.0, window: Tuple | None = None, seed: int | None = None)[source]
Bases:
PointProcessPoisson cluster process (Neyman-Scott).
Parents follow Poisson; offspring cluster around parents.
- class upxo.geoEntities.point_processes.MaternHardCore(intensity: float = 0.005, hard_core_radius: float = 5.0, window: Tuple | None = None, seed: int | None = None)[source]
Bases:
PointProcessMatérn hard-core process.
Points repel each other: no two points within hard_core_radius. Generated via thinning of Poisson.
- upxo.geoEntities.point_processes.generate(self) pandas.DataFrame[source]
Generate hard-core points via rejection sampling (optimized with KDTree)
- class upxo.geoEntities.point_processes.ThomasClusterProcess(parent_intensity: float = 0.001, mean_offspring: float = 25, offspring_std: float = 3.0, window: Tuple | None = None, seed: int | None = None)[source]
Bases:
PointProcessThomas cluster process.
Offspring distributed normally around parent locations. Special case of Neyman-Scott.
- class upxo.geoEntities.point_processes.StraussProcess(beta: float = 0.05, gamma: float = 0.5, interaction_range: float = 10.0, window: Tuple | None = None, seed: int | None = None, max_iterations: int = 1000)[source]
Bases:
PointProcessStrauss process: pair-interaction point process.
Inhibitory: points less likely to appear near existing points. Interaction range and strength parameterized.