Skip to content

Commit

Permalink
Update readme [save benchmark results]
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSazonov committed Jul 26, 2024
1 parent f0da900 commit 919a92d
Showing 1 changed file with 2 additions and 78 deletions.
80 changes: 2 additions & 78 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,86 +236,10 @@ Install the matplotlib package used in the example below:
pip install matplotlib
```

Example.py
Run this example [srtio3-pattern-simulation.py](examples/pyCFML/cfml_utilities/powder_pattern_from_json/srtio3-pattern-simulation.py) to simulate the powder diffraction pattern:

```
import matplotlib.pyplot as plt
from pycrysfml import cfml_utilities
EXAMPLE = {
"phases": [
{
"SrTiO3": {
"_space_group_name_H-M_alt": "P m -3 m",
"_cell_length_a": 3.9,
"_cell_length_b": 3.9,
"_cell_length_c": 3.9,
"_cell_angle_alpha": 90,
"_cell_angle_beta": 90,
"_cell_angle_gamma": 90,
"_atom_site": [
{
"_label": "Sr",
"_type_symbol": "Sr",
"_fract_x": 0.5,
"_fract_y": 0.5,
"_fract_z": 0.5,
"_occupancy": 1,
"_adp_type": "Biso",
"_B_iso_or_equiv": 0.40
},
{
"_label": "Ti",
"_type_symbol": "Ti",
"_fract_x": 0,
"_fract_y": 0,
"_fract_z": 0,
"_occupancy": 1,
"_adp_type": "Biso",
"_B_iso_or_equiv": 0.50
},
{
"_label": "O",
"_type_symbol": "O",
"_fract_x": 0.5,
"_fract_y": 0,
"_fract_z": 0,
"_occupancy": 1,
"_adp_type": "Biso",
"_B_iso_or_equiv": 0.65
}
]
}
}
],
"experiments": [
{
"NPD": {
"_diffrn_source": "nuclear reactor",
"_diffrn_radiation_probe": "neutron",
"_diffrn_radiation_wavelength": 1.27,
"_pd_instr_resolution_u": 0.02,
"_pd_instr_resolution_v": -0.02,
"_pd_instr_resolution_w": 0.12,
"_pd_instr_resolution_x": 0.0015,
"_pd_instr_resolution_y": 0,
"_pd_instr_reflex_asymmetry_p1": 0,
"_pd_instr_reflex_asymmetry_p2": 0,
"_pd_instr_reflex_asymmetry_p3": 0,
"_pd_instr_reflex_asymmetry_p4": 0,
"_pd_meas_2theta_offset": 0,
"_pd_meas_2theta_range_min": 1,
"_pd_meas_2theta_range_max": 140,
"_pd_meas_2theta_range_inc": 0.05
}
}
]
}
if __name__ == '__main__':
x, y = cfml_utilities.powder_pattern_from_json(EXAMPLE)
plt.plot(x, y)
plt.show()
python examples/pyCFML/cfml_utilities/powder_pattern_from_json/srtio3-pattern-simulation.py
```

More features will be added as the project develops.

0 comments on commit 919a92d

Please sign in to comment.