Calculate Weighted Coordination Numbers
calculate_weighted_neighbor_counts.RdCounts 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 NULL so the file can be discarded by the analysis pipeline.
Value
A data.table with columns 'Atom', 'CoordinationNumber', and 'WeightedCoordinationNumber'.
Returns NULL if the occupancies sum to > 1 on any shared site.
See also
Other property calculators:
calculate_angles(),
calculate_distances(),
calculate_neighbor_counts(),
filter_atoms_by_symbol(),
filter_by_elements(),
filter_by_wyckoff_symbol()
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)
#> Warning: Fractional occupancies add up to greater than 1.0 on one or more sites. Discarding file.
#> NULL