Dans_Diffraction.classes_plotting (version 1.9.5)
index
c:\users\grp66007\onedrive - diamond light source ltd\pythonprojects\dans_diffraction\dans_diffraction\classes_plotting.py

Plotting Class "classes_plotting.py"
 functions to plot the crystal structure and simulated 
 diffraction patterns.
 
By Dan Porter, PhD
Diamond
2017
 
Version 1.9.5
Last updated: 15/11/21
 
Version History:
18/08/17 0.1    Program created
30/10/17 1.0    Main functions finished.
06/10/18 1.1    Program renamed
05/03/18 1.2    Added plt.show() to functions
17/04/18 1.3    Removed plt.show() from functions (allowing plot editing +stackig in non-interactive mode)
08/06/18 1.4    Corrected call to simulate_lattice_lines in simulate_reciprocal_plane
21/01/19 1.5    Added simulate_polarisation_resonant and _nonresonant
08/11/19 1.6    Increased pixel width on powder plots, improved superstructure recriprocal space planes
14/04/20 1.7    Added powder avereging to simulate_powder
15/04/20 1.7    Added minimum angle to simulate_powder
13/05/20 1.8    Added plot_exchange_paths
26/05/20 1.8.1  Removed tensor_scattering
16/06/20 1.8.2  Change to simulate_powder to make pixels int, remove linspace error in new numpy
29/06/20 1.9.0  Removed scipy.convolve2d due to problems importing, new method more accurate but slower
26/11/20 1.9.1  Added layers input to plot_layers
21/01/21 1.9.2  Added plot_xray_resonance
15/02/21 1.9.3  Added axis_reciprocal_lattice_points/lines/vectors
11/10/21 1.9.4  Centered crystal in plot_crystal
15/11/21 1.9.5  Added plot_diffractometer_reciprocal_space
 
@author: DGPorter

 
Modules
       
Dans_Diffraction.functions_crystallography
Dans_Diffraction.functions_general
Dans_Diffraction.functions_plotting
numpy
matplotlib.pyplot

 
Classes
       
builtins.object
MultiPlotting
Plotting
PlottingSuperstructure

 
class MultiPlotting(builtins.object)
    MultiPlotting(crystal_list)
 
Plotting functions for the Multi-Crystal Object
 
  Methods defined here:
__init__(self, crystal_list)
Initialize self.  See help(type(self)) for accurate signature.
quick_intensity_cut(self, x_axis_crystal=[[1, 0, 0]], y_axis_crystal=[[0, 1, 0]], centre=[0, 0, 0], q_max=4.0, cut_width=0.05)
Plot a cut through reciprocal space, visualising the intensity as different sized markers
  x_axis = direction along x, in units of the reciprocal lattice (hkl)
  y_axis = direction along y, in units of the reciprocal lattice (hkl)
  centre = centre of the plot, in units of the reciprocal lattice (hkl)
  q_max = maximum distance to plot to - in A-1
  cut_width = width in height that will be included, in A-1
 
E.G. hk plot at L=3 for hexagonal system:
    xtl.quick_intensity_cut([1,0,0],[0,1,0],[0,0,3])
     hhl plot:
    xtl.quick_intensity_cut([1,1,0],[0,0,1],[0,0,0])
simulate_intensity_cut(self, x_axis_crystal=[[1, 0, 0]], y_axis_crystal=[[0, 1, 0]], centre=[0, 0, 0], q_max=4.0, cut_width=0.05, background=0.0, peak_width=0.05)
Plot a cut through reciprocal space, visualising the intensity
  x_axis_crystal = list of crytal x-directions in (hkl), for each crystal
  y_axis_crystal = list of crytal y-directions in (hkl), for each crystal
  centre = centre of the plot, in units of the reciprocal lattice (hkl) of crystal 1
  q_max = maximum distance to plot to - in A-1
  cut_width = width in height that will be included, in A-1
  background = average background value
  peak_width = reflection width in A-1
 
E.G. hk plot at L=3 for hexagonal system (xtl1) with xtl2 oriented with the (110) alond xtl1's (100):
    xtls = multi_crystal([xtl1,xtl2])
    xtl.simulate_intensity_cut([[1,0,0],[1,1,0]],[[0,1,0],[0,0,1]],[0,0,3])
simulate_powder(self, energy_kev=8.0, peak_width=0.05, background=0, powder_average=True)
Generates a powder pattern for multiple phases
    see classes_scattering.generate_powder

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class Plotting(builtins.object)
    Plotting(xtl)
 
Plotting functions for the Crystal Object
 
  Methods defined here:
__init__(self, xtl)
initialise
axis_reciprocal_lattice_lines(self, x_axis=(1, 0, 0), y_axis=(0, 1, 0), centre=(0, 0, 0), q_max=4.0, cut_width=0.05, axes=None, *args, **kwargs)
Add lines to the current axis showing the reciprocal lattice
:param x_axis: direction along x, in units of the reciprocal lattice (hkl)
:param y_axis: direction along y, in units of the reciprocal lattice (hkl)
:param centre: centre of the plot, in units of the reciprocal lattice (hkl)
:param q_max: maximum distance to plot to - in A-1
:param cut_width: width in height that will be included, in A-1
:param axes: None for plt.gca() or axis of choice
:param args: argments to pass to plot function, e.g. linewidth, alpha, color
:return: None
axis_reciprocal_lattice_points(self, axes=None, x_axis=(1, 0, 0), y_axis=(0, 1, 0), centre=(0, 0, 0), q_max=4.0, cut_width=0.05, **kwargs)
Add lines to the current axis showing the reciprocal lattice
:param axes: None for plt.gca() or axis of choice
:param x_axis: direction along x, in units of the reciprocal lattice (hkl)
:param y_axis: direction along y, in units of the reciprocal lattice (hkl)
:param centre: centre of the plot, in units of the reciprocal lattice (hkl)
:param q_max: maximum distance to plot to - in A-1
:param cut_width: width in height that will be included, in A-1
:param kwargs: keyword arguments to pass to plt.plot(..., **kwargs)
:return: None
axis_reciprocal_lattice_vectors(self, axes=None, x_axis=(1, 0, 0), y_axis=(0, 1, 0), centre=(0, 0, 0), q_max=4.0, cut_width=0.05)
Add lines to the current axis showing the reciprocal lattice
:param axes: None for plt.gca() or axis of choice
:param x_axis: direction along x, in units of the reciprocal lattice (hkl)
:param y_axis: direction along y, in units of the reciprocal lattice (hkl)
:param centre: centre of the plot, in units of the reciprocal lattice (hkl)
:param q_max: maximum distance to plot to - in A-1
:param cut_width: width in height that will be included, in A-1
:return: None
generate_intensity_cut(self, x_axis=[1, 0, 0], y_axis=[0, 1, 0], centre=[0, 0, 0], q_max=4.0, cut_width=0.05, background=0.0, peak_width=0.05)
Generate a cut through reciprocal space, returns an array with centred reflections
Inputs:
  x_axis = direction along x, in units of the reciprocal lattice (hkl)
  y_axis = direction along y, in units of the reciprocal lattice (hkl)
  centre = centre of the plot, in units of the reciprocal lattice (hkl)
  q_max = maximum distance to plot to - in A-1
  cut_width = width in height that will be included, in A-1
  background = average background value
  peak_width = reflection width in A-1
Returns:
  Qx/Qy = [1000x1000] array of coordinates
  plane = [1000x1000] array of plane in reciprocal space 
 
E.G. hk plane at L=3 for hexagonal system:
    Qx,Qy,plane = xtl.generate_intensity_cut([1,0,0],[0,1,0],[0,0,3])
    plt.figure()
    plt.pcolormesh(Qx,Qy,plane)
    plt.axis('image')
plot_3Dlattice(self, q_max=4.0, x_axis=[1, 0, 0], y_axis=[0, 1, 0], centre=[0, 0, 0], cut_width=0.05)
Plot lattice points in 3D
plot_3Dpolarisation(self, hkl, energy_kev=None, polarisation='sp', azim_zero=[1, 0, 0], psi=0)
Plots the scattering vectors for a particular azimuth
:param hkl:
:param energy_kev:
:param polarisation:
:param azim_zero:
:param psi:
:return: None
plot_crystal(self, show_labels=False)
Plot the atomic cell in 3D
    Click and drag to rotate the structure in 3D
    Atoms are coloured according to their label
    set show_labels=True to show the label of each sphere
plot_diffractometer_reciprocal_space(self, energy_kev, delta=0, gamma=0)
Plot diffractometer angles using orientation
:param energy_kev:
:param delta:
:param gamma:
:return: None
plot_exchange_paths(self, cen_idx, nearest_neighbor_distance=6.6, exchange_type='O', bond_angle=90.0, search_in_cell=True, group_neighbors=True, disp=False)
Calcualtes exchange paths and adds them to the crystal structure plot
:param cen_idx: index of central ion in xtl.Structure
:param nearest_neighbor_distance: Maximum radius to serach to
:param exchange_type: str or None. Exchange path only incoroporates these elements, or None for any
:param bond_angle: float. Search for exchange ions withing this angle to the bond
:param search_in_cell: Bool. If True, only looks for neighbors within the unit cell
:param group_neighbors: Bool. If True, only shows neighbors with the same bond distance once
:param disp: Bool. If True, prints details of the calcualtion
:return:
plot_layers(self, layers=None, layer_axis=2, layer_width=0.05, show_labels=False)
Separate the structure into layers along the chosen axis
and plot the atoms in each layer in a separate figure.
:param layers: list of layers to plot in fractional coordinates, or NOne for automatic determination
:param layer_axis: axis (0,1,2) of direction normal to layers
:param layer_width: distance from layer value to include in plot
:param show_labels: False*/True add text labels
:return:
plot_ms_azimuth(self, hkl, energy_kev, azir=[0, 0, 1], pv=[1, 0], numsteps=3, peak_width=0.1, full=False, pv1=False, pv2=False, sfonly=True, pv1xsf1=False, log=False)
Run the multiple scattering code and plot the result
See multiple_scattering.py for more details.
 
:param xtl: Crystal structure from Dans_Diffraction
:param hkl: [h,k,l] principle reflection
:param energy_kev: calculation energy
:param azir: [h,k,l] reference of azimuthal 0 angle
:param pv: [s,p] polarisation vector
:param numsteps: int: number of calculation steps from energy min to max
:param full: True/False: calculation type: full
:param pv1: True/False: calculation type: pv1
:param pv2: True/False: calculation type: pv2
:param sfonly: True/False: calculation type: sfonly *default
:param pv1xsf1: True/False: calculation type: pv1xsf1?
:param log: log y scale
:return: None
plot_multiple_scattering(self, hkl, azir=[0, 0, 1], pv=[1, 0], energy_range=[7.8, 8.2], numsteps=60, full=False, pv1=False, pv2=False, sfonly=True, pv1xsf1=False)
Run the multiple scattering code and plot the result
See multiple_scattering.py for more details.
 
:param xtl: Crystal structure from Dans_Diffraction
:param hkl: [h,k,l] principle reflection
:param azir: [h,k,l] reference of azimuthal 0 angle
:param pv: [s,p] polarisation vector
:param energy_range: [min, max] energy range in keV
:param numsteps: int: number of calculation steps from energy min to max
:param full: True/False: calculation type: full
:param pv1: True/False: calculation type: pv1
:param pv2: True/False: calculation type: pv2
:param sfonly: True/False: calculation type: sfonly *default
:param pv1xsf1: True/False: calculation type: pv1xsf1?
:return: None
plot_xray_resonance(self, hkl, energy_kev=None, width=1.0, npoints=200)
Plot energy scan using x-ray dispersion corrections
:param hkl: list of [h,k,l] reflections
:param energy_kev: float energy in keV to scan around
:param width: float in keV width of scan
:param npoints: int number of poins to calculate
:return: None
quick_intensity_cut(self, x_axis=[1, 0, 0], y_axis=[0, 1, 0], centre=[0, 0, 0], q_max=4.0, cut_width=0.05)
Plot a cut through reciprocal space, visualising the intensity as different sized markers
  x_axis = direction along x, in units of the reciprocal lattice (hkl)
  y_axis = direction along y, in units of the reciprocal lattice (hkl)
  centre = centre of the plot, in units of the reciprocal lattice (hkl)
  q_max = maximum distance to plot to - in A-1
  cut_width = width in height that will be included, in A-1
 
E.G. hk plot at L=3 for hexagonal system:
    xtl.quick_intensity_cut([1,0,0],[0,1,0],[0,0,3])
     hhl plot:
    xtl.quick_intensity_cut([1,1,0],[0,0,1],[0,0,0])
simulate_0kl(self, H=0, **kwargs)
Plots the (H)kl layer of reciprocal space
 for inputs, see help(xtl.simulate_intensity_cut)
simulate_azimuth(self, hkl, energy_kev=None, polarisation='sp', F0=1, F1=1, F2=1, azim_zero=[1, 0, 0])
Simulate azimuthal scan of resonant x-ray scattering
    energy_kev = x-ray energy in keV
    polarisation = x-ray polarisation: 'ss',{'sp'},'ps','pp'
    F0/1/2 = Resonance factor Flm
    azim_zero = [h,k,l] vector parallel to the origin of the azimuth
simulate_azimuth_nonresonant(self, hkl, energy_kev=None, polarisation='sp', azim_zero=[1, 0, 0])
Simulate azimuthal scan of resonant x-ray scattering
    energy_kev = x-ray energy in keV
    polarisation = x-ray polarisation: 'ss',{'sp'},'ps','pp'
    F0/1/2 = Resonance factor Flm
    azim_zero = [h,k,l] vector parallel to the origin of the azimuth
simulate_azimuth_resonant(self, hkl, energy_kev=None, polarisation='sp', F0=1, F1=1, F2=1, azim_zero=[1, 0, 0])
Simulate azimuthal scan of resonant x-ray scattering
    energy_kev = x-ray energy in keV
    polarisation = x-ray polarisation: 'ss',{'sp'},'ps','pp'
    F0/1/2 = Resonance factor Flm
    azim_zero = [h,k,l] vector parallel to the origin of the azimuth
simulate_ewald_coverage(self, energy_kev=8.0, sample_normal=[0, 0, 1], sample_para=[1, 0, 0], phi=0, chi=0, **kwargs)
NOT FINISHED
Plot ewald space coverage within a particular scattering plane
  energy_kev = energy of incident radiation in keV
  sample_normal = direction of scattering plane perp to beam direction
  sample_para = direction of scattering plane || to beam direction
  phi = rotation of lattice about scattering plane verticle
  chi = rotation of lattice perpendicular to scattering plane
simulate_h0l(self, K=0, **kwargs)
Plots the h(K)l layer of reciprocal space
 for inputs, see help(xtl.simulate_intensity_cut)
simulate_hhl(self, HmH=0, **kwargs)
Plots the hhl layer of reciprocal space
 for inputs, see help(xtl.simulate_intensity_cut)
simulate_hk0(self, L=0, **kwargs)
Plots the hk(L) layer of reciprocal space
 for inputs, see help(xtl.simulate_intensity_cut)
simulate_intensity_cut(self, x_axis=[1, 0, 0], y_axis=[0, 1, 0], centre=[0, 0, 0], q_max=4.0, cut_width=0.05, background=0.0, peak_width=0.05)
Plot a cut through reciprocal space, visualising the intensity
  x_axis = direction along x, in units of the reciprocal lattice (hkl)
  y_axis = direction along y, in units of the reciprocal lattice (hkl)
  centre = centre of the plot, in units of the reciprocal lattice (hkl)
  q_max = maximum distance to plot to - in A-1
  cut_width = width in height that will be included, in A-1
  background = average background value
  peak_width = reflection width in A-1
 
E.G. hk plot at L=3 for hexagonal system:
    xtl.simulate_intensity_cut([1,0,0],[0,1,0],[0,0,3])
     hhl plot:
    xtl.simulate_intensity_cut([1,1,0],[0,0,1],[0,0,0])
simulate_polarisation_nonresonant(self, hkl, energy_kev=None, azim_zero=[1, 0, 0], psi=0)
Simulate azimuthal scan of resonant x-ray scattering
    energy_kev = x-ray energy in keV
    polarisation = x-ray polarisation: 'ss',{'sp'},'ps','pp'
    F0/1/2 = Resonance factor Flm
    azim_zero = [h,k,l] vector parallel to the origin of the azimuth
simulate_polarisation_resonant(self, hkl, energy_kev=None, F0=1, F1=1, F2=1, azim_zero=[1, 0, 0], psi=0)
Simulate azimuthal scan of resonant x-ray scattering
    energy_kev = x-ray energy in keV
    polarisation = x-ray polarisation: 'ss',{'sp'},'ps','pp'
    F0/1/2 = Resonance factor Flm
    azim_zero = [h,k,l] vector parallel to the origin of the azimuth
simulate_powder(self, energy_kev=None, peak_width=0.01, background=0, powder_average=True)
Generates a powder pattern, plots in a new figure with labels
    see classes_scattering.generate_powder

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class PlottingSuperstructure(Plotting)
    PlottingSuperstructure(xtl)
 
Plotting functions for Superstructure class crystal object
Copies the functions from Plotting, but changes several functions to apply additional actions
This changes the behaviour of the xtl.Plot functions such as xtl.Plot.simulate_hk0()
 
generate_intensity_cut & simulate_intensity_cut
 - Refelctions are symmetrised by the parent symmetry, accounting for multiple superlattice domains
 - Generated plots have lines and vectors associated with parent structure
 - Effects functions such as xtl.Plot.simulate_hk0()
 
 
Method resolution order:
PlottingSuperstructure
Plotting
builtins.object

Methods defined here:
generate_intensity_cut(self, x_axis=[1, 0, 0], y_axis=[0, 1, 0], centre=[0, 0, 0], q_max=4.0, cut_width=0.05, background=0.0, peak_width=0.05)
Generate a cut through reciprocal space, returns an array with centred reflections
Inputs:
  x_axis = direction along x, in units of the parent reciprocal lattice (hkl)
  y_axis = direction along y, in units of the parent reciprocal lattice (hkl)
  centre = centre of the plot, in units of the parent reciprocal lattice (hkl)
  q_max = maximum distance to plot to - in A-1
  cut_width = width in height that will be included, in A-1
  background = average background value
  peak_width = reflection width in A-1
Returns:
  qx/qy = [1000x1000] array of coordinates
  plane = [1000x1000] array of plane in reciprocal space 
 
E.G. hk plane at L=3 for hexagonal system:
    qx,qy,plane = xtl.generate_intensity_cut([1,0,0],[0,1,0],[0,0,3])
    plt.figure()
    plt.pcolormesh(qx,qy,plane)
    plt.axis('image')
simulate_intensity_cut(self, x_axis=[1, 0, 0], y_axis=[0, 1, 0], centre=[0, 0, 0], q_max=4.0, cut_width=0.05, background=0.0, peak_width=0.05)
Plot a cut through reciprocal space, visualising the intensity
  x_axis = direction along x, in units of the parent reciprocal lattice (hkl)
  y_axis = direction along y, in units of the parent reciprocal lattice (hkl)
  centre = centre of the plot, in units of the parent reciprocal lattice (hkl)
  q_max = maximum distance to plot to - in A-1
  cut_width = width in height that will be included, in A-1
  background = average background value
  peak_width = reflection width in A-1
 
E.G. hk plot at L=3 for hexagonal system:
    xtl.simulate_intensity_cut([1,0,0],[0,1,0],[0,0,3])
     hhl plot:
    xtl.simulate_intensity_cut([1,1,0],[0,0,1],[0,0,0])

Methods inherited from Plotting:
__init__(self, xtl)
initialise
axis_reciprocal_lattice_lines(self, x_axis=(1, 0, 0), y_axis=(0, 1, 0), centre=(0, 0, 0), q_max=4.0, cut_width=0.05, axes=None, *args, **kwargs)
Add lines to the current axis showing the reciprocal lattice
:param x_axis: direction along x, in units of the reciprocal lattice (hkl)
:param y_axis: direction along y, in units of the reciprocal lattice (hkl)
:param centre: centre of the plot, in units of the reciprocal lattice (hkl)
:param q_max: maximum distance to plot to - in A-1
:param cut_width: width in height that will be included, in A-1
:param axes: None for plt.gca() or axis of choice
:param args: argments to pass to plot function, e.g. linewidth, alpha, color
:return: None
axis_reciprocal_lattice_points(self, axes=None, x_axis=(1, 0, 0), y_axis=(0, 1, 0), centre=(0, 0, 0), q_max=4.0, cut_width=0.05, **kwargs)
Add lines to the current axis showing the reciprocal lattice
:param axes: None for plt.gca() or axis of choice
:param x_axis: direction along x, in units of the reciprocal lattice (hkl)
:param y_axis: direction along y, in units of the reciprocal lattice (hkl)
:param centre: centre of the plot, in units of the reciprocal lattice (hkl)
:param q_max: maximum distance to plot to - in A-1
:param cut_width: width in height that will be included, in A-1
:param kwargs: keyword arguments to pass to plt.plot(..., **kwargs)
:return: None
axis_reciprocal_lattice_vectors(self, axes=None, x_axis=(1, 0, 0), y_axis=(0, 1, 0), centre=(0, 0, 0), q_max=4.0, cut_width=0.05)
Add lines to the current axis showing the reciprocal lattice
:param axes: None for plt.gca() or axis of choice
:param x_axis: direction along x, in units of the reciprocal lattice (hkl)
:param y_axis: direction along y, in units of the reciprocal lattice (hkl)
:param centre: centre of the plot, in units of the reciprocal lattice (hkl)
:param q_max: maximum distance to plot to - in A-1
:param cut_width: width in height that will be included, in A-1
:return: None
plot_3Dlattice(self, q_max=4.0, x_axis=[1, 0, 0], y_axis=[0, 1, 0], centre=[0, 0, 0], cut_width=0.05)
Plot lattice points in 3D
plot_3Dpolarisation(self, hkl, energy_kev=None, polarisation='sp', azim_zero=[1, 0, 0], psi=0)
Plots the scattering vectors for a particular azimuth
:param hkl:
:param energy_kev:
:param polarisation:
:param azim_zero:
:param psi:
:return: None
plot_crystal(self, show_labels=False)
Plot the atomic cell in 3D
    Click and drag to rotate the structure in 3D
    Atoms are coloured according to their label
    set show_labels=True to show the label of each sphere
plot_diffractometer_reciprocal_space(self, energy_kev, delta=0, gamma=0)
Plot diffractometer angles using orientation
:param energy_kev:
:param delta:
:param gamma:
:return: None
plot_exchange_paths(self, cen_idx, nearest_neighbor_distance=6.6, exchange_type='O', bond_angle=90.0, search_in_cell=True, group_neighbors=True, disp=False)
Calcualtes exchange paths and adds them to the crystal structure plot
:param cen_idx: index of central ion in xtl.Structure
:param nearest_neighbor_distance: Maximum radius to serach to
:param exchange_type: str or None. Exchange path only incoroporates these elements, or None for any
:param bond_angle: float. Search for exchange ions withing this angle to the bond
:param search_in_cell: Bool. If True, only looks for neighbors within the unit cell
:param group_neighbors: Bool. If True, only shows neighbors with the same bond distance once
:param disp: Bool. If True, prints details of the calcualtion
:return:
plot_layers(self, layers=None, layer_axis=2, layer_width=0.05, show_labels=False)
Separate the structure into layers along the chosen axis
and plot the atoms in each layer in a separate figure.
:param layers: list of layers to plot in fractional coordinates, or NOne for automatic determination
:param layer_axis: axis (0,1,2) of direction normal to layers
:param layer_width: distance from layer value to include in plot
:param show_labels: False*/True add text labels
:return:
plot_ms_azimuth(self, hkl, energy_kev, azir=[0, 0, 1], pv=[1, 0], numsteps=3, peak_width=0.1, full=False, pv1=False, pv2=False, sfonly=True, pv1xsf1=False, log=False)
Run the multiple scattering code and plot the result
See multiple_scattering.py for more details.
 
:param xtl: Crystal structure from Dans_Diffraction
:param hkl: [h,k,l] principle reflection
:param energy_kev: calculation energy
:param azir: [h,k,l] reference of azimuthal 0 angle
:param pv: [s,p] polarisation vector
:param numsteps: int: number of calculation steps from energy min to max
:param full: True/False: calculation type: full
:param pv1: True/False: calculation type: pv1
:param pv2: True/False: calculation type: pv2
:param sfonly: True/False: calculation type: sfonly *default
:param pv1xsf1: True/False: calculation type: pv1xsf1?
:param log: log y scale
:return: None
plot_multiple_scattering(self, hkl, azir=[0, 0, 1], pv=[1, 0], energy_range=[7.8, 8.2], numsteps=60, full=False, pv1=False, pv2=False, sfonly=True, pv1xsf1=False)
Run the multiple scattering code and plot the result
See multiple_scattering.py for more details.
 
:param xtl: Crystal structure from Dans_Diffraction
:param hkl: [h,k,l] principle reflection
:param azir: [h,k,l] reference of azimuthal 0 angle
:param pv: [s,p] polarisation vector
:param energy_range: [min, max] energy range in keV
:param numsteps: int: number of calculation steps from energy min to max
:param full: True/False: calculation type: full
:param pv1: True/False: calculation type: pv1
:param pv2: True/False: calculation type: pv2
:param sfonly: True/False: calculation type: sfonly *default
:param pv1xsf1: True/False: calculation type: pv1xsf1?
:return: None
plot_xray_resonance(self, hkl, energy_kev=None, width=1.0, npoints=200)
Plot energy scan using x-ray dispersion corrections
:param hkl: list of [h,k,l] reflections
:param energy_kev: float energy in keV to scan around
:param width: float in keV width of scan
:param npoints: int number of poins to calculate
:return: None
quick_intensity_cut(self, x_axis=[1, 0, 0], y_axis=[0, 1, 0], centre=[0, 0, 0], q_max=4.0, cut_width=0.05)
Plot a cut through reciprocal space, visualising the intensity as different sized markers
  x_axis = direction along x, in units of the reciprocal lattice (hkl)
  y_axis = direction along y, in units of the reciprocal lattice (hkl)
  centre = centre of the plot, in units of the reciprocal lattice (hkl)
  q_max = maximum distance to plot to - in A-1
  cut_width = width in height that will be included, in A-1
 
E.G. hk plot at L=3 for hexagonal system:
    xtl.quick_intensity_cut([1,0,0],[0,1,0],[0,0,3])
     hhl plot:
    xtl.quick_intensity_cut([1,1,0],[0,0,1],[0,0,0])
simulate_0kl(self, H=0, **kwargs)
Plots the (H)kl layer of reciprocal space
 for inputs, see help(xtl.simulate_intensity_cut)
simulate_azimuth(self, hkl, energy_kev=None, polarisation='sp', F0=1, F1=1, F2=1, azim_zero=[1, 0, 0])
Simulate azimuthal scan of resonant x-ray scattering
    energy_kev = x-ray energy in keV
    polarisation = x-ray polarisation: 'ss',{'sp'},'ps','pp'
    F0/1/2 = Resonance factor Flm
    azim_zero = [h,k,l] vector parallel to the origin of the azimuth
simulate_azimuth_nonresonant(self, hkl, energy_kev=None, polarisation='sp', azim_zero=[1, 0, 0])
Simulate azimuthal scan of resonant x-ray scattering
    energy_kev = x-ray energy in keV
    polarisation = x-ray polarisation: 'ss',{'sp'},'ps','pp'
    F0/1/2 = Resonance factor Flm
    azim_zero = [h,k,l] vector parallel to the origin of the azimuth
simulate_azimuth_resonant(self, hkl, energy_kev=None, polarisation='sp', F0=1, F1=1, F2=1, azim_zero=[1, 0, 0])
Simulate azimuthal scan of resonant x-ray scattering
    energy_kev = x-ray energy in keV
    polarisation = x-ray polarisation: 'ss',{'sp'},'ps','pp'
    F0/1/2 = Resonance factor Flm
    azim_zero = [h,k,l] vector parallel to the origin of the azimuth
simulate_ewald_coverage(self, energy_kev=8.0, sample_normal=[0, 0, 1], sample_para=[1, 0, 0], phi=0, chi=0, **kwargs)
NOT FINISHED
Plot ewald space coverage within a particular scattering plane
  energy_kev = energy of incident radiation in keV
  sample_normal = direction of scattering plane perp to beam direction
  sample_para = direction of scattering plane || to beam direction
  phi = rotation of lattice about scattering plane verticle
  chi = rotation of lattice perpendicular to scattering plane
simulate_h0l(self, K=0, **kwargs)
Plots the h(K)l layer of reciprocal space
 for inputs, see help(xtl.simulate_intensity_cut)
simulate_hhl(self, HmH=0, **kwargs)
Plots the hhl layer of reciprocal space
 for inputs, see help(xtl.simulate_intensity_cut)
simulate_hk0(self, L=0, **kwargs)
Plots the hk(L) layer of reciprocal space
 for inputs, see help(xtl.simulate_intensity_cut)
simulate_polarisation_nonresonant(self, hkl, energy_kev=None, azim_zero=[1, 0, 0], psi=0)
Simulate azimuthal scan of resonant x-ray scattering
    energy_kev = x-ray energy in keV
    polarisation = x-ray polarisation: 'ss',{'sp'},'ps','pp'
    F0/1/2 = Resonance factor Flm
    azim_zero = [h,k,l] vector parallel to the origin of the azimuth
simulate_polarisation_resonant(self, hkl, energy_kev=None, F0=1, F1=1, F2=1, azim_zero=[1, 0, 0], psi=0)
Simulate azimuthal scan of resonant x-ray scattering
    energy_kev = x-ray energy in keV
    polarisation = x-ray polarisation: 'ss',{'sp'},'ps','pp'
    F0/1/2 = Resonance factor Flm
    azim_zero = [h,k,l] vector parallel to the origin of the azimuth
simulate_powder(self, energy_kev=None, peak_width=0.01, background=0, powder_average=True)
Generates a powder pattern, plots in a new figure with labels
    see classes_scattering.generate_powder

Data descriptors inherited from Plotting:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)