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

# +
import lattice
# #%matplotlib widget
import xrayutilities as xu
import matplotlib.pyplot as plt
from matplotlib import cm, rcParams
from matplotlib.colors import ListedColormap, LinearSegmentedColormap
import numpy as np

# Generate new colormap for RSM display
rainbow = cm.get_cmap('rainbow', 256)
newcolors = rainbow(np.linspace(0, 1, 256))
white = np.array([1, 1, 1, 1])
newcolors[:20, :] = white
newcmp = ListedColormap(newcolors)

refHKL = (2, 2, 0)
iHKL = (0,0,1)
oHKL = (1, 1, 0)
subMat = 'LSAT'

rsmFile = lattice.lattice(refHKL, iHKL, oHKL, subMat, geometry = 'real')
rsmFile.load_sub()
# -

# %matplotlib widget
ax = (rsmFile.plot2d( cmap='rainbow' ))
#ax2 = (rsmFile.plotQ(60,60))


# +
# %matplotlib widget
b = rsmFile.plotQ(100, 100, 4, 2, nlev=100, cmap='rainbow')
b.set_title(rsmFile.filename)
b.set_aspect(1)
#b.set_xlim(-0.11,0.11)
#b.set_ylim(4.18, 5.35)


# -



StarcoderdataJupyterScriptsDedupFiltered