Skip to content

Commit 87032c3

Browse files
committed
initial commit of November 2023 Webinar scripts NO_JIRA
1 parent 8603813 commit 87032c3

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

scripts/november_2023_morphology_webinar/ReadMe.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Put title here
1+
# Working with morphologies and CSD-Particle
22

33
This is a collection of scripts from the November 2023 CCDC Webinar on crystal morphologies, presented by Dr Andrew G.
44
P. Maloney.
@@ -14,12 +14,8 @@ This folder contains the following scripts:
1414
Calculates the VisualHabit morphology of `IBPRAC18` (ibuprofen) and descriptors for the (100) surface. Also calculates
1515
particle rugosity.
1616
- `morphology_plot.py`
17-
Contains a function to generate a 3D plot of a crystal morphology using Matplotlib.
18-
- `morphology_shape_classification`
19-
Contains a definition of the `ShapeClassifier` class, which is used to calculate particle shape. This script also
20-
contains functions to generate Zingg plots.
21-
- `shape_classification.py`
22-
Runs an example of the usage of the `ShapeClassifier` class using the structure `SUCACB02`.
17+
Contains a function to generate a 3D plot of a crystal morphology using Matplotlib. Running the script will plot the
18+
BFDH morphology of `IBPRAC18` (ibuprofen).
2319

2420
## Requirements
2521

@@ -30,6 +26,12 @@ Python API.
3026

3127
- CSD-Core, CSD-Particle
3228

29+
## Usage
30+
31+
Each script can be run independently from the command line:
32+
33+
`python script_name.py`
34+
3335
### Author
3436

3537
Pietro Sacchi

scripts/november_2023_morphology_webinar/morphology_plot.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,13 @@ def generate_morphology_plot(morphology, labels=None):
4545
s=10,
4646
color='black')
4747
plt.show()
48+
49+
50+
if __name__ == "__main__":
51+
from ccdc.io import EntryReader
52+
from ccdc.morphology import BFDHMorphology
53+
54+
csd = EntryReader('CSD')
55+
ibuprofen = csd.crystal("IBPRAC18")
56+
bfdh_morphology = BFDHMorphology(ibuprofen)
57+
generate_morphology_plot(bfdh_morphology)

0 commit comments

Comments
 (0)