% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/calculate_properties.R
\name{calculate_weighted_neighbor_counts}
\alias{calculate_weighted_neighbor_counts}
\title{Calculate Weighted Coordination Numbers}
\usage{
calculate_weighted_neighbor_counts(bonded_pairs_table, atomic_coordinates)
}
\arguments{
\item{bonded_pairs_table}{A \code{data.table} of bonded pairs (e.g., from \code{minimum_distance}).}

\item{atomic_coordinates}{A \code{data.table} of asymmetric atoms from \code{extract_atomic_coordinates}.}
}
\value{
A \code{data.table} with columns 'Atom', 'CoordinationNumber', and 'WeightedCoordinationNumber'.
Returns \code{NULL} if the occupancies sum to > 1 on any shared site.
}
\description{
Counts the weighted number of nearest neighbors for each central atom based on
a table of bonded pairs, accounting for the fractional occupancy of the neighbor sites.
This is particularly useful for analyzing disordered crystal structures.

If all occupancies are 1.0, this efficiently returns the standard coordination number.
If the fractional occupancies on any single crystallographic site sum to greater than 1.0,
this indicates an invalid or physically impossible structure; the function will throw a
warning and return \code{NULL} so the file can be discarded by the analysis pipeline.
}
\examples{
bp <- data.table::data.table(Atom1 = c("Si1", "Si1"),
                             Atom2 = c("O1_1_0_0", "O2_1_0_0"))
ac <- data.table::data.table(Label = c("Si1", "O1", "O2"),
                             Occupancy = c(1.0, 0.5, 0.5),
                             x_a=c(0,0,0), y_b=c(0,0,0), z_c=c(0,0,0))
calculate_weighted_neighbor_counts(bp, ac)
}
\seealso{
Other property calculators: 
\code{\link{calculate_angles}()},
\code{\link{calculate_distances}()},
\code{\link{calculate_neighbor_counts}()},
\code{\link{filter_atoms_by_symbol}()},
\code{\link{filter_by_elements}()},
\code{\link{filter_by_wyckoff_symbol}()}
}
\concept{property calculators}
