Site Analysis Walkthrough¶
This tutorial shows how to analyse crystallization events at individual lattice sites using CGAspects.
Prerequisites¶
- A CrystoGen simulation folder containing:
- Crystallization event files
- Population/occupation files
- Site energy or coordinate data
- CGAspects is open with the folder imported
Step 1 — Load the Data¶
- Click Import XYZ Files and select the folder
- If crystallization event files are detected, the Calculate Site Analysis button becomes active
Tip
If the button is greyed out, the expected event files were not found. Check that the folder contains the CrystoGen output files (not just the XYZ shape files).
Step 2 — Start Site Analysis¶
Click Calculate Site Analysis. The analysis runs in the background — a progress bar appears for large datasets.
Step 3 — Explore Results in the Plotting Dialog¶
When complete, the plotting dialog opens with site analysis data.
Key Variables to Explore¶
| Variable | Description |
|---|---|
| energy | Site interaction energy — lower = more stable |
| occupation | Fraction of time the site was occupied |
| coordination | Number of occupied neighbours at crystallization |
| total_events | Total crystallization/dissolution event count |
| tile_type | Face / edge / corner classification |
Start with a scatter plot of energy vs occupation to see the relationship between site stability and how often each site is occupied.
Step 4 — Highlight Sites in the 3D Viewport¶
Click a point in the scatter plot — the corresponding site is highlighted in the 3D viewport. This connects data features to spatial positions in the crystal.
To highlight multiple sites:
- Open View → Highlight Sites (
Ctrl+Shift+S) - Enter site numbers from the plot (e.g.,
1-50for the lowest-energy sites) - Choose a highlight colour
- Click Apply All
The selected sites light up in the 3D viewport in your chosen colour.
Step 5 — Filter the Data¶
Focus on a specific subset of sites using the Data Filter:
- Click Filter in the plotting dialog toolbar
- In the Data Filters tab, add a condition: e.g.,
energy < -100 - Click Apply
The plot updates to show only sites matching the filter. The status bar shows how many sites passed the filter.
Interaction Filters¶
Switch to the Interaction Filters tab to filter sites by the frequency of specific neighbour interaction types. This can isolate sites with particular crystallographic bonding environments.
Step 6 — Hierarchical Clustering¶
To group sites by interaction pattern similarity:
- In the plotting dialog, enable Hierarchical Clustering
- The sites are grouped automatically and colour-coded by cluster membership
- Plot energy vs occupation again — clusters of similar bonding environments appear as colour-grouped regions
This reveals structurally distinct site populations (e.g., terraces, steps, kinks).
Step 7 — Export¶
- Save plot: Click Save in the navigation toolbar
- CSV data:
aspects_output/site_analysis.csvandinteraction_data.csv - Filtered export: Apply a filter, then export only the filtered rows from the plotting dialog
Interpreting the Results¶
| Site Property | High Value Means | Low Value Means |
|---|---|---|
| Energy | Weakly bound, prone to dissolution | Strongly bound, stable |
| Occupation | Site is frequently occupied | Site crystallizes rarely |
| Coordination | Well-surrounded (bulk-like) | Surface site (kink/edge) |
| Total events | High exchange rate | Stable once occupied |
Sites with high energy and low occupation are the most soluble (typically surface steps or kinks). Sites with low energy and high occupation are the most stable face sites.
For more background, see Shape Metrics and Zingg Classification.