mirror of
https://github.com/vale981/fpraktikum
synced 2025-03-04 17:11:41 -05:00
test that hypothesis can be mesh plane
This commit is contained in:
parent
84823fde4e
commit
75ce8797eb
9 changed files with 153 additions and 24 deletions
|
@ -622,7 +622,8 @@ in~\ref{fig:tom1} dargestellt und wird im Folgenden nachvollzogen.
|
|||
\draw[black] (4.5,3) circle (.6cm) node {3};
|
||||
\draw (3,3) circle (.6cm) node {Leer};
|
||||
\node[draw] at (1.5,2) {Wachs};
|
||||
\end{tikzpicture}}
|
||||
\end{tikzpicture}
|
||||
}
|
||||
\caption[Quellenkonstellation]{Quellenkonstellation}
|
||||
\label{fig:sourccof}
|
||||
\end{wrapfigure}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -98,7 +98,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 73,
|
||||
"execution_count": 138,
|
||||
"metadata": {
|
||||
"autoscroll": false,
|
||||
"collapsed": false,
|
||||
|
@ -110,19 +110,16 @@
|
|||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"(array([ 4, 4, 9, 11, 13, 23, 28, 31, 40]), array([[0.4365859 , 0.00314502, 0.03385928],\n",
|
||||
" [0.38654813, 0.00246542, 0.01311343],\n",
|
||||
" [0.39925472, 0.00175345, 0.0193526 ],\n",
|
||||
" [0.39935277, 0.00158683, 0.00165195],\n",
|
||||
" [0.4097683 , 0.00153681, 0.02061948],\n",
|
||||
" [0.40763549, 0.00114339, 0.02000247],\n",
|
||||
" [0.40854715, 0.00104092, 0.0108266 ],\n",
|
||||
" [0.4080742 , 0.00098699, 0.00785981],\n",
|
||||
" [0.40573231, 0.00085894, 0.01187421]]), array([0.0287859 , 0.02125187, 0.00854528, 0.00844723, 0.0019683 ,\n",
|
||||
" 0.00016451, 0.00074715, 0.0002742 , 0.00206769]))\n"
|
||||
"ename": "TypeError",
|
||||
"evalue": "object of type 'function' has no len()",
|
||||
"output_type": "error",
|
||||
"traceback": [
|
||||
"\u001b[0;31m\u001b[0m",
|
||||
"\u001b[0;31mTypeError\u001b[0mTraceback (most recent call last)",
|
||||
"\u001b[0;32m<ipython-input-138-7fa66147a009>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mhypothesis\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mevaluate_hypothesis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0marray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mcandidates\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0md_candidates\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msigma_candidates\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mT\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmaximum\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m80\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mhypothesis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m~/Documents/Projects/UNI/Prakt/FP/tem/auswertung/utility.py\u001b[0m in \u001b[0;36mevaluate_hypothesis\u001b[0;34m(analyzed, maximum, gold)\u001b[0m\n\u001b[1;32m 227\u001b[0m \u001b[0mdiffs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mempty\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmaximum\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0manalyzed\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 228\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 229\u001b[0;31m \u001b[0msquared_ds\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mx\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mx\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0marange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmaximum\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfind_miller_indices\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m>\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 230\u001b[0m \u001b[0mds\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msqrt\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msquared_ds\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 231\u001b[0m \u001b[0ma\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0manalyzed\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mds\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m:\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;32m~/Documents/Projects/UNI/Prakt/FP/tem/auswertung/utility.py\u001b[0m in \u001b[0;36m<listcomp>\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 227\u001b[0m \u001b[0mdiffs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mempty\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmaximum\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0manalyzed\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 228\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 229\u001b[0;31m \u001b[0msquared_ds\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mx\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mx\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0marange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmaximum\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfind_miller_indices\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m>\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 230\u001b[0m \u001b[0mds\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msqrt\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msquared_ds\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 231\u001b[0m \u001b[0ma\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0manalyzed\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mds\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m:\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
||||
"\u001b[0;31mTypeError\u001b[0m: object of type 'function' has no len()"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@ -222,7 +219,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 130,
|
||||
"execution_count": 137,
|
||||
"metadata": {
|
||||
"autoscroll": false,
|
||||
"collapsed": false,
|
||||
|
@ -232,8 +229,26 @@
|
|||
"slide_type": "-"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"5 & \\mqty{2 & 0 & 0} \\\\\n",
|
||||
"10 & \\mqty{2 & 2 & 1}, \\mqty{3 & 0 & 0} \\\\\n",
|
||||
"12 & \\mqty{3 & 1 & 1} \\\\\n",
|
||||
"14 & \\mqty{3 & 2 & 0} \\\\\n",
|
||||
"24 \\\\\n",
|
||||
"29 \\\\\n",
|
||||
"32 \\\\\n",
|
||||
"41 & \\mqty{6 & 2 & 0} \\\\\n",
|
||||
"\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"print(generate_miller_table(hypothesis[0]))"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"execution_count": 35,
|
||||
"metadata": {
|
||||
"autoscroll": false,
|
||||
"collapsed": false,
|
||||
|
@ -111,7 +111,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"execution_count": 39,
|
||||
"metadata": {
|
||||
"autoscroll": false,
|
||||
"collapsed": false,
|
||||
|
@ -214,7 +214,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 28,
|
||||
"execution_count": 116,
|
||||
"metadata": {
|
||||
"autoscroll": false,
|
||||
"collapsed": false,
|
||||
|
@ -224,8 +224,20 @@
|
|||
"slide_type": "-"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"4 & \\mqty{1 & 1 & 1} \\\\\n",
|
||||
"5 & \\mqty{2 & 0 & 0} \\\\\n",
|
||||
"\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"print(generate_miller_table(hypothesis[0]))"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
|
|
@ -22,4 +22,76 @@
|
|||
\caption{}
|
||||
\label{fig:gold_hires-profile_10}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]\centering
|
||||
\input{../auswertung/figs/gold_hires/profile_1.pgf}
|
||||
\caption{}
|
||||
\label{fig:gold_hires-profile_1}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]\centering
|
||||
\input{../auswertung/figs/gold_hires/profile_4.pgf}
|
||||
\caption{}
|
||||
\label{fig:gold_hires-profile_4}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]\centering
|
||||
\input{../auswertung/figs/gold_hires/profile_6.pgf}
|
||||
\caption{}
|
||||
\label{fig:gold_hires-profile_6}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]\centering
|
||||
\input{../auswertung/figs/gold_hires/profile_10.pgf}
|
||||
\caption{}
|
||||
\label{fig:gold_hires-profile_10}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]\centering
|
||||
\input{../auswertung/figs/gold_hires/profile_1.pgf}
|
||||
\caption{}
|
||||
\label{fig:gold_hires-profile_1}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]\centering
|
||||
\input{../auswertung/figs/gold_hires/profile_4.pgf}
|
||||
\caption{}
|
||||
\label{fig:gold_hires-profile_4}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]\centering
|
||||
\input{../auswertung/figs/gold_hires/profile_6.pgf}
|
||||
\caption{}
|
||||
\label{fig:gold_hires-profile_6}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]\centering
|
||||
\input{../auswertung/figs/gold_hires/profile_10.pgf}
|
||||
\caption{}
|
||||
\label{fig:gold_hires-profile_10}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]\centering
|
||||
\input{../auswertung/figs/gold_hires/profile_1.pgf}
|
||||
\caption{}
|
||||
\label{fig:gold_hires-profile_1}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]\centering
|
||||
\input{../auswertung/figs/gold_hires/profile_4.pgf}
|
||||
\caption{}
|
||||
\label{fig:gold_hires-profile_4}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]\centering
|
||||
\input{../auswertung/figs/gold_hires/profile_6.pgf}
|
||||
\caption{}
|
||||
\label{fig:gold_hires-profile_6}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]\centering
|
||||
\input{../auswertung/figs/gold_hires/profile_10.pgf}
|
||||
\caption{}
|
||||
\label{fig:gold_hires-profile_10}
|
||||
\end{figure}
|
||||
|
|
@ -201,11 +201,40 @@ def analyze_profile(profile, limits=(0, -1), save=None, **peak_args):
|
|||
|
||||
return l, dl, sigma
|
||||
|
||||
def find_miller_indices(squares):
|
||||
squares = np.asarray(squares)
|
||||
if squares.size > 1:
|
||||
return np.array([find_miller_indices(x) for x in squares])
|
||||
square = squares
|
||||
return np.array([(a, b, c) for (a, b, c) \
|
||||
in np.ndindex((square+1, square+1, square+1)) \
|
||||
if a**2 + b**2 + c**2 == square and a >= b >= c])
|
||||
|
||||
def can_be_sum_of_squares(square):
|
||||
for a, b, c in np.ndindex((square+1, square+1, square+1)):
|
||||
if a**2 + b**2 + c**2 == square:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def generate_miller_table(squares):
|
||||
squares = np.unique(squares)
|
||||
inds = find_miller_indices(squares)
|
||||
out = ''
|
||||
for i, ind_list in zip(squares, inds):
|
||||
out += f'{i + 1} & '
|
||||
for ind in ind_list:
|
||||
out += r'\mqty{' + ' & '.join(ind.astype(str)) + '}, '
|
||||
out = out[:-2]
|
||||
|
||||
out += r' \\' + '\n'
|
||||
return out
|
||||
|
||||
def evaluate_hypothesis(analyzed, maximum=10, gold=.4078):
|
||||
diffs = np.empty((maximum, analyzed.shape[0]))
|
||||
|
||||
squared_ds = np.arange(1, maximum + 1, 1)
|
||||
squared_ds = np.array([x for x in np.arange(1, maximum + 1, 1) \
|
||||
if can_be_sum_of_squares(x)])
|
||||
ds = np.sqrt(squared_ds)
|
||||
a = analyzed[:,0][:, None] * ds[None, :]
|
||||
diff = np.abs(a - gold)
|
||||
|
|
Loading…
Add table
Reference in a new issue