Electron density calculator for 2D-hexagonal or 2D-square lattices

This Javascript calculates the 2D electron density distribution rho(r) of a 2D hexagonal or square lattice from diffraction data. Enter the number of peaks and the value of the 2D-lattice spacing (d). Enter the peak intensities I(q) or peak amplitudes F(q) and their signs of the scattering amplitudes (+ or -). Select the type of the 2D-lattice (hexagonal/square) and the corrections already applied to the input data: 'none' means no corrections, LC means Lorentz correction (multiplied by q*q) and MC means multiplicity correction (divided by the multiplicities) have already been applied. F(q) have to be entered both LC and MC corrected. For 2*Nr points rho(r) from -rmax = -rx = -ry to rmax = rx = ry will be calculated. If the calculation takes too long (on a slow computer) decrease Nr. The values are listed/plotted in rho(r) vs rx, ry in arbitrary units and can be copied and pasted from the window into any text-file for further processing and graphical displaying. A version which calculates the electron densities for all sign combinations of the amplitudes of the first three diffraction peaks can be found here.

Input rho (rx, ry)
 peaks 10 9 8 7 6 5 4 3 2 1 d Nr rmax I(10/10) + - I(11/11) + - I(20/20) + - I(21/21) + - I(30/22) + - I(22/30) + - I(31/31) + - I(40/32) + - I(32/40) + - I(41/41) + -

 2D-lattice: hexagonal square data / correction: I(q) / none I(q) / LC I(q) / LC+MC F(q) / LC+MC colorscale: Jet Hot Rainbow Earth Electric Viridis Cividis Portland Blackbody Picnic RdBu YlGnBu YlOrRd Bluered Greys Blues Reds Greens colorscale/background: normal/white reverse/white normal/black reverse/black 2D-plot: heatmap heatmap-smooth contour contour+heatmap contourlines 3D-plot: surface surface+contour

Author: M.Kriechbaum, TU-Graz (2018), e-mail: manfred.kriechbaum@tugraz.at