-
Notifications
You must be signed in to change notification settings - Fork 0
/
dp_sim.html
66 lines (57 loc) · 2.18 KB
/
dp_sim.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
{% extends "layout.html" %} {% block body %}
<form class="pure-form" action="/dp_sim" method="get">
<p>
Choose a crystal structure from the dropdown box or enter a
<a href="https://materialsproject.org/">Materials Project</a> identifier
(i.e. mp-81), as well as a three digit number <em>hkl</em> or for more
complex orientations, a comma-separated <em>h,k,l</em> zone axis:
</p>
<input type="text" list="structures" name="structure" placeholder="mp-81"
pattern="mp-\d*" title="It should be something like mp-####" {% if structure
is not none %} value="{{'{}'.format(structure)}}" {% endif %} required />
<datalist id="structures">
<option value="mp-81" label="FCC (Au)">asdf</option>
<option value="mp-127" label="BCC (Na)"></option>
<option value="mp-79" label="HCP (Ti)"></option>
<option value="mp-2658" label="interpenetrating Simple Cubic (AlFe)">
</option>
<option value="mp-149" label="Diamond Cubic (Si)"></option>
<option value="mp-22862" label="interpenetrating FCC (NaCl)"></option>
</datalist>
<input type="text" name="zone_axis" placeholder="1,1,1 (h,k,l)" {% if
structure is not none %} value="{{'{},{},{}'.format(h,k,l)}}" {% endif %} />
<button class="pure-button pure-button-primary">Submit</button>
</form>
<!-- <br> -->
{% if success == True %}
<p>
The structure is
<a
href="{{'https://materialsproject.org/materials/{}'.format(structure)}}">{{structure}}</a>
and the zone axis is <{{h}},{{k}},{{l}}>.
</p>
<div class="pure-g dp-grid">
<div class="pure-u-4-5">
<img class="pure-img dp-img"
src="{{url_for('plot_dp_png', structure=structure, h=h, k=k, l=l)}}"
alt="Diffraction Pattern" />
</div>
<div class="pure-u-1-5">
<img class="pure-img dp-img"
src="{{url_for('plot_structure_png', structure=structure, h=h, k=k, l=l)}}"
alt="Crystal Structure" />
</div>
</div>
{% else %}
<p>{{message}}</p>
{% endif %}
<p>
See the
<a
href="https://github.com/tcpekin/flask_site/blob/c5f228b42cbfb61fa1b59372f00e37eff9a003d5/figs.py">source
code</a>
for plotting, which is built using
<a href="https://github.com/py4DSTEM/py4DSTEM">py4DSTEM</a>.
</p>
{% endblock %}