<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://gisaxs.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=JulienLhermitte</id>
	<title>GISAXS - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://gisaxs.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=JulienLhermitte"/>
	<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php/Special:Contributions/JulienLhermitte"/>
	<updated>2026-04-08T16:10:05Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.7</generator>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim&amp;diff=5791</id>
		<title>ScatterSim</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim&amp;diff=5791"/>
		<updated>2017-07-28T17:55:43Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;[[ScatterSim]]&amp;#039;&amp;#039;&amp;#039; is a set of [[Python]] code for simulating the one-dimensional curve (circular average) for [[Lattices of nano-objects|nanoparticle superlattices]].&lt;br /&gt;
* Citation: [[Yager, K.G.]]; Zhang, Y.; Lu, F.; Gang, O. &amp;quot;[http://scripts.iucr.org/cgi-bin/paper?S160057671302832X Periodic lattices of arbitrary nano-objects: modeling and applications for self-assembled systems]&amp;quot; &amp;#039;&amp;#039;Journal of Applied Crystallography&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;2014&amp;#039;&amp;#039;&amp;#039;, 47, 118–129. [http://dx.doi.org/10.1107/S160057671302832X doi: 10.1107/S160057671302832X]&lt;br /&gt;
** See also [[Paper:Periodic lattices of arbitrary nano-objects: modeling and applications for self-assembled systems|summary of paper]].&lt;br /&gt;
* [http://github.com/CFN-softbio/ScatterSim Code available on github.]&lt;br /&gt;
[[Image:NanoLattice cartoon.jpg|center|500px]]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[ScatterSim:Installing| Installing ScatterSim]]&lt;br /&gt;
* [[ScatterSim:API |  API]]&lt;br /&gt;
* [[ScatterSim:Examples |  ScatterSim Examples]]&lt;br /&gt;
* [http://scattersim.readthedocs.io/en/latest/ ScatterSim Documentation]&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:API&amp;diff=5789</id>
		<title>ScatterSim:API</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:API&amp;diff=5789"/>
		<updated>2017-07-20T13:49:20Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ScatterSim API ==&lt;br /&gt;
(Work in progress)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page documents the general API for the ScatterSim code.&lt;br /&gt;
&lt;br /&gt;
=== Structure ===&lt;br /&gt;
In general, the objects in the ScatterSim code used to generate simulations are either:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;b&amp;gt;NanoObject&amp;lt;/b&amp;gt; : the base object&lt;br /&gt;
# &amp;lt;b&amp;gt;CompositeNanoObject&amp;lt;/b&amp;gt; : an arrangement of &amp;lt;b&amp;gt;NanoObject&amp;lt;/b&amp;gt; objects&lt;br /&gt;
# &amp;lt;b&amp;gt;Lattice&amp;lt;/b&amp;gt; objects : NanoObjects that are assembled into a lattice.&lt;br /&gt;
&lt;br /&gt;
==== NanoObjects or Composite NanoObjects ====&lt;br /&gt;
Each of these elements is initialized by calling their initialization class.&lt;br /&gt;
To initialize a &amp;lt;b&amp;gt;NanoObject&amp;lt;/b&amp;gt; or &amp;lt;b&amp;gt;CompositeNanoObject&amp;lt;/b&amp;gt;, potential arguments must be supplied:&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
from ScatterSim.NanoObjects import SphereNanoObject&lt;br /&gt;
pargs = {&amp;quot;radius&amp;quot; : 10}&lt;br /&gt;
sphere = SphereNanoObject(pargs=pargs)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;b&amp;gt;pargs&amp;lt;/b&amp;gt; is a dictionary containing the parameters that describe the system. Here, a &amp;lt;b&amp;gt;SphereNanoObject&amp;lt;/b&amp;gt; only requires a &amp;lt;b&amp;gt;radius&amp;lt;/b&amp;gt; as a parameter. Other more complex objects, like &amp;lt;b&amp;gt;CylinderNanoObject&amp;lt;/b&amp;gt; may require more parameters (such as &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; in this case).&lt;br /&gt;
&lt;br /&gt;
==== Creating a new CompositeNanoObject ====&lt;br /&gt;
Sometimes the objects available are not enough and a more complex objects is needed.&lt;br /&gt;
Objects may be compounded into more complex &amp;lt;b&amp;gt;NanoObject&amp;lt;/b&amp;gt; objects by creating a new &amp;lt;b&amp;gt;CompositeNanoObject&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Vectors ===&lt;br /&gt;
Rotations&lt;br /&gt;
&lt;br /&gt;
Any object&amp;#039;s canonical rotation is described in its docstring. From there, it is possible to re-orient it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orientation is defined with the following parameters&lt;br /&gt;
* x0, y0, z0 : the z y and z position with respect to the object&amp;#039;s internal reference frame&lt;br /&gt;
* eta, theta, phi : the Euler angles. THe rotations are defined as follows:&lt;br /&gt;
&lt;br /&gt;
        Three-axis rotation:&lt;br /&gt;
            1. Rotate about +z by eta (counter-clockwise in x-y plane)&lt;br /&gt;
            2. Tilt by phi with respect to +z (rotation about y-axis,&lt;br /&gt;
            clockwise in x-z plane) then&lt;br /&gt;
            3. rotate by theta in-place (rotation about z-axis,&lt;br /&gt;
            counter-clockwise in x-y plane)&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:Installing&amp;diff=5784</id>
		<title>ScatterSim:Installing</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:Installing&amp;diff=5784"/>
		<updated>2017-07-18T22:33:05Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: /* Installing ScatterSim */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installing ScatterSim ==&lt;br /&gt;
Here are some rough guidelines into installing ScatterSim.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&lt;br /&gt;
Download and install Anaconda &amp;lt;br /&amp;gt;&lt;br /&gt;
https://www.continuum.io/downloads&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;li&amp;gt; Download the ScatterSim Library, either:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ol&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt; Direct download&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;Download from https://github.com/CFN-softbio/SciAnalysis/archive/master.zip &amp;lt;br /&amp;gt;&lt;br /&gt;
and install to the directory of your choice.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/li&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/ol&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;li&amp;gt;&lt;br /&gt;
    Using git&lt;br /&gt;
    &amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
Download and install git: &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://git-scm.com/downloads&lt;br /&gt;
    &amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;&lt;br /&gt;
  Download the ScatterSim library using git&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt; Open a terminal and choose a directory where you want to install ScatterSim, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/&lt;br /&gt;
mkdir -p software&lt;br /&gt;
cd software&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
      &amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;li&amp;gt;clone:&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://github.com/CFN-softbio/ScatterSim.git&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(For more information, you may also visit the [http://github.com/CFN-softbio/ScatterSim github page]) &lt;br /&gt;
      &amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;&lt;br /&gt;
Now install ScatterSim   &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ScatterSim&lt;br /&gt;
python setup.py develop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It should now be installed.&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You should be able to now run ScatterSim in a python environment.&lt;br /&gt;
&lt;br /&gt;
== Testing ScatterSim ==&lt;br /&gt;
To test that ScatterSim was properly installed, let&amp;#039;s make a folder where we can add code and test.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Create a folder where you&amp;#039;ll want to store your notebooks, for example, in a terminal, type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/software&lt;br /&gt;
mkdir -p ScatterSim-examples&lt;br /&gt;
cd ScatterSim-examples&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
In this folder, in the terminal, type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
jupyter notebook&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will open your web browser to run jupyter notebooks.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Click &amp;quot;New&amp;quot; and select one of the entries under &amp;quot;Notebook&amp;quot;. Likely it will say something like &amp;quot;Python 3&amp;quot; or something similar. You should only have one entry (unless you&amp;#039;ve manually created extra notebook kernels, or installed jupyter on its own).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
To test that ScatterSim is installed, type in a cell:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from ScatterSim.NanoObjects import SphereNanoObject&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and hit SHIFT + ENTER. If you do not receive an error, then it is installed. If you do receive an error, then try to use another kernel (the entries under notebook mentioned in the previous step).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Troubleshooting If this was not successful, then here are some things you may try:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; you have two instances of jupyter installed and you are not running the correct one. Try to find them and uninstall everything. The command (linux/mac) &amp;lt;pre&amp;gt;which jupyter&amp;lt;/pre&amp;gt; can help hint where the jupyter version you&amp;#039;re using is installed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Another possibilty is that you are not in the right conda environment. Simply closing your terminal and opening it again could help. Else, you may need to find out the name of your conda environments by typing in a terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
conda env list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and finally selecting the correct environment by typing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
source activate ENV&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where ENV is one of the names in the list you saw. (it should be one entry unless you&amp;#039;ve purposely added more environments)&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Updating ScatterSim ==&lt;br /&gt;
If you installed using git, you can also update ScatterSim using git. When an update is pushed to the server, it may be retrieved as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Go into ScatterSim directory. Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/software/ScatterSim&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Then run the following two commands:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git checkout master&lt;br /&gt;
git pull origin master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE : If you made any changes to ScatterSim, git will complain (this could happen by accidentally opening a file and adding in a whitespace for example). To resolve this, you delete all changes you may have made by typing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git reset --hard&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you wanted to keep your changes, then one option is to create a new branch for them, such as:&lt;br /&gt;
may either need to add the changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git checkout -b development-branch-name&lt;br /&gt;
git add &amp;lt;files...&amp;gt;&lt;br /&gt;
git commit -m &amp;quot;MY Commit message for these edits&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now your changes are saved and may always be accessed by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git checkout development-branch-name&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is likely unnecessary, unless you are digging into the code.&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=XAmp&amp;diff=5783</id>
		<title>XAmp</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=XAmp&amp;diff=5783"/>
		<updated>2017-07-13T14:25:48Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Coherent X-ray Amplification&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;XAmp&amp;#039;&amp;#039;&amp;#039;) is a method that can be used to boost the [[scattering]] signal of a weakly-scattering entity above some noisy contaminating [[background]]. The technique consists of bringing a specially-designed &amp;#039;amplifier&amp;#039; nano-structure close to the sample of interest (within one coherence volume). The coherent interference between the sample of interest and the amplifier gives rise to an interference term in the scattering pattern seen on the detector. Even if the sample itself is too weak to be measured on its own (due to the background dominating), the interference term can be extremely strong (if the amplifier itself scatters strongly). As a result, the sample&amp;#039;s scattering can be inferred from the measurable interference term.&lt;br /&gt;
&lt;br /&gt;
The scattering from coherent interference involves three scattering terms :&lt;br /&gt;
# The scattering of the amplifier&lt;br /&gt;
# The scattering of the sample &lt;br /&gt;
# An interference term&lt;br /&gt;
This interference term encodes information about the sample, and may be amplified by increasing the amplifier signal strength (i.e. fabricating a more strongly scattering amplifier object). If a strong noisy background is present, then a sufficiently strong amplifier can actually increase the [[signal-to-noise]] of the measurement of the sample. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*  Julien R. Lhermitte, Cheng Tian, Aaron Stein, Atikur Rahman, Yugang Zhang, Lutz Wiegart, Andrei Fluerasu, Oleg Gang, and [[Kevin G. Yager]] [http://journals.iucr.org/j/issues/2017/03/00/aj5285/index.html Robust X-ray angular correlations for the study of meso-structures] &amp;#039;&amp;#039;J. Appl. Cryst.&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;2017&amp;#039;&amp;#039;&amp;#039;, 50(3). [https://doi.org/10.1107/S1600576717003946 doi: 10.1107/S1600576717003946]&lt;br /&gt;
&lt;br /&gt;
*  Julien R. Lhermitte, Aaron Stein, Cheng Tian,  Yugang Zhang, Lutz Wiegart, Andrei Fluerasu, Oleg Gang, and [[Kevin G. Yager]] [http://journals.iucr.org/m/issues/2017/05/00/it5012/index.html Coherent Amplification of X-ray Scattering from Meso-structures] &amp;#039;&amp;#039;IUCrJ&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;2017&amp;#039;&amp;#039;&amp;#039; 4(5) [https://doi.org/10.1107/S2052252517008107 doi: 10.1107/S2052252517008107]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[Correlation methods]]&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=XAmp&amp;diff=5782</id>
		<title>XAmp</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=XAmp&amp;diff=5782"/>
		<updated>2017-07-13T14:24:44Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Coherent X-ray Amplification&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;XAmp&amp;#039;&amp;#039;&amp;#039;) is a method that can be used to boost the [[scattering]] signal of a weakly-scattering entity above some noisy contaminating [[background]]. The technique consists of bringing a specially-designed &amp;#039;amplifier&amp;#039; nano-structure close to the sample of interest (within one coherence volume). The coherent interference between the sample of interest and the amplifier gives rise to an interference term in the scattering pattern seen on the detector. Even if the sample itself is too weak to be measured on its own (due to the background dominating), the interference term can be extremely strong (if the amplifier itself scatters strongly). As a result, the sample&amp;#039;s scattering can be inferred from the measurable interference term.&lt;br /&gt;
&lt;br /&gt;
The scattering from coherent interference involves three scattering terms :&lt;br /&gt;
# The scattering of the amplifier&lt;br /&gt;
# The scattering of the sample &lt;br /&gt;
# An interference term&lt;br /&gt;
This interference term encodes information about the sample, and may be amplified by increasing the amplifier signal strength (i.e. fabricating a more strongly scattering amplifier object). If a strong noisy background is present, then a sufficiently strong amplifier can actually increase the [[signal-to-noise]] of the measurement of the sample. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*  Julien R. Lhermitte, Cheng Tian, Aaron Stein, Atikur Rahman, Yugang Zhang, Lutz Wiegart, Andrei Fluerasu, Oleg Gang, and [[Kevin G. Yager]] [http://journals.iucr.org/j/issues/2017/03/00/aj5285/index.html Robust X-ray angular correlations for the study of meso-structures] &amp;#039;&amp;#039;J. Appl. Cryst.&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;2017&amp;#039;&amp;#039;&amp;#039;, 50(3). [https://doi.org/10.1107/S1600576717003946 doi: 10.1107/S1600576717003946]&lt;br /&gt;
&lt;br /&gt;
*  Julien R. Lhermitte, Aaron Stein, Cheng Tian,  Yugang Zhang, Lutz Wiegart, Andrei Fluerasu, Oleg Gang, and [[Kevin G. Yager]] Coherent Amplification of X-ray Scattering from Meso-structures &amp;#039;&amp;#039;IUCrJ&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;2017&amp;#039;&amp;#039;&amp;#039; 4(5) [https://doi.org/10.1107/S2052252517008107]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[Correlation methods]]&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:API&amp;diff=5781</id>
		<title>ScatterSim:API</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:API&amp;diff=5781"/>
		<updated>2017-07-10T20:29:20Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ScatterSim API ==&lt;br /&gt;
(Work in progress)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page documents the general API for the ScatterSim code.&lt;br /&gt;
&lt;br /&gt;
=== Structure ===&lt;br /&gt;
In general, the objects in the ScatterSim code used to generate simulations are either:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;b&amp;gt;NanoObject&amp;lt;/b&amp;gt; : the base object&lt;br /&gt;
# &amp;lt;b&amp;gt;CompositeNanoObject&amp;lt;/b&amp;gt; : an arrangement of &amp;lt;b&amp;gt;NanoObject&amp;lt;/b&amp;gt; objects&lt;br /&gt;
# &amp;lt;b&amp;gt;Lattice&amp;lt;/b&amp;gt; objects : NanoObjects that are assembled into a lattice.&lt;br /&gt;
&lt;br /&gt;
==== NanoObjects or Composite NanoObjects ====&lt;br /&gt;
Each of these elements is initialized by calling their initialization class.&lt;br /&gt;
To initialize a &amp;lt;b&amp;gt;NanoObject&amp;lt;/b&amp;gt; or &amp;lt;b&amp;gt;CompositeNanoObject&amp;lt;/b&amp;gt;, potential arguments must be supplied:&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
from ScatterSim.NanoObjects import SphereNanoObject&lt;br /&gt;
pargs = {&amp;quot;radius&amp;quot; : 10}&lt;br /&gt;
sphere = SphereNanoObject(pargs=pargs)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;b&amp;gt;pargs&amp;lt;/b&amp;gt; is a dictionary containing the parameters that describe the system. Here, a &amp;lt;b&amp;gt;SphereNanoObject&amp;lt;/b&amp;gt; only requires a &amp;lt;b&amp;gt;radius&amp;lt;/b&amp;gt; as a parameter. Other more complex objects, like &amp;lt;b&amp;gt;CylinderNanoObject&amp;lt;/b&amp;gt; may require more parameters (such as &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; in this case).&lt;br /&gt;
&lt;br /&gt;
==== Creating a new CompositeNanoObject ====&lt;br /&gt;
Sometimes the objects available are not enough and a more complex objects is needed.&lt;br /&gt;
Objects may be compounded into more complex &amp;lt;b&amp;gt;NanoObject&amp;lt;/b&amp;gt; objects by creating a new &amp;lt;b&amp;gt;CompositeNanoObject&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Vectors ===&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:API&amp;diff=5780</id>
		<title>ScatterSim:API</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:API&amp;diff=5780"/>
		<updated>2017-07-10T20:29:09Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: Created page with &amp;quot;== ScatterSim API == This page documents the general API for the ScatterSim code.  === Structure === In general, the objects in the ScatterSim code used to generate simulation...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ScatterSim API ==&lt;br /&gt;
This page documents the general API for the ScatterSim code.&lt;br /&gt;
&lt;br /&gt;
=== Structure ===&lt;br /&gt;
In general, the objects in the ScatterSim code used to generate simulations are either:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;b&amp;gt;NanoObject&amp;lt;/b&amp;gt; : the base object&lt;br /&gt;
# &amp;lt;b&amp;gt;CompositeNanoObject&amp;lt;/b&amp;gt; : an arrangement of &amp;lt;b&amp;gt;NanoObject&amp;lt;/b&amp;gt; objects&lt;br /&gt;
# &amp;lt;b&amp;gt;Lattice&amp;lt;/b&amp;gt; objects : NanoObjects that are assembled into a lattice.&lt;br /&gt;
&lt;br /&gt;
==== NanoObjects or Composite NanoObjects ====&lt;br /&gt;
Each of these elements is initialized by calling their initialization class.&lt;br /&gt;
To initialize a &amp;lt;b&amp;gt;NanoObject&amp;lt;/b&amp;gt; or &amp;lt;b&amp;gt;CompositeNanoObject&amp;lt;/b&amp;gt;, potential arguments must be supplied:&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
from ScatterSim.NanoObjects import SphereNanoObject&lt;br /&gt;
pargs = {&amp;quot;radius&amp;quot; : 10}&lt;br /&gt;
sphere = SphereNanoObject(pargs=pargs)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;b&amp;gt;pargs&amp;lt;/b&amp;gt; is a dictionary containing the parameters that describe the system. Here, a &amp;lt;b&amp;gt;SphereNanoObject&amp;lt;/b&amp;gt; only requires a &amp;lt;b&amp;gt;radius&amp;lt;/b&amp;gt; as a parameter. Other more complex objects, like &amp;lt;b&amp;gt;CylinderNanoObject&amp;lt;/b&amp;gt; may require more parameters (such as &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; in this case).&lt;br /&gt;
&lt;br /&gt;
==== Creating a new CompositeNanoObject ====&lt;br /&gt;
Sometimes the objects available are not enough and a more complex objects is needed.&lt;br /&gt;
Objects may be compounded into more complex &amp;lt;b&amp;gt;NanoObject&amp;lt;/b&amp;gt; objects by creating a new &amp;lt;b&amp;gt;CompositeNanoObject&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Vectors ===&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim&amp;diff=5779</id>
		<title>ScatterSim</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim&amp;diff=5779"/>
		<updated>2017-07-10T18:35:36Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;[[ScatterSim]]&amp;#039;&amp;#039;&amp;#039; is a set of [[Python]] code for simulating the one-dimensional curve (circular average) for [[Lattices of nano-objects|nanoparticle superlattices]].&lt;br /&gt;
* Citation: [[Yager, K.G.]]; Zhang, Y.; Lu, F.; Gang, O. &amp;quot;[http://scripts.iucr.org/cgi-bin/paper?S160057671302832X Periodic lattices of arbitrary nano-objects: modeling and applications for self-assembled systems]&amp;quot; &amp;#039;&amp;#039;Journal of Applied Crystallography&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;2014&amp;#039;&amp;#039;&amp;#039;, 47, 118–129. [http://dx.doi.org/10.1107/S160057671302832X doi: 10.1107/S160057671302832X]&lt;br /&gt;
** See also [[Paper:Periodic lattices of arbitrary nano-objects: modeling and applications for self-assembled systems|summary of paper]].&lt;br /&gt;
* [http://github.com/CFN-softbio/ScatterSim Code available on github.]&lt;br /&gt;
[[Image:NanoLattice cartoon.jpg|center|500px]]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[ScatterSim:Installing| Installing ScatterSim]]&lt;br /&gt;
* [[ScatterSim:API |  API]]&lt;br /&gt;
* [[ScatterSim:Examples |  ScatterSim Examples]]&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:Installing&amp;diff=5756</id>
		<title>ScatterSim:Installing</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:Installing&amp;diff=5756"/>
		<updated>2017-06-14T14:34:28Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: /* Installing ScatterSim */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installing ScatterSim ==&lt;br /&gt;
Here are some rough guidelines into installing ScatterSim. There are a few ways to do it, but this is a recommended method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Download and install Anaconda &amp;lt;br /&amp;gt;&lt;br /&gt;
https://www.continuum.io/downloads&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Download and install git: &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://git-scm.com/downloads&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Download the ScatterSim library using git&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal and choose a directory where you want to install ScatterSim, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/&lt;br /&gt;
mkdir -p software&lt;br /&gt;
cd software&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Download and install ScatterSim using git:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Download using git:&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://github.com/CFN-softbio/ScatterSim.git&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(For more information, you may also visit the [http://github.com/CFN-softbio/ScatterSim github page]) &lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Now install ScatterSim   &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ScatterSim&lt;br /&gt;
python setup.py develop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It should now be installed.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
You should be able to now run ScatterSim in a python environment.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ScatterSim ==&lt;br /&gt;
To test that ScatterSim was properly installed, let&amp;#039;s make a folder where we can add code and test.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Create a folder where you&amp;#039;ll want to store your notebooks, for example, in a terminal, type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/software&lt;br /&gt;
mkdir -p ScatterSim-examples&lt;br /&gt;
cd ScatterSim-examples&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
In this folder, in the terminal, type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
jupyter notebook&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will open your web browser to run jupyter notebooks.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Click &amp;quot;New&amp;quot; and select one of the entries under &amp;quot;Notebook&amp;quot;. Likely it will say something like &amp;quot;Python 3&amp;quot; or something similar. You should only have one entry (unless you&amp;#039;ve manually created extra notebook kernels, or installed jupyter on its own).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
To test that ScatterSim is installed, type in a cell:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from ScatterSim.NanoObjects import SphereNanoObject&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and hit SHIFT + ENTER. If you do not receive an error, then it is installed. If you do receive an error, then try to use another kernel (the entries under notebook mentioned in the previous step).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Troubleshooting If this was not successful, then here are some things you may try:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; you have two instances of jupyter installed and you are not running the correct one. Try to find them and uninstall everything. The command (linux/mac) &amp;lt;pre&amp;gt;which jupyter&amp;lt;/pre&amp;gt; can help hint where the jupyter version you&amp;#039;re using is installed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Another possibilty is that you are not in the right conda environment. Simply closing your terminal and opening it again could help. Else, you may need to find out the name of your conda environments by typing in a terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
conda env list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and finally selecting the correct environment by typing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
source activate ENV&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where ENV is one of the names in the list you saw. (it should be one entry unless you&amp;#039;ve purposely added more environments)&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Updating ScatterSim ==&lt;br /&gt;
If you installed using git, you can also update ScatterSim using git. When an update is pushed to the server, it may be retrieved as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Go into ScatterSim directory. Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/software/ScatterSim&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Then run the following two commands:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git checkout master&lt;br /&gt;
git pull origin master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE : If you made any changes to ScatterSim, git will complain (this could happen by accidentally opening a file and adding in a whitespace for example). To resolve this, you delete all changes you may have made by typing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git reset --hard&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you wanted to keep your changes, then one option is to create a new branch for them, such as:&lt;br /&gt;
may either need to add the changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git checkout -b development-branch-name&lt;br /&gt;
git add &amp;lt;files...&amp;gt;&lt;br /&gt;
git commit -m &amp;quot;MY Commit message for these edits&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now your changes are saved and may always be accessed by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git checkout development-branch-name&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is likely unnecessary, unless you are digging into the code.&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:Installing&amp;diff=5755</id>
		<title>ScatterSim:Installing</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:Installing&amp;diff=5755"/>
		<updated>2017-06-14T14:34:05Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: /* Installing ScatterSim */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installing ScatterSim ==&lt;br /&gt;
Here are some rough guidelines into installing ScatterSim. There are a few ways to do it, but this is a recommended method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Download and install Anaconda &amp;lt;br /&amp;gt;&lt;br /&gt;
https://www.continuum.io/downloads&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Download and install git: &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://git-scm.com/downloads&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Download the ScatterSim library using git&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal and choose a directory where you want to install ScatterSim, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/&lt;br /&gt;
mkdir -p software&lt;br /&gt;
cd software&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Download and install ScatterSim using git:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Download using git:&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://github.com/CFN-softbio/ScatterSim.git&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(For more information, you may also visit the [http://github.com/CFN-softbio/ScatterSim| github page]) &lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Now install ScatterSim   &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ScatterSim&lt;br /&gt;
python setup.py develop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It should now be installed.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
You should be able to now run ScatterSim in a python environment.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ScatterSim ==&lt;br /&gt;
To test that ScatterSim was properly installed, let&amp;#039;s make a folder where we can add code and test.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Create a folder where you&amp;#039;ll want to store your notebooks, for example, in a terminal, type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/software&lt;br /&gt;
mkdir -p ScatterSim-examples&lt;br /&gt;
cd ScatterSim-examples&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
In this folder, in the terminal, type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
jupyter notebook&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will open your web browser to run jupyter notebooks.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Click &amp;quot;New&amp;quot; and select one of the entries under &amp;quot;Notebook&amp;quot;. Likely it will say something like &amp;quot;Python 3&amp;quot; or something similar. You should only have one entry (unless you&amp;#039;ve manually created extra notebook kernels, or installed jupyter on its own).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
To test that ScatterSim is installed, type in a cell:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from ScatterSim.NanoObjects import SphereNanoObject&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and hit SHIFT + ENTER. If you do not receive an error, then it is installed. If you do receive an error, then try to use another kernel (the entries under notebook mentioned in the previous step).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Troubleshooting If this was not successful, then here are some things you may try:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; you have two instances of jupyter installed and you are not running the correct one. Try to find them and uninstall everything. The command (linux/mac) &amp;lt;pre&amp;gt;which jupyter&amp;lt;/pre&amp;gt; can help hint where the jupyter version you&amp;#039;re using is installed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Another possibilty is that you are not in the right conda environment. Simply closing your terminal and opening it again could help. Else, you may need to find out the name of your conda environments by typing in a terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
conda env list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and finally selecting the correct environment by typing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
source activate ENV&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where ENV is one of the names in the list you saw. (it should be one entry unless you&amp;#039;ve purposely added more environments)&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Updating ScatterSim ==&lt;br /&gt;
If you installed using git, you can also update ScatterSim using git. When an update is pushed to the server, it may be retrieved as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Go into ScatterSim directory. Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/software/ScatterSim&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Then run the following two commands:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git checkout master&lt;br /&gt;
git pull origin master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE : If you made any changes to ScatterSim, git will complain (this could happen by accidentally opening a file and adding in a whitespace for example). To resolve this, you delete all changes you may have made by typing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git reset --hard&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you wanted to keep your changes, then one option is to create a new branch for them, such as:&lt;br /&gt;
may either need to add the changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git checkout -b development-branch-name&lt;br /&gt;
git add &amp;lt;files...&amp;gt;&lt;br /&gt;
git commit -m &amp;quot;MY Commit message for these edits&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now your changes are saved and may always be accessed by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git checkout development-branch-name&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is likely unnecessary, unless you are digging into the code.&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim&amp;diff=5754</id>
		<title>ScatterSim</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim&amp;diff=5754"/>
		<updated>2017-06-14T14:16:09Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;[[ScatterSim]]&amp;#039;&amp;#039;&amp;#039; is a set of [[Python]] code for simulating the one-dimensional curve (circular average) for [[Lattices of nano-objects|nanoparticle superlattices]].&lt;br /&gt;
* Citation: [[Yager, K.G.]]; Zhang, Y.; Lu, F.; Gang, O. &amp;quot;[http://scripts.iucr.org/cgi-bin/paper?S160057671302832X Periodic lattices of arbitrary nano-objects: modeling and applications for self-assembled systems]&amp;quot; &amp;#039;&amp;#039;Journal of Applied Crystallography&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;2014&amp;#039;&amp;#039;&amp;#039;, 47, 118–129. [http://dx.doi.org/10.1107/S160057671302832X doi: 10.1107/S160057671302832X]&lt;br /&gt;
** See also [[Paper:Periodic lattices of arbitrary nano-objects: modeling and applications for self-assembled systems|summary of paper]].&lt;br /&gt;
* [http://github.com/CFN-softbio/ScatterSim Code available on github.]&lt;br /&gt;
[[Image:NanoLattice cartoon.jpg|center|500px]]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[ScatterSim:Installing| Installing ScatterSim]]&lt;br /&gt;
* [[ScatterSim:Examples |  ScatterSim Examples]]&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:Installing&amp;diff=5753</id>
		<title>ScatterSim:Installing</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:Installing&amp;diff=5753"/>
		<updated>2017-06-14T14:15:19Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: Created page with &amp;quot;== Installing ScatterSim == Here are some rough guidelines into installing ScatterSim. There are a few ways to do it, but this is a recommended method.  &amp;lt;ol&amp;gt; &amp;lt;li&amp;gt; Download and...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installing ScatterSim ==&lt;br /&gt;
Here are some rough guidelines into installing ScatterSim. There are a few ways to do it, but this is a recommended method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Download and install Anaconda &amp;lt;br /&amp;gt;&lt;br /&gt;
https://www.continuum.io/downloads&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Download and install git: &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://git-scm.com/downloads&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Download the ScatterSim library using git&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal and choose a directory where you want to install ScatterSim, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/&lt;br /&gt;
mkdir -p software&lt;br /&gt;
cd software&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Download and install ScatterSim using git:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Download using git:&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://github.com/CFN-softbio/ScatterSim.git&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Now install ScatterSim   &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ScatterSim&lt;br /&gt;
python setup.py develop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It should now be installed.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
You should be able to now run ScatterSim in a python environment.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ScatterSim ==&lt;br /&gt;
To test that ScatterSim was properly installed, let&amp;#039;s make a folder where we can add code and test.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Create a folder where you&amp;#039;ll want to store your notebooks, for example, in a terminal, type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/software&lt;br /&gt;
mkdir -p ScatterSim-examples&lt;br /&gt;
cd ScatterSim-examples&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
In this folder, in the terminal, type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
jupyter notebook&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will open your web browser to run jupyter notebooks.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Click &amp;quot;New&amp;quot; and select one of the entries under &amp;quot;Notebook&amp;quot;. Likely it will say something like &amp;quot;Python 3&amp;quot; or something similar. You should only have one entry (unless you&amp;#039;ve manually created extra notebook kernels, or installed jupyter on its own).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
To test that ScatterSim is installed, type in a cell:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from ScatterSim.NanoObjects import SphereNanoObject&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and hit SHIFT + ENTER. If you do not receive an error, then it is installed. If you do receive an error, then try to use another kernel (the entries under notebook mentioned in the previous step).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Troubleshooting If this was not successful, then here are some things you may try:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; you have two instances of jupyter installed and you are not running the correct one. Try to find them and uninstall everything. The command (linux/mac) &amp;lt;pre&amp;gt;which jupyter&amp;lt;/pre&amp;gt; can help hint where the jupyter version you&amp;#039;re using is installed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Another possibilty is that you are not in the right conda environment. Simply closing your terminal and opening it again could help. Else, you may need to find out the name of your conda environments by typing in a terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
conda env list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and finally selecting the correct environment by typing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
source activate ENV&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where ENV is one of the names in the list you saw. (it should be one entry unless you&amp;#039;ve purposely added more environments)&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Updating ScatterSim ==&lt;br /&gt;
If you installed using git, you can also update ScatterSim using git. When an update is pushed to the server, it may be retrieved as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Go into ScatterSim directory. Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/software/ScatterSim&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Then run the following two commands:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git checkout master&lt;br /&gt;
git pull origin master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE : If you made any changes to ScatterSim, git will complain (this could happen by accidentally opening a file and adding in a whitespace for example). To resolve this, you delete all changes you may have made by typing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git reset --hard&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you wanted to keep your changes, then one option is to create a new branch for them, such as:&lt;br /&gt;
may either need to add the changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git checkout -b development-branch-name&lt;br /&gt;
git add &amp;lt;files...&amp;gt;&lt;br /&gt;
git commit -m &amp;quot;MY Commit message for these edits&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now your changes are saved and may always be accessed by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git checkout development-branch-name&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is likely unnecessary, unless you are digging into the code.&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:Examples:002Lattice&amp;diff=5724</id>
		<title>ScatterSim:Examples:002Lattice</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:Examples:002Lattice&amp;diff=5724"/>
		<updated>2017-03-30T16:01:48Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The next step is creating a lattice&lt;br /&gt;
&lt;br /&gt;
from ScatterSim.NanoObjects import SphereNanoObject, PolydisperseNanoObject&lt;br /&gt;
# We&amp;#039;ll import a few lattices, cubic, FCC, BCC and Diamond&lt;br /&gt;
from ScatterSim.LatticeObjects import SimpleCubic, FCCLattice, BCCLattice, DiamondTwoParticleLattice&lt;br /&gt;
# import the peak shape for the peaks, tunable&lt;br /&gt;
from ScatterSim.PeakShape import PeakShape&lt;br /&gt;
&lt;br /&gt;
import numpy as np&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
&lt;br /&gt;
# Let&amp;#039;s use our polydisperse sphere nanoobject since it&amp;#039;s more realistic&lt;br /&gt;
# In general though, you&amp;#039;ll want to start with simpler objects to reduce computation time&lt;br /&gt;
# but this one should be okay...&lt;br /&gt;
pargs_polysphere = dict(radius= 1, sigma_R=.04)&lt;br /&gt;
&lt;br /&gt;
polysphere = PolydisperseNanoObject(SphereNanoObject, pargs_polysphere, argname=&amp;#039;radius&amp;#039;, argstdname=&amp;#039;sigma_R&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
# The peak shape&lt;br /&gt;
# delta is sigma of a Gaussian, and nu is FWHM of a Lorentzian&lt;br /&gt;
# Generally, you&amp;#039;ll want to keep one zero and vary the other (to get a Gaussian or Lorentzian)&lt;br /&gt;
# but when finalizing a fit, you may want to play with intermediate values&lt;br /&gt;
peak = PeakShape(delta=0.03, nu=0.01) &lt;br /&gt;
&lt;br /&gt;
# now define your lattices&lt;br /&gt;
# lattices, to first order are just defined by 6 parameters:&lt;br /&gt;
# lattice_spacing_a, lattice_spacing_b and lattice_spacing_c (the unit vector spacings)&lt;br /&gt;
# alpha, beta, gamma (the angles the unit vectors make with the axes)&lt;br /&gt;
# We&amp;#039;ll deal with simple lattices, so all unit vectors are aligned with x, y and z axes, and same length&lt;br /&gt;
lattice_spacing = 10. # 10 times radius (1 nm)&lt;br /&gt;
sigma_D = .06 # add a Debye-Waller factor&lt;br /&gt;
lat_sc = SimpleCubic([polysphere], lattice_spacing_a=lattice_spacing, sigma_D=sigma_D)&lt;br /&gt;
lat_fcc = FCCLattice([polysphere], lattice_spacing_a=lattice_spacing, sigma_D=sigma_D)&lt;br /&gt;
lat_bcc = BCCLattice([polysphere], lattice_spacing_a=lattice_spacing, sigma_D=sigma_D)&lt;br /&gt;
lat_diamond = DiamondTwoParticleLattice([polysphere], lattice_spacing_a=lattice_spacing, sigma_D=sigma_D)&lt;br /&gt;
&lt;br /&gt;
q = np.linspace(.4, 4, 1000)&lt;br /&gt;
# Now compute the intensity, it will take some time...&lt;br /&gt;
Z0_sc = lat_sc.intensity(q, peak)&lt;br /&gt;
Pq_sc = lat_sc.form_factor_squared_isotropic(q)&lt;br /&gt;
&lt;br /&gt;
c_sc = .1&lt;br /&gt;
&lt;br /&gt;
# note Gq is same for all three here (just depends on sigma_D, it&amp;#039;s an exponential decay...)&lt;br /&gt;
Gq_sc = lat_sc.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_sc = c_sc*Z0_sc/Pq_sc*Gq_sc + (1-Gq_sc)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Simple Cubic&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Z0_fcc = lat_fcc.intensity(q, peak)&lt;br /&gt;
Pq_fcc = lat_fcc.form_factor_squared_isotropic(q)&lt;br /&gt;
Gq_fcc = lat_fcc.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_fcc = c_sc*Z0_fcc/Pq_fcc*Gq_fcc + (1-Gq_fcc)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Face Centered Cubic&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Z0_bcc = lat_bcc.intensity(q, peak)&lt;br /&gt;
Pq_bcc = lat_bcc.form_factor_squared_isotropic(q)&lt;br /&gt;
Gq_bcc = lat_bcc.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_bcc = c_sc*Z0_bcc/Pq_bcc*Gq_bcc + (1-Gq_bcc)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Body Centered Cubic&amp;quot;)&lt;br /&gt;
Z0_diamond = lat_diamond.intensity(q, peak)&lt;br /&gt;
Pq_diamond = lat_diamond.form_factor_squared_isotropic(q)&lt;br /&gt;
Gq_diamond = lat_diamond.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_diamond = c_sc*Z0_diamond/Pq_diamond*Gq_diamond + (1-Gq_diamond)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Diamond&amp;quot;)&lt;br /&gt;
plt.figure(0, figsize=(10,8));plt.clf()&lt;br /&gt;
plt.subplot(2,2,1)&lt;br /&gt;
plt.title(&amp;quot;Simple Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_sc)&lt;br /&gt;
plt.subplot(2,2,2)&lt;br /&gt;
plt.title(&amp;quot;Face Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_fcc)&lt;br /&gt;
plt.subplot(2,2,3)&lt;br /&gt;
plt.title(&amp;quot;Body Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_bcc)&lt;br /&gt;
plt.subplot(2,2,4)&lt;br /&gt;
plt.title(&amp;quot;Diamond Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_diamond)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-002-fig1.png]]&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
# Same, but loglog plot (sometimes easier to see)&lt;br /&gt;
&lt;br /&gt;
plt.figure(1, figsize=(10,8));plt.clf()&lt;br /&gt;
plt.subplot(2,2,1)&lt;br /&gt;
plt.title(&amp;quot;Simple Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_sc)&lt;br /&gt;
plt.subplot(2,2,2)&lt;br /&gt;
plt.title(&amp;quot;Face Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_fcc)&lt;br /&gt;
plt.subplot(2,2,3)&lt;br /&gt;
plt.title(&amp;quot;Body Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_bcc)&lt;br /&gt;
plt.subplot(2,2,4)&lt;br /&gt;
plt.title(&amp;quot;Diamond Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_diamond)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-002-fig2.png]]&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:Examples&amp;diff=5723</id>
		<title>ScatterSim:Examples</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:Examples&amp;diff=5723"/>
		<updated>2017-03-30T15:56:13Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These examples are typical use cases of the ScatterSim library to help get started using the library.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--- These examples may also be found on the [http://github.com/CFN-softbio/ScatterSim-examples| github page]. ---&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[ScatterSim:Examples:001Sphere|Example 1]] : Creating a sphere and computing the form factor or viewing a projection.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[ScatterSim:Examples:002Lattice|Example 2]] : Creating a lattice and computing the powder diffraction.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;!---&lt;br /&gt;
[[ScatterSim:Examples:003Poly|Example 3]] : Creating a polydisperse object (cylinder in this case)&amp;lt;br /&amp;gt;&lt;br /&gt;
[[ScatterSim:Examples:004Composite|Example 4]] : Creating a composite nano object comprised of two cylinders.&amp;lt;br /&amp;gt;&lt;br /&gt;
---&amp;gt;&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:Examples&amp;diff=5722</id>
		<title>ScatterSim:Examples</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:Examples&amp;diff=5722"/>
		<updated>2017-03-30T15:55:55Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These examples are typical use cases of the ScatterSim library to help get started using the library.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--- These examples may also be found on the [http://github.com/CFN-softbio/ScatterSim-examples| github page]. ---&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[ScatterSim:Examples:001Sphere|Example 1]] : Creating a sphere and computing the form factor or viewing a projection.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[ScatterSim:Examples:002Lattice|Example 2]] : Creating a lattice and computing the powder diffraction.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[ScatterSim:Examples:003Poly|Example 3]] : Creating a polydisperse object (cylinder in this case)&amp;lt;br /&amp;gt;&lt;br /&gt;
[[ScatterSim:Examples:004Composite|Example 4]] : Creating a composite nano object comprised of two cylinders.&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:Examples:002Lattice&amp;diff=5721</id>
		<title>ScatterSim:Examples:002Lattice</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:Examples:002Lattice&amp;diff=5721"/>
		<updated>2017-03-29T16:06:10Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The next step is creating a lattice&lt;br /&gt;
&lt;br /&gt;
from ScatterSim.NanoObjects import SphereNanoObject, PolydisperseNanoObject&lt;br /&gt;
# We&amp;#039;ll import a few lattices, cubic, FCC, BCC and Diamond&lt;br /&gt;
from ScatterSim.LatticeObjects import SimpleCubic, FCCLattice, BCCLattice, DiamondTwoParticleLattice&lt;br /&gt;
# import the peak shape for the peaks, tunable&lt;br /&gt;
from ScatterSim.PeakShape import PeakShape&lt;br /&gt;
&lt;br /&gt;
import numpy as np&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TBA&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Let&amp;#039;s use our polydisperse sphere nanoobject since it&amp;#039;s more realistic&lt;br /&gt;
# In general though, you&amp;#039;ll want to start with simpler objects to reduce computation time&lt;br /&gt;
# but this one should be okay...&lt;br /&gt;
pargs_polysphere = dict(radius= 1, sigma_R=.04)&lt;br /&gt;
&lt;br /&gt;
polysphere = PolydisperseNanoObject(SphereNanoObject, pargs_polysphere, argname=&amp;#039;radius&amp;#039;, argstdname=&amp;#039;sigma_R&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
# The peak shape&lt;br /&gt;
# delta is sigma of a Gaussian, and nu is FWHM of a Lorentzian&lt;br /&gt;
# Generally, you&amp;#039;ll want to keep one zero and vary the other (to get a Gaussian or Lorentzian)&lt;br /&gt;
# but when finalizing a fit, you may want to play with intermediate values&lt;br /&gt;
peak = PeakShape(delta=0.03, nu=0.01) &lt;br /&gt;
&lt;br /&gt;
# now define your lattices&lt;br /&gt;
# lattices, to first order are just defined by 6 parameters:&lt;br /&gt;
# lattice_spacing_a, lattice_spacing_b and lattice_spacing_c (the unit vector spacings)&lt;br /&gt;
# alpha, beta, gamma (the angles the unit vectors make with the axes)&lt;br /&gt;
# We&amp;#039;ll deal with simple lattices, so all unit vectors are aligned with x, y and z axes, and same length&lt;br /&gt;
lattice_spacing = 10. # 10 times radius (1 nm)&lt;br /&gt;
sigma_D = .06 # add a Debye-Waller factor&lt;br /&gt;
lat_sc = SimpleCubic([polysphere], lattice_spacing_a=lattice_spacing, sigma_D=sigma_D)&lt;br /&gt;
lat_fcc = FCCLattice([polysphere], lattice_spacing_a=lattice_spacing, sigma_D=sigma_D)&lt;br /&gt;
lat_bcc = BCCLattice([polysphere], lattice_spacing_a=lattice_spacing, sigma_D=sigma_D)&lt;br /&gt;
lat_diamond = DiamondTwoParticleLattice([polysphere], lattice_spacing_a=lattice_spacing, sigma_D=sigma_D)&lt;br /&gt;
&lt;br /&gt;
q = np.linspace(.4, 4, 1000)&lt;br /&gt;
# Now compute the intensity, it will take some time...&lt;br /&gt;
Z0_sc = lat_sc.intensity(q, peak)&lt;br /&gt;
Pq_sc = lat_sc.form_factor_squared_isotropic(q)&lt;br /&gt;
&lt;br /&gt;
c_sc = .1&lt;br /&gt;
&lt;br /&gt;
# note Gq is same for all three here (just depends on sigma_D, it&amp;#039;s an exponential decay...)&lt;br /&gt;
Gq_sc = lat_sc.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_sc = c_sc*Z0_sc/Pq_sc*Gq_sc + (1-Gq_sc)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Simple Cubic&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Z0_fcc = lat_fcc.intensity(q, peak)&lt;br /&gt;
Pq_fcc = lat_fcc.form_factor_squared_isotropic(q)&lt;br /&gt;
Gq_fcc = lat_fcc.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_fcc = c_sc*Z0_fcc/Pq_fcc*Gq_fcc + (1-Gq_fcc)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Face Centered Cubic&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Z0_bcc = lat_bcc.intensity(q, peak)&lt;br /&gt;
Pq_bcc = lat_bcc.form_factor_squared_isotropic(q)&lt;br /&gt;
Gq_bcc = lat_bcc.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_bcc = c_sc*Z0_bcc/Pq_bcc*Gq_bcc + (1-Gq_bcc)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Body Centered Cubic&amp;quot;)&lt;br /&gt;
Z0_diamond = lat_diamond.intensity(q, peak)&lt;br /&gt;
Pq_diamond = lat_diamond.form_factor_squared_isotropic(q)&lt;br /&gt;
Gq_diamond = lat_diamond.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_diamond = c_sc*Z0_diamond/Pq_diamond*Gq_diamond + (1-Gq_diamond)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Diamond&amp;quot;)&lt;br /&gt;
plt.figure(0, figsize=(10,8));plt.clf()&lt;br /&gt;
plt.subplot(2,2,1)&lt;br /&gt;
plt.title(&amp;quot;Simple Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_sc)&lt;br /&gt;
plt.subplot(2,2,2)&lt;br /&gt;
plt.title(&amp;quot;Face Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_fcc)&lt;br /&gt;
plt.subplot(2,2,3)&lt;br /&gt;
plt.title(&amp;quot;Body Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_bcc)&lt;br /&gt;
plt.subplot(2,2,4)&lt;br /&gt;
plt.title(&amp;quot;Diamond Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_diamond)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-002-fig1.png]]&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
# Same, but loglog plot (sometimes easier to see)&lt;br /&gt;
&lt;br /&gt;
plt.figure(1, figsize=(10,8));plt.clf()&lt;br /&gt;
plt.subplot(2,2,1)&lt;br /&gt;
plt.title(&amp;quot;Simple Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_sc)&lt;br /&gt;
plt.subplot(2,2,2)&lt;br /&gt;
plt.title(&amp;quot;Face Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_fcc)&lt;br /&gt;
plt.subplot(2,2,3)&lt;br /&gt;
plt.title(&amp;quot;Body Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_bcc)&lt;br /&gt;
plt.subplot(2,2,4)&lt;br /&gt;
plt.title(&amp;quot;Diamond Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_diamond)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-002-fig2.png]]&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:Examples:002Lattice&amp;diff=5720</id>
		<title>ScatterSim:Examples:002Lattice</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:Examples:002Lattice&amp;diff=5720"/>
		<updated>2017-03-29T16:05:15Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The next step is creating a lattice&lt;br /&gt;
&lt;br /&gt;
from ScatterSim.NanoObjects import SphereNanoObject, PolydisperseNanoObject&lt;br /&gt;
# We&amp;#039;ll import a few lattices, cubic, FCC, BCC and Diamond&lt;br /&gt;
from ScatterSim.LatticeObjects import SimpleCubic, FCCLattice, BCCLattice, DiamondTwoParticleLattice&lt;br /&gt;
# import the peak shape for the peaks, tunable&lt;br /&gt;
from ScatterSim.PeakShape import PeakShape&lt;br /&gt;
&lt;br /&gt;
import numpy as np&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TBA&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Let&amp;#039;s use our polydisperse sphere nanoobject since it&amp;#039;s more realistic&lt;br /&gt;
# In general though, you&amp;#039;ll want to start with simpler objects to reduce computation time&lt;br /&gt;
# but this one should be okay...&lt;br /&gt;
pargs_polysphere = dict(radius= 1, sigma_R=.04)&lt;br /&gt;
&lt;br /&gt;
polysphere = PolydisperseNanoObject(SphereNanoObject, pargs_polysphere, argname=&amp;#039;radius&amp;#039;, argstdname=&amp;#039;sigma_R&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
# The peak shape&lt;br /&gt;
# delta is sigma of a Gaussian, and nu is FWHM of a Lorentzian&lt;br /&gt;
# Generally, you&amp;#039;ll want to keep one zero and vary the other (to get a Gaussian or Lorentzian)&lt;br /&gt;
# but when finalizing a fit, you may want to play with intermediate values&lt;br /&gt;
peak = PeakShape(delta=0.03, nu=0.01) &lt;br /&gt;
&lt;br /&gt;
# now define your lattices&lt;br /&gt;
# lattices, to first order are just defined by 6 parameters:&lt;br /&gt;
# lattice_spacing_a, lattice_spacing_b and lattice_spacing_c (the unit vector spacings)&lt;br /&gt;
# alpha, beta, gamma (the angles the unit vectors make with the axes)&lt;br /&gt;
# We&amp;#039;ll deal with simple lattices, so all unit vectors are aligned with x, y and z axes, and same length&lt;br /&gt;
lattice_spacing = 10. # 10 times radius (1 nm)&lt;br /&gt;
lat_sc = SimpleCubic([polysphere], lattice_spacing_a=lattice_spacing)&lt;br /&gt;
lat_fcc = FCCLattice([polysphere], lattice_spacing_a=lattice_spacing)&lt;br /&gt;
lat_bcc = BCCLattice([polysphere], lattice_spacing_a=lattice_spacing)&lt;br /&gt;
lat_diamond = DiamondTwoParticleLattice([polysphere], lattice_spacing_a=lattice_spacing)&lt;br /&gt;
&lt;br /&gt;
q = np.linspace(.4, 4, 1000)&lt;br /&gt;
# Now compute the intensity, it will take some time...&lt;br /&gt;
Z0_sc = lat_sc.intensity(q, peak)&lt;br /&gt;
Pq_sc = lat_sc.form_factor_squared_isotropic(q)&lt;br /&gt;
&lt;br /&gt;
c_sc = .1&lt;br /&gt;
&lt;br /&gt;
# note Gq is same for all three here (just depends on sigma_D, it&amp;#039;s an exponential decay...)&lt;br /&gt;
Gq_sc = lat_sc.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_sc = c_sc*Z0_sc/Pq_sc*Gq_sc + (1-Gq_sc)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Simple Cubic&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Z0_fcc = lat_fcc.intensity(q, peak)&lt;br /&gt;
Pq_fcc = lat_fcc.form_factor_squared_isotropic(q)&lt;br /&gt;
Gq_fcc = lat_fcc.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_fcc = c_sc*Z0_fcc/Pq_fcc*Gq_fcc + (1-Gq_fcc)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Face Centered Cubic&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Z0_bcc = lat_bcc.intensity(q, peak)&lt;br /&gt;
Pq_bcc = lat_bcc.form_factor_squared_isotropic(q)&lt;br /&gt;
Gq_bcc = lat_bcc.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_bcc = c_sc*Z0_bcc/Pq_bcc*Gq_bcc + (1-Gq_bcc)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Body Centered Cubic&amp;quot;)&lt;br /&gt;
Z0_diamond = lat_diamond.intensity(q, peak)&lt;br /&gt;
Pq_diamond = lat_diamond.form_factor_squared_isotropic(q)&lt;br /&gt;
Gq_diamond = lat_diamond.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_diamond = c_sc*Z0_diamond/Pq_diamond*Gq_diamond + (1-Gq_diamond)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Diamond&amp;quot;)&lt;br /&gt;
plt.figure(0, figsize=(10,8));plt.clf()&lt;br /&gt;
plt.subplot(2,2,1)&lt;br /&gt;
plt.title(&amp;quot;Simple Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_sc)&lt;br /&gt;
plt.subplot(2,2,2)&lt;br /&gt;
plt.title(&amp;quot;Face Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_fcc)&lt;br /&gt;
plt.subplot(2,2,3)&lt;br /&gt;
plt.title(&amp;quot;Body Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_bcc)&lt;br /&gt;
plt.subplot(2,2,4)&lt;br /&gt;
plt.title(&amp;quot;Diamond Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_diamond)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-002-fig1.png]]&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
# Same, but loglog plot (sometimes easier to see)&lt;br /&gt;
&lt;br /&gt;
plt.figure(1, figsize=(10,8));plt.clf()&lt;br /&gt;
plt.subplot(2,2,1)&lt;br /&gt;
plt.title(&amp;quot;Simple Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_sc)&lt;br /&gt;
plt.subplot(2,2,2)&lt;br /&gt;
plt.title(&amp;quot;Face Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_fcc)&lt;br /&gt;
plt.subplot(2,2,3)&lt;br /&gt;
plt.title(&amp;quot;Body Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_bcc)&lt;br /&gt;
plt.subplot(2,2,4)&lt;br /&gt;
plt.title(&amp;quot;Diamond Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_diamond)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-002-fig2.png]]&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:Examples:002Lattice&amp;diff=5719</id>
		<title>ScatterSim:Examples:002Lattice</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:Examples:002Lattice&amp;diff=5719"/>
		<updated>2017-03-29T16:04:55Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The next step is creating a lattice&lt;br /&gt;
&lt;br /&gt;
from ScatterSim.NanoObjects import SphereNanoObject, PolydisperseNanoObject&lt;br /&gt;
# We&amp;#039;ll import a few lattices, cubic, FCC, BCC and Diamond&lt;br /&gt;
from ScatterSim.LatticeObjects import SimpleCubic, FCCLattice, BCCLattice, DiamondTwoParticleLattice&lt;br /&gt;
# import the peak shape for the peaks, tunable&lt;br /&gt;
from ScatterSim.PeakShape import PeakShape&lt;br /&gt;
&lt;br /&gt;
import numpy as np&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TBA&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Let&amp;#039;s use our polydisperse sphere nanoobject since it&amp;#039;s more realistic&lt;br /&gt;
# In general though, you&amp;#039;ll want to start with simpler objects to reduce computation time&lt;br /&gt;
# but this one should be okay...&lt;br /&gt;
pargs_polysphere = dict(radius= 1, sigma_R=.04)&lt;br /&gt;
&lt;br /&gt;
polysphere = PolydisperseNanoObject(SphereNanoObject, pargs_polysphere, argname=&amp;#039;radius&amp;#039;, argstdname=&amp;#039;sigma_R&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
# The peak shape&lt;br /&gt;
# delta is sigma of a Gaussian, and nu is FWHM of a Lorentzian&lt;br /&gt;
# Generally, you&amp;#039;ll want to keep one zero and vary the other (to get a Gaussian or Lorentzian)&lt;br /&gt;
# but when finalizing a fit, you may want to play with intermediate values&lt;br /&gt;
peak = PeakShape(delta=0.03, nu=0.01) &lt;br /&gt;
&lt;br /&gt;
# now define your lattices&lt;br /&gt;
# lattices, to first order are just defined by 6 parameters:&lt;br /&gt;
# lattice_spacing_a, lattice_spacing_b and lattice_spacing_c (the unit vector spacings)&lt;br /&gt;
# alpha, beta, gamma (the angles the unit vectors make with the axes)&lt;br /&gt;
# We&amp;#039;ll deal with simple lattices, so all unit vectors are aligned with x, y and z axes, and same length&lt;br /&gt;
lattice_spacing = 10. # 10 times radius (1 nm)&lt;br /&gt;
lat_sc = SimpleCubic([polysphere], lattice_spacing_a=lattice_spacing)&lt;br /&gt;
lat_fcc = FCCLattice([polysphere], lattice_spacing_a=lattice_spacing)&lt;br /&gt;
lat_bcc = BCCLattice([polysphere], lattice_spacing_a=lattice_spacing)&lt;br /&gt;
lat_diamond = DiamondTwoParticleLattice([polysphere], lattice_spacing_a=lattice_spacing)&lt;br /&gt;
&lt;br /&gt;
q = np.linspace(.4, 4, 1000)&lt;br /&gt;
# Now compute the intensity, it will take some time...&lt;br /&gt;
Z0_sc = lat_sc.intensity(q, peak)&lt;br /&gt;
Pq_sc = lat_sc.form_factor_squared_isotropic(q)&lt;br /&gt;
&lt;br /&gt;
c_sc = .1&lt;br /&gt;
&lt;br /&gt;
# note Gq is same for all three here (just depends on sigma_D, it&amp;#039;s an exponential decay...)&lt;br /&gt;
Gq_sc = lat_sc.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_sc = c_sc*Z0_sc/Pq_sc*Gq_sc + (1-Gq_sc)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Simple Cubic&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Z0_fcc = lat_fcc.intensity(q, peak)&lt;br /&gt;
Pq_fcc = lat_fcc.form_factor_squared_isotropic(q)&lt;br /&gt;
Gq_fcc = lat_fcc.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_fcc = c_sc*Z0_fcc/Pq_fcc*Gq_fcc + (1-Gq_fcc)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Face Centered Cubic&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Z0_bcc = lat_bcc.intensity(q, peak)&lt;br /&gt;
Pq_bcc = lat_bcc.form_factor_squared_isotropic(q)&lt;br /&gt;
Gq_bcc = lat_bcc.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_bcc = c_sc*Z0_bcc/Pq_bcc*Gq_bcc + (1-Gq_bcc)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Body Centered Cubic&amp;quot;)&lt;br /&gt;
Z0_diamond = lat_diamond.intensity(q, peak)&lt;br /&gt;
Pq_diamond = lat_diamond.form_factor_squared_isotropic(q)&lt;br /&gt;
Gq_diamond = lat_diamond.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_diamond = c_sc*Z0_diamond/Pq_diamond*Gq_diamond + (1-Gq_diamond)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Diamond&amp;quot;)&lt;br /&gt;
plt.figure(0, figsize=(10,8));plt.clf()&lt;br /&gt;
plt.subplot(2,2,1)&lt;br /&gt;
plt.title(&amp;quot;Simple Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_sc)&lt;br /&gt;
plt.subplot(2,2,2)&lt;br /&gt;
plt.title(&amp;quot;Face Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_fcc)&lt;br /&gt;
plt.subplot(2,2,3)&lt;br /&gt;
plt.title(&amp;quot;Body Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_bcc)&lt;br /&gt;
plt.subplot(2,2,4)&lt;br /&gt;
plt.title(&amp;quot;Diamond Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_diamond)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-001-fig2.png]]&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
# Same, but loglog plot (sometimes easier to see)&lt;br /&gt;
&lt;br /&gt;
plt.figure(1, figsize=(10,8));plt.clf()&lt;br /&gt;
plt.subplot(2,2,1)&lt;br /&gt;
plt.title(&amp;quot;Simple Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_sc)&lt;br /&gt;
plt.subplot(2,2,2)&lt;br /&gt;
plt.title(&amp;quot;Face Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_fcc)&lt;br /&gt;
plt.subplot(2,2,3)&lt;br /&gt;
plt.title(&amp;quot;Body Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_bcc)&lt;br /&gt;
plt.subplot(2,2,4)&lt;br /&gt;
plt.title(&amp;quot;Diamond Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_diamond)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-001-fig2.png]]&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=File:ScatterSimExamples-002-fig2.png&amp;diff=5718</id>
		<title>File:ScatterSimExamples-002-fig2.png</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=File:ScatterSimExamples-002-fig2.png&amp;diff=5718"/>
		<updated>2017-03-29T16:04:16Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: ScatterSim example # 2 figure 2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ScatterSim example # 2 figure 2&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=File:ScatterSimExamples-002-fig1.png&amp;diff=5717</id>
		<title>File:ScatterSimExamples-002-fig1.png</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=File:ScatterSimExamples-002-fig1.png&amp;diff=5717"/>
		<updated>2017-03-29T16:04:00Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: ScatterSim example # 2 figure 1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ScatterSim example # 2 figure 1&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:Examples:002Lattice&amp;diff=5716</id>
		<title>ScatterSim:Examples:002Lattice</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:Examples:002Lattice&amp;diff=5716"/>
		<updated>2017-03-29T16:03:09Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The next step is creating a lattice&lt;br /&gt;
&lt;br /&gt;
from ScatterSim.NanoObjects import SphereNanoObject, PolydisperseNanoObject&lt;br /&gt;
# We&amp;#039;ll import a few lattices, cubic, FCC, BCC and Diamond&lt;br /&gt;
from ScatterSim.LatticeObjects import SimpleCubic, FCCLattice, BCCLattice, DiamondTwoParticleLattice&lt;br /&gt;
# import the peak shape for the peaks, tunable&lt;br /&gt;
from ScatterSim.PeakShape import PeakShape&lt;br /&gt;
&lt;br /&gt;
import numpy as np&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TBA&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Let&amp;#039;s use our polydisperse sphere nanoobject since it&amp;#039;s more realistic&lt;br /&gt;
# In general though, you&amp;#039;ll want to start with simpler objects to reduce computation time&lt;br /&gt;
# but this one should be okay...&lt;br /&gt;
pargs_polysphere = dict(radius= 1, sigma_R=.04)&lt;br /&gt;
&lt;br /&gt;
polysphere = PolydisperseNanoObject(SphereNanoObject, pargs_polysphere, argname=&amp;#039;radius&amp;#039;, argstdname=&amp;#039;sigma_R&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
# The peak shape&lt;br /&gt;
# delta is sigma of a Gaussian, and nu is FWHM of a Lorentzian&lt;br /&gt;
# Generally, you&amp;#039;ll want to keep one zero and vary the other (to get a Gaussian or Lorentzian)&lt;br /&gt;
# but when finalizing a fit, you may want to play with intermediate values&lt;br /&gt;
peak = PeakShape(delta=0.03, nu=0.01) &lt;br /&gt;
&lt;br /&gt;
# now define your lattices&lt;br /&gt;
# lattices, to first order are just defined by 6 parameters:&lt;br /&gt;
# lattice_spacing_a, lattice_spacing_b and lattice_spacing_c (the unit vector spacings)&lt;br /&gt;
# alpha, beta, gamma (the angles the unit vectors make with the axes)&lt;br /&gt;
# We&amp;#039;ll deal with simple lattices, so all unit vectors are aligned with x, y and z axes, and same length&lt;br /&gt;
lattice_spacing = 10. # 10 times radius (1 nm)&lt;br /&gt;
lat_sc = SimpleCubic([polysphere], lattice_spacing_a=lattice_spacing)&lt;br /&gt;
lat_fcc = FCCLattice([polysphere], lattice_spacing_a=lattice_spacing)&lt;br /&gt;
lat_bcc = BCCLattice([polysphere], lattice_spacing_a=lattice_spacing)&lt;br /&gt;
lat_diamond = DiamondTwoParticleLattice([polysphere], lattice_spacing_a=lattice_spacing)&lt;br /&gt;
&lt;br /&gt;
q = np.linspace(.4, 4, 1000)&lt;br /&gt;
# Now compute the intensity, it will take some time...&lt;br /&gt;
Z0_sc = lat_sc.intensity(q, peak)&lt;br /&gt;
Pq_sc = lat_sc.form_factor_squared_isotropic(q)&lt;br /&gt;
&lt;br /&gt;
c_sc = .1&lt;br /&gt;
&lt;br /&gt;
# note Gq is same for all three here (just depends on sigma_D, it&amp;#039;s an exponential decay...)&lt;br /&gt;
Gq_sc = lat_sc.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_sc = c_sc*Z0_sc/Pq_sc*Gq_sc + (1-Gq_sc)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Simple Cubic&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Z0_fcc = lat_fcc.intensity(q, peak)&lt;br /&gt;
Pq_fcc = lat_fcc.form_factor_squared_isotropic(q)&lt;br /&gt;
Gq_fcc = lat_fcc.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_fcc = c_sc*Z0_fcc/Pq_fcc*Gq_fcc + (1-Gq_fcc)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Face Centered Cubic&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Z0_bcc = lat_bcc.intensity(q, peak)&lt;br /&gt;
Pq_bcc = lat_bcc.form_factor_squared_isotropic(q)&lt;br /&gt;
Gq_bcc = lat_bcc.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_bcc = c_sc*Z0_bcc/Pq_bcc*Gq_bcc + (1-Gq_bcc)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Body Centered Cubic&amp;quot;)&lt;br /&gt;
Z0_diamond = lat_diamond.intensity(q, peak)&lt;br /&gt;
Pq_diamond = lat_diamond.form_factor_squared_isotropic(q)&lt;br /&gt;
Gq_diamond = lat_diamond.G_q(q)&lt;br /&gt;
&lt;br /&gt;
Sq_diamond = c_sc*Z0_diamond/Pq_diamond*Gq_diamond + (1-Gq_diamond)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Finished calculating Diamond&amp;quot;)&lt;br /&gt;
plt.figure(0, figsize=(10,8));plt.clf()&lt;br /&gt;
plt.subplot(2,2,1)&lt;br /&gt;
plt.title(&amp;quot;Simple Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_sc)&lt;br /&gt;
plt.subplot(2,2,2)&lt;br /&gt;
plt.title(&amp;quot;Face Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_fcc)&lt;br /&gt;
plt.subplot(2,2,3)&lt;br /&gt;
plt.title(&amp;quot;Body Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_bcc)&lt;br /&gt;
plt.subplot(2,2,4)&lt;br /&gt;
plt.title(&amp;quot;Diamond Structure Factor&amp;quot;)&lt;br /&gt;
plt.plot(q, Sq_diamond)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Same, but loglog plot (sometimes easier to see)&lt;br /&gt;
&lt;br /&gt;
plt.figure(1, figsize=(10,8));plt.clf()&lt;br /&gt;
plt.subplot(2,2,1)&lt;br /&gt;
plt.title(&amp;quot;Simple Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_sc)&lt;br /&gt;
plt.subplot(2,2,2)&lt;br /&gt;
plt.title(&amp;quot;Face Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_fcc)&lt;br /&gt;
plt.subplot(2,2,3)&lt;br /&gt;
plt.title(&amp;quot;Body Centered Cubic Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_bcc)&lt;br /&gt;
plt.subplot(2,2,4)&lt;br /&gt;
plt.title(&amp;quot;Diamond Structure Factor&amp;quot;)&lt;br /&gt;
plt.loglog(q, Sq_diamond)&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim&amp;diff=5715</id>
		<title>ScatterSim</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim&amp;diff=5715"/>
		<updated>2017-03-29T15:07:51Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;[[ScatterSim]]&amp;#039;&amp;#039;&amp;#039; is a set of [[Python]] code for simulating the one-dimensional curve (circular average) for [[Lattices of nano-objects|nanoparticle superlattices]].&lt;br /&gt;
* Citation: [[Yager, K.G.]]; Zhang, Y.; Lu, F.; Gang, O. &amp;quot;[http://scripts.iucr.org/cgi-bin/paper?S160057671302832X Periodic lattices of arbitrary nano-objects: modeling and applications for self-assembled systems]&amp;quot; &amp;#039;&amp;#039;Journal of Applied Crystallography&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;2014&amp;#039;&amp;#039;&amp;#039;, 47, 118–129. [http://dx.doi.org/10.1107/S160057671302832X doi: 10.1107/S160057671302832X]&lt;br /&gt;
** See also [[Paper:Periodic lattices of arbitrary nano-objects: modeling and applications for self-assembled systems|summary of paper]].&lt;br /&gt;
* [http://github.com/CFN-softbio/ScatterSim Code available on github.]&lt;br /&gt;
[[Image:NanoLattice cartoon.jpg|center|500px]]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[ScatterSim:Examples]]&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:Examples:001Sphere&amp;diff=5711</id>
		<title>ScatterSim:Examples:001Sphere</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:Examples:001Sphere&amp;diff=5711"/>
		<updated>2017-03-28T20:44:12Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This example shows you how to create a sphere NanoObject and view its 2D form factor, projection, as well as its isotropically averaged form factor.&lt;br /&gt;
It also shows you how to add polydispersity to your NanoObject.&lt;br /&gt;
Some code necessary for plotting is deferred at end of document for clarity. &amp;#039;&amp;#039;&amp;#039;Be sure to first copy and paste that code before running the rest.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
from ScatterSim.NanoObjects import SphereNanoObject, PolydisperseNanoObject&lt;br /&gt;
import numpy as np&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
%matplotlib inline&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Definining a sphere is simple&lt;br /&gt;
pargs_sphere = {&amp;#039;radius&amp;#039; : 1}&lt;br /&gt;
sphere = SphereNanoObject(pargs_sphere)&lt;br /&gt;
&lt;br /&gt;
# You can also define a NanoObject with a stochastic parameter&lt;br /&gt;
# in this case, we&amp;#039;ll make a polydisperse sphere&lt;br /&gt;
# The varied parameter will be the radius&lt;br /&gt;
pargs_polysphere = dict(radius= 1, sigma_R=.04) # (alternate way of defining dictionaries)&lt;br /&gt;
# Just give the object the class you&amp;#039;re interested in, and tell it what the parameter it&lt;br /&gt;
# is you&amp;#039;re varying&lt;br /&gt;
# The parameter is assumed to be sampled from a Gaussian distribution of mean &amp;#039;argname&amp;#039;&lt;br /&gt;
# and standard deviation (sigma) &amp;#039;sigma_R&amp;#039;&lt;br /&gt;
polysphere = PolydisperseNanoObject(SphereNanoObject, pargs_polysphere, argname=&amp;#039;radius&amp;#039;, argstdname=&amp;#039;sigma_R&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Now choose a q domain for the plotting. The units of q will be the inverse of units you supply&lt;br /&gt;
# as parameters to the object. For example, we used nanometers, so q will be in inverse nanometers&lt;br /&gt;
q = np.linspace(0, 10, 1000)&lt;br /&gt;
&lt;br /&gt;
# finally, calculate&lt;br /&gt;
sq_sphere = sphere.form_factor_squared_isotropic(q)&lt;br /&gt;
# The polydisperse sphere should take roughly 21 times longer. This is because&lt;br /&gt;
# by default it computes the form factors of spheres of radii from 21 points in the distribution&lt;br /&gt;
# You can change this, and even change the distribution by reading more into the code&lt;br /&gt;
# of NanoObjects.PolydisperseNanoObject&lt;br /&gt;
sq_polysphere = polysphere.form_factor_squared_isotropic(q)&lt;br /&gt;
&lt;br /&gt;
# plot using your favorite plotting library&lt;br /&gt;
plt.figure(0);&lt;br /&gt;
plt.clf()&lt;br /&gt;
plt.loglog(q, sq_sphere)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-001-fig1.png]]&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# even with a small polydispersity (4%), polydisperse sphere scattering looks much different&lt;br /&gt;
plt.figure(1);&lt;br /&gt;
plt.clf()&lt;br /&gt;
plt.loglog(q, sq_polysphere)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-001-fig2.png]]&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
# For any object, you can compute the form factor or projection. See functions&lt;br /&gt;
# above on how to do it.&lt;br /&gt;
# P2 means |P|^2 (form factor squared)&lt;br /&gt;
qmax = 10&lt;br /&gt;
P2_xy, P2_yz, P2_xz = form_factor_slices(sphere, qmax)&lt;br /&gt;
rmax = 1.5&lt;br /&gt;
V_xy, V_yz, V_xz = sphere.projections(rmax)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
# remember this is a 3D Object. We can look at projections of the object in real space&lt;br /&gt;
# or slices of the scattering in Fourier (reciprocal) space &lt;br /&gt;
&lt;br /&gt;
show_projections(V_xy, V_yz, V_xz, rmax, 3)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-001-fig3.png]]&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;gt;&lt;br /&gt;
# Showing the form factor&lt;br /&gt;
&lt;br /&gt;
show_qslices(P2_xy, P2_yz, P2_xz, qmax, 2, vmin=0, vmax=6e1)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-001-fig4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plotting code:&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
def form_factor_slices(smod, qmax):&lt;br /&gt;
    &amp;#039;&amp;#039;&amp;#039; Compute the xy, xz, and yz projections.&lt;br /&gt;
    &lt;br /&gt;
    &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
    q = np.linspace(-qmax, qmax,100)&lt;br /&gt;
    QROWS, QCOLS = np.meshgrid(q,q, indexing=&amp;quot;ij&amp;quot;)&lt;br /&gt;
    Q0 = QROWS*0&lt;br /&gt;
    P2_xy = smod.form_factor_squared(np.array([QCOLS, QROWS, Q0]))&lt;br /&gt;
    P2_yz = smod.form_factor_squared(np.array([Q0, QCOLS, QROWS]))&lt;br /&gt;
    P2_xz = smod.form_factor_squared(np.array([QROWS, QCOLS, Q0]))&lt;br /&gt;
&lt;br /&gt;
    return P2_xy, P2_yz, P2_xz&lt;br /&gt;
&lt;br /&gt;
def show_qslices(F_xy, F_xz, F_yz, length, num=4, **kwargs):&lt;br /&gt;
    &amp;#039;&amp;#039;&amp;#039;plot the xy, xz, and yz projections with length used from &lt;br /&gt;
        projections function, in figure num&lt;br /&gt;
        &lt;br /&gt;
        slices go from -2pi/length to +2pi/length&lt;br /&gt;
    &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
    extent = 2*np.pi/length*np.array([-1, 1, -1, 1])&lt;br /&gt;
    plt.figure(num);plt.clf();&lt;br /&gt;
    plt.subplot(2,2,1)&lt;br /&gt;
    plt.title(&amp;quot;x-y plane&amp;quot;)&lt;br /&gt;
    plt.imshow(F_xy,extent=extent, **kwargs)&lt;br /&gt;
    plt.subplot(2,2,2)&lt;br /&gt;
    plt.title(&amp;quot;x-z plane&amp;quot;)&lt;br /&gt;
    plt.imshow(F_xz,extent=extent, **kwargs)&lt;br /&gt;
    plt.subplot(2,2,3)&lt;br /&gt;
    plt.title(&amp;quot;y-z plane&amp;quot;)&lt;br /&gt;
    plt.imshow(F_yz,extent=extent, **kwargs)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
def show_projections(V_xy, V_xz, V_yz, length, num=4):&lt;br /&gt;
    &amp;#039;&amp;#039;&amp;#039;plot the xy, xz, and yz projections with length used from &lt;br /&gt;
        projections function, in figure num&lt;br /&gt;
        projections go from -length to +length&lt;br /&gt;
    &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
    extent = [-length, length, length, -length]&lt;br /&gt;
    plt.figure(num);plt.clf();&lt;br /&gt;
    plt.subplot(2,2,1)&lt;br /&gt;
    plt.title(&amp;quot;x-y plane&amp;quot;)&lt;br /&gt;
    plt.imshow(V_xy,extent=extent)&lt;br /&gt;
    plt.subplot(2,2,2)&lt;br /&gt;
    plt.title(&amp;quot;x-z plane&amp;quot;)&lt;br /&gt;
    plt.imshow(V_xz,extent=extent)&lt;br /&gt;
    plt.subplot(2,2,3)&lt;br /&gt;
    plt.title(&amp;quot;y-z plane&amp;quot;)&lt;br /&gt;
    plt.imshow(V_yz,extent=extent)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:Examples:001Sphere&amp;diff=5710</id>
		<title>ScatterSim:Examples:001Sphere</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:Examples:001Sphere&amp;diff=5710"/>
		<updated>2017-03-28T20:40:05Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
from ScatterSim.NanoObjects import SphereNanoObject, PolydisperseNanoObject&lt;br /&gt;
import numpy as np&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
%matplotlib inline&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Definining a sphere is simple&lt;br /&gt;
pargs_sphere = {&amp;#039;radius&amp;#039; : 1}&lt;br /&gt;
sphere = SphereNanoObject(pargs_sphere)&lt;br /&gt;
&lt;br /&gt;
# You can also define a NanoObject with a stochastic parameter&lt;br /&gt;
# in this case, we&amp;#039;ll make a polydisperse sphere&lt;br /&gt;
# The varied parameter will be the radius&lt;br /&gt;
pargs_polysphere = dict(radius= 1, sigma_R=.04) # (alternate way of defining dictionaries)&lt;br /&gt;
# Just give the object the class you&amp;#039;re interested in, and tell it what the parameter it&lt;br /&gt;
# is you&amp;#039;re varying&lt;br /&gt;
# The parameter is assumed to be sampled from a Gaussian distribution of mean &amp;#039;argname&amp;#039;&lt;br /&gt;
# and standard deviation (sigma) &amp;#039;sigma_R&amp;#039;&lt;br /&gt;
polysphere = PolydisperseNanoObject(SphereNanoObject, pargs_polysphere, argname=&amp;#039;radius&amp;#039;, argstdname=&amp;#039;sigma_R&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Now choose a q domain for the plotting. The units of q will be the inverse of units you supply&lt;br /&gt;
# as parameters to the object. For example, we used nanometers, so q will be in inverse nanometers&lt;br /&gt;
q = np.linspace(0, 10, 1000)&lt;br /&gt;
&lt;br /&gt;
# finally, calculate&lt;br /&gt;
sq_sphere = sphere.form_factor_squared_isotropic(q)&lt;br /&gt;
# The polydisperse sphere should take roughly 21 times longer. This is because&lt;br /&gt;
# by default it computes the form factors of spheres of radii from 21 points in the distribution&lt;br /&gt;
# You can change this, and even change the distribution by reading more into the code&lt;br /&gt;
# of NanoObjects.PolydisperseNanoObject&lt;br /&gt;
sq_polysphere = polysphere.form_factor_squared_isotropic(q)&lt;br /&gt;
&lt;br /&gt;
# plot using your favorite plotting library&lt;br /&gt;
plt.figure(0);&lt;br /&gt;
plt.clf()&lt;br /&gt;
plt.loglog(q, sq_sphere)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-001-fig1.png]]&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# even with a small polydispersity (4%), polydisperse sphere scattering looks much different&lt;br /&gt;
plt.figure(1);&lt;br /&gt;
plt.clf()&lt;br /&gt;
plt.loglog(q, sq_polysphere)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-001-fig2.png]]&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
# For any object, you can compute the form factor or projection. See functions&lt;br /&gt;
# above on how to do it.&lt;br /&gt;
# P2 means |P|^2 (form factor squared)&lt;br /&gt;
qmax = 10&lt;br /&gt;
P2_xy, P2_yz, P2_xz = form_factor_slices(sphere, qmax)&lt;br /&gt;
rmax = 1.5&lt;br /&gt;
V_xy, V_yz, V_xz = sphere.projections(rmax)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
# remember this is a 3D Object. We can look at projections of the object in real space&lt;br /&gt;
# or slices of the scattering in Fourier (reciprocal) space &lt;br /&gt;
&lt;br /&gt;
show_projections(V_xy, V_yz, V_xz, rmax, 3)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-001-fig3.png]]&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;gt;&lt;br /&gt;
# Showing the form factor&lt;br /&gt;
&lt;br /&gt;
show_qslices(P2_xy, P2_yz, P2_xz, qmax, 2, vmin=0, vmax=6e1)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-001-fig4.png]]&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:Examples:002Lattice&amp;diff=5709</id>
		<title>ScatterSim:Examples:002Lattice</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:Examples:002Lattice&amp;diff=5709"/>
		<updated>2017-03-28T20:39:21Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: Created page with &amp;quot;&amp;lt;source lang=&amp;quot;python&amp;gt; # The next step is creating a lattice  from ScatterSim.NanoObjects import SphereNanoObject, PolydisperseNanoObject # We&amp;#039;ll import a few lattices, cubic, ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;source lang=&amp;quot;python&amp;gt;&lt;br /&gt;
# The next step is creating a lattice&lt;br /&gt;
&lt;br /&gt;
from ScatterSim.NanoObjects import SphereNanoObject, PolydisperseNanoObject&lt;br /&gt;
# We&amp;#039;ll import a few lattices, cubic, FCC, BCC and Diamond&lt;br /&gt;
from ScatterSim.LatticeObjects import SimpleCubic, FCCLattice, BCCLattice, DiamondTwoParticleLattice&lt;br /&gt;
# import the peak shape for the peaks, tunable&lt;br /&gt;
from ScatterSim.PeakShape import PeakShape&lt;br /&gt;
&lt;br /&gt;
import numpy as np&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TBA&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:Examples&amp;diff=5708</id>
		<title>ScatterSim:Examples</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:Examples&amp;diff=5708"/>
		<updated>2017-03-28T20:38:06Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These examples are typical use cases of the ScatterSim library to help get started using the library.&lt;br /&gt;
&lt;br /&gt;
These examples may also be found on the [http://github.com/CFN-softbio/ScatterSim-examples| github page].&lt;br /&gt;
&lt;br /&gt;
[[ScatterSim:Examples:001Sphere|Example 1]] : Creating a sphere and computing the form factor or viewing a projection.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[ScatterSim:Examples:002Lattice|Example 2]] : Creating a lattice and computing the powder diffraction.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[ScatterSim:Examples:003Poly|Example 3]] : Creating a polydisperse object (cylinder in this case)&amp;lt;br /&amp;gt;&lt;br /&gt;
[[ScatterSim:Examples:004Composite|Example 4]] : Creating a composite nano object comprised of two cylinders.&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:Examples&amp;diff=5707</id>
		<title>ScatterSim:Examples</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:Examples&amp;diff=5707"/>
		<updated>2017-03-28T20:35:23Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[ScatterSim:Examples:001Sphere|Example 1]] : Creating a sphere and computing the form factor or viewing a projection.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[ScatterSim:Examples:002Lattice|Example 2]] : Creating a lattice and computing the powder diffraction.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[ScatterSim:Examples:003Poly|Example 3]] : Creating a polydisperse object (cylinder in this case)&amp;lt;br /&amp;gt;&lt;br /&gt;
[[ScatterSim:Examples:004Composite|Example 4]] : Creating a composite nano object comprised of two cylinders.&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:Examples:001Sphere&amp;diff=5706</id>
		<title>ScatterSim:Examples:001Sphere</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:Examples:001Sphere&amp;diff=5706"/>
		<updated>2017-03-28T20:31:03Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: Created page with &amp;quot;&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt; from ScatterSim.NanoObjects import SphereNanoObject, PolydisperseNanoObject import numpy as np import matplotlib.pyplot as plt %matplotlib inline   # De...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
from ScatterSim.NanoObjects import SphereNanoObject, PolydisperseNanoObject&lt;br /&gt;
import numpy as np&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
%matplotlib inline&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Definining a sphere is simple&lt;br /&gt;
pargs_sphere = {&amp;#039;radius&amp;#039; : 1}&lt;br /&gt;
sphere = SphereNanoObject(pargs_sphere)&lt;br /&gt;
&lt;br /&gt;
# You can also define a NanoObject with a stochastic parameter&lt;br /&gt;
# in this case, we&amp;#039;ll make a polydisperse sphere&lt;br /&gt;
# The varied parameter will be the radius&lt;br /&gt;
pargs_polysphere = dict(radius= 1, sigma_R=.04) # (alternate way of defining dictionaries)&lt;br /&gt;
# Just give the object the class you&amp;#039;re interested in, and tell it what the parameter it&lt;br /&gt;
# is you&amp;#039;re varying&lt;br /&gt;
# The parameter is assumed to be sampled from a Gaussian distribution of mean &amp;#039;argname&amp;#039;&lt;br /&gt;
# and standard deviation (sigma) &amp;#039;sigma_R&amp;#039;&lt;br /&gt;
polysphere = PolydisperseNanoObject(SphereNanoObject, pargs_polysphere, argname=&amp;#039;radius&amp;#039;, argstdname=&amp;#039;sigma_R&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Now choose a q domain for the plotting. The units of q will be the inverse of units you supply&lt;br /&gt;
# as parameters to the object. For example, we used nanometers, so q will be in inverse nanometers&lt;br /&gt;
q = np.linspace(0, 10, 1000)&lt;br /&gt;
&lt;br /&gt;
# finally, calculate&lt;br /&gt;
sq_sphere = sphere.form_factor_squared_isotropic(q)&lt;br /&gt;
# The polydisperse sphere should take roughly 21 times longer. This is because&lt;br /&gt;
# by default it computes the form factors of spheres of radii from 21 points in the distribution&lt;br /&gt;
# You can change this, and even change the distribution by reading more into the code&lt;br /&gt;
# of NanoObjects.PolydisperseNanoObject&lt;br /&gt;
sq_polysphere = polysphere.form_factor_squared_isotropic(q)&lt;br /&gt;
&lt;br /&gt;
# plot using your favorite plotting library&lt;br /&gt;
plt.figure(0);&lt;br /&gt;
plt.clf()&lt;br /&gt;
plt.loglog(q, sq_sphere)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-001-fig1.png]]&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# even with a small polydispersity (4%), polydisperse sphere scattering looks much different&lt;br /&gt;
plt.figure(1);&lt;br /&gt;
plt.clf()&lt;br /&gt;
plt.loglog(q, sq_polysphere)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-001-fig2.png]]&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
# For any object, you can compute the form factor or projection. See functions&lt;br /&gt;
# above on how to do it.&lt;br /&gt;
# P2 means |P|^2 (form factor squared)&lt;br /&gt;
qmax = 10&lt;br /&gt;
P2_xy, P2_yz, P2_xz = form_factor_slices(sphere, qmax)&lt;br /&gt;
rmax = 1.5&lt;br /&gt;
V_xy, V_yz, V_xz = sphere.projections(rmax)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-001-fig3.png]]&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;#039;&amp;gt;&lt;br /&gt;
# remember this is a 3D Object. We can look at projections of the object in real space&lt;br /&gt;
# or slices of the scattering in Fourier (reciprocal) space &lt;br /&gt;
&lt;br /&gt;
show_projections(V_xy, V_yz, V_xz, rmax, 3)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[File:ScatterSimExamples-001-fig4.png]]&lt;br /&gt;
&amp;lt;source lang=&amp;#039;python&amp;gt;&lt;br /&gt;
# Showing the form factor&lt;br /&gt;
&lt;br /&gt;
show_qslices(P2_xy, P2_yz, P2_xz, qmax, 2, vmin=0, vmax=6e1)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=File:ScatterSimExamples-001-fig4.png&amp;diff=5705</id>
		<title>File:ScatterSimExamples-001-fig4.png</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=File:ScatterSimExamples-001-fig4.png&amp;diff=5705"/>
		<updated>2017-03-28T20:30:09Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: Fourth figure of example #1 of ScatterSim examples.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Fourth figure of example #1 of ScatterSim examples.&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=File:ScatterSimExamples-001-fig3.png&amp;diff=5704</id>
		<title>File:ScatterSimExamples-001-fig3.png</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=File:ScatterSimExamples-001-fig3.png&amp;diff=5704"/>
		<updated>2017-03-28T20:29:56Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: Third figure of example #1 of ScatterSim examples.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Third figure of example #1 of ScatterSim examples.&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=File:ScatterSimExamples-001-fig2.png&amp;diff=5703</id>
		<title>File:ScatterSimExamples-001-fig2.png</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=File:ScatterSimExamples-001-fig2.png&amp;diff=5703"/>
		<updated>2017-03-28T20:29:36Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: Second figure of Example #1 of ScatterSim examples.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Second figure of Example #1 of ScatterSim examples.&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=File:ScatterSimExamples-001-fig1.png&amp;diff=5702</id>
		<title>File:ScatterSimExamples-001-fig1.png</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=File:ScatterSimExamples-001-fig1.png&amp;diff=5702"/>
		<updated>2017-03-28T20:29:03Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: First figure of Example #1 of ScatterSim Examples.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;First figure of Example #1 of ScatterSim Examples.&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
	<entry>
		<id>http://gisaxs.com/index.php?title=ScatterSim:Examples&amp;diff=5701</id>
		<title>ScatterSim:Examples</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=ScatterSim:Examples&amp;diff=5701"/>
		<updated>2017-03-28T20:20:50Z</updated>

		<summary type="html">&lt;p&gt;JulienLhermitte: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Example 1 : Creating a sphere and computing the form factor or viewing a projection.&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 2 : Creating a lattice and computing the powder diffraction.&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 3 : Creating a polydisperse object (cylinder in this case)&amp;lt;br /&amp;gt;&lt;br /&gt;
Example 4 : Creating a composite nano object comprised of two cylinders.&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>JulienLhermitte</name></author>
		
	</entry>
</feed>