Added gradient calculation

This commit is contained in:
2025-04-03 22:56:03 +02:00
parent 33bf3d6833
commit 11729f67e5
5 changed files with 2247 additions and 2 deletions

View File

@@ -0,0 +1,81 @@
<head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link href=”https://cdn.pydata.org/bokeh/release/bokeh-3.7.1.min.css" rel=”stylesheet” type=”text/css”>
<link href=”https://cdn.pydata.org/bokeh/release/bokeh-widgets-3.7.1.min.css" rel=”stylesheet” type=”text/css”>
</head>
<body>
<div class="center">
<h1>Isotopes</h1>
<table class="table w-auto table-responsive-sm table-striped table-hover table-bordered">
<caption>
Table downloaded from <a href="https://easyspin.org/documentation/isotopetable.html">easyspin.org</a>
(2023-07-29 markusro)
</caption>
<thead class="table-dark">
<tr>
<th scope="col">N</th>
<th scope="col">Symbol</th>
<th scope="col">Name</th>
<th scope="col">f<sub>0</sub> in MHz</th>
<th scope="col">Spin</th>
<th scope="col">Nat. ab. in %</th>
<th scope="col">&gamma; in MHz/T</th>
<th scope="col">Sens. in %(<sup>1</sup>H)</th>
</tr>
</thead>
<tbody>
{% for attr in ans %}
<tr>
{% for i in attr %}
<td>{{ i }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{{ div| safe }}
<div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/latest.js"
integrity="sha512-nUTIGJLS9aRMjQaRwpCiC+0Y2RzgW4sufFhFgyjHgn15DXLSfoVUaEa83CsNe2FSJpLXtfgdVfgL7a0lrbcBWA=="
crossorigin="anonymous"
referrerpolicy="no-referrer">
</script>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-3.7.1.min.js"></script>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.7.1.min.js"></script>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.7.1.min.js"></script>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-api-3.7.1.min.js"></script>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-mathjax-3.7.1.min.js"></script>
{{ script| safe }}
</div>
<a href="{% url 'home' %}">Go Back</a>
</div>
</body>
<style>
.center {
margin: auto;
width: 40%;
padding: 10px;
}
caption {
caption-side: bottom;
padding: 8px;
font-weight: normal;
font-size: 0.8rem;
text-align: left;
}
.table-striped {
--bs-table-striped-bg: rgba(213, 217, 255, 0.7);
}
</style>

View File

@@ -0,0 +1,77 @@
<head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
</head>
<style>
.center {
margin: auto;
width: 60%;
border: 3px solid #90befb;
border: 3px solid #a5addb;
padding: 10px;
}
</style>
<div class="container text-left">
<h1>SFG Position Calculator</h1>
<form action="position">
<div class="row row-cols-6">
<div class="col"><label class="form-label">Source isotope:</label></div>
<div class="col">
<select name="isotope1" class="form-select" size="1">
{% for i in isotopes %}
<option value="{{ i.0 }}">{{ i.1 }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="row row-cols-6">
<div class="col"><label class="form-label">Source frequency in MHz:</label></div>
<div class="col">
<input type="number" name="freq" class="form-control" step="any" value=100
placeholder="Larmor frequency in MHz">
</div>
</div>
<div class="row row-cols-6">
<label class="form-label">Destination isotope:</label>
<div class="col">
<select name="isotope2" class="form-select" size="1">
{% for i in isotopes %}
<option value="{{ i.0 }}">{{ i.1 }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="row row-cols-6">
<label class="form-label">Probe length:</label>
<div class="col">
<input type="number" name="probe_length" class="form-control" step="any"
placeholder="Probe length in mm">
</div>
</div>
<div class="row row-cols-6">
<label class="form-label">Magnet</label>
<div class="col">
<select name="magnet" class="form-select" size="1">
<option value="oxford_profile.dat">Oxford</option>
<option value="oxford_profile.dat">Magnex</option>
</select>
</div>
</div>
<div class="row row-cols-6">
<label class="form-label">Gradient in T/m:<br>(assuming &#x2300;5mm)</label>
<div class="col"><input type="number" name="gradient" class="form-control" step="any"
placeholder="Gradient in T/m"></div>
<div class="col">
<button type="submit" name="gradient_search" class="btn btn-primary btn-sm">Get position</button>
</div>
</div>
</form>
</div>
<div>
{{ ans }}
</div>