# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3 (ipykernel)
#     language: python
#     name: python3
# ---

# # Database XRD

# +
from XRDXRFutils import DatabaseXRD,PhaseList

from matplotlib.pyplot import xlim,ylim,xlabel,ylabel,legend,cm
from numpy import linspace
# -

database = DatabaseXRD().read_cifs('Database')

# +
lazurite = database['Lazurite'][0]
hydrocerussite = database['Hydrocerussite'][0]

lazurite.plot(color='r')
hydrocerussite.plot(color='c')

legend(frameon=False)
xlim(20,50)
ylim(0,1)
xlabel(r'angle $\theta$')
ylabel(r'relative intensity')

# +
phases = PhaseList([lazurite,hydrocerussite])
phases.plot()

legend(frameon=False)
xlim(20,50)
ylim(0,1)
xlabel(r'angle $\theta$')
ylabel(r'relative intensity')
# -

# ### Print chemical composition from the database

for name,phase in database.items():
    print('%s:\t'%name,phase[0]['_chemical_formula_sum'])



StarcoderdataJupyterScriptsDedupFiltered