From 1797e68c359c6bbd111c8119824181feb91305fc Mon Sep 17 00:00:00 2001 From: hiro98 Date: Sun, 26 Jan 2020 14:13:54 +0100 Subject: [PATCH] add numbers to the table --- tem/auswertung/figs/gold_hires/profile_1.pdf | Bin 19926 -> 19926 bytes tem/auswertung/figs/gold_hires/profile_10.pdf | Bin 20358 -> 20358 bytes tem/auswertung/figs/gold_hires/profile_4.pdf | Bin 20455 -> 20455 bytes tem/auswertung/figs/gold_hires/profile_6.pdf | Bin 20759 -> 20759 bytes tem/auswertung/gold_diffr.ipynb | 76 ++++++++++-------- tem/auswertung/hrtem.ipynb | 56 +++++++++---- tem/auswertung/out/figlist.txt | 24 ++++++ tem/auswertung/utility.py | 8 +- 8 files changed, 113 insertions(+), 51 deletions(-) diff --git a/tem/auswertung/figs/gold_hires/profile_1.pdf b/tem/auswertung/figs/gold_hires/profile_1.pdf index bee854ce10a06318bd75eabc306182280f0c7ecd..60186331e2f508528b29303d13ff2987672d4aed 100644 GIT binary patch delta 20 ccmcaMoAKIg#tpYTSWOJfjZ8M*_xR2N0A6Sak^lez delta 20 ccmcaMoAKIg#tpYTSdEPh4U9J5_xR2N0A4Q$iU0rr diff --git a/tem/auswertung/figs/gold_hires/profile_10.pdf b/tem/auswertung/figs/gold_hires/profile_10.pdf index 963dc3700e26d90f65f1961144db3a9380a7c776..66585b55b50daf8e2fb508318fb0947657881911 100644 GIT binary patch delta 20 bcmZph&)7DfaYL6EtBHZRk=f>cukS1XPCf@< delta 20 bcmZph&)7DfaYL6EtFf`6f$`>kukS1XP5%d1 diff --git a/tem/auswertung/figs/gold_hires/profile_4.pdf b/tem/auswertung/figs/gold_hires/profile_4.pdf index 70642bfbb2e5c60a24471700388b3f4364c18838..cc23c3909b0f1ac7ed3e41fc231f3cef76e9e8de 100644 GIT binary patch delta 20 ccmaDppYi#8#tqlKSWOJfjZ8P+@#1C$0AGU#&;S4c delta 20 ccmaDppYi#8#tqlKSdEPh4U9J5@#1C$0AEB0#{d8T diff --git a/tem/auswertung/figs/gold_hires/profile_6.pdf b/tem/auswertung/figs/gold_hires/profile_6.pdf index f232f2df8fecfe90e30c2fa64b9cfb41495d7fac..c803ad5c93a5274577107377734ca38565a20b81 100644 GIT binary patch delta 20 bcmbQfh;jNN#trN~tR@ELMy8v2e7IQwMydsx delta 20 bcmbQfh;jNN#trN~tj5NM2F9Cte7IQwMsWp_ diff --git a/tem/auswertung/gold_diffr.ipynb b/tem/auswertung/gold_diffr.ipynb index e7e7d6b..869d2af 100644 --- a/tem/auswertung/gold_diffr.ipynb +++ b/tem/auswertung/gold_diffr.ipynb @@ -98,7 +98,7 @@ }, { "cell_type": "code", - "execution_count": 138, + "execution_count": 142, "metadata": { "autoscroll": false, "collapsed": false, @@ -110,16 +110,19 @@ }, "outputs": [ { - "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\u001b[0m in \u001b[0;36m\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\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()" + "name": "stdout", + "output_type": "stream", + "text": [ + "(array([ 4, 4, 9, 11, 13, 24, 27, 30, 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.41640285, 0.00116798, 0.02043268],\n", + " [0.40118533, 0.00102217, 0.01063151],\n", + " [0.4014384 , 0.00097094, 0.007732 ],\n", + " [0.40573231, 0.00085894, 0.01187421]]), array([0.0287859 , 0.02125187, 0.00854528, 0.00844723, 0.0019683 ,\n", + " 0.00860285, 0.00661467, 0.0063616 , 0.00206769]))\n" ] } ], @@ -130,7 +133,7 @@ }, { "cell_type": "code", - "execution_count": 101, + "execution_count": 143, "metadata": { "autoscroll": false, "collapsed": false, @@ -150,9 +153,9 @@ "\\(\\sqrt{9}\\) & 0.3993 & 0.0018 & 0.0194 & 0.009 \\\\\n", "\\(\\sqrt{11}\\) & 0.3994 & 0.0016 & 0.0017 & 0.008 \\\\\n", "\\(\\sqrt{13}\\) & 0.4098 & 0.0015 & 0.0206 & 0.002 \\\\\n", - "\\(\\sqrt{23}\\) & 0.4076 & 0.0011 & 0.02 & 0.000 \\\\\n", - "\\(\\sqrt{28}\\) & 0.4085 & 0.001 & 0.0108 & 0.001 \\\\\n", - "\\(\\sqrt{31}\\) & 0.4081 & 0.001 & 0.0079 & 0.000 \\\\\n", + "\\(\\sqrt{24}\\) & 0.4164 & 0.0012 & 0.0204 & 0.009 \\\\\n", + "\\(\\sqrt{27}\\) & 0.4012 & 0.001 & 0.0106 & 0.007 \\\\\n", + "\\(\\sqrt{30}\\) & 0.4014 & 0.001 & 0.0077 & 0.006 \\\\\n", "\\(\\sqrt{40}\\) & 0.4057 & 0.0009 & 0.0119 & 0.002 \\\\\n", "\n" ] @@ -164,7 +167,7 @@ }, { "cell_type": "code", - "execution_count": 135, + "execution_count": 144, "metadata": { "autoscroll": false, "collapsed": false, @@ -174,24 +177,14 @@ "slide_type": "-" } }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[ 730.29050427 4120.30484636 2244.84475614 95331.69131926\n", - " 2037.07066904 2236.39955377 7100.34700268 12776.96536546\n", - " 6167.76634145]\n" - ] - } - ], + "outputs": [], "source": [ "a, d_a, sigma_a = determine_lattice_constant(hypothesis)" ] }, { "cell_type": "code", - "execution_count": 136, + "execution_count": 145, "metadata": { "autoscroll": false, "collapsed": false, @@ -205,10 +198,10 @@ { "data": { "text/plain": [ - "(0.4011, 0.0027, 0.0051)" + "(0.4002, 0.0027, 0.0046)" ] }, - "execution_count": 136, + "execution_count": 145, "metadata": {}, "output_type": "execute_result" } @@ -219,7 +212,7 @@ }, { "cell_type": "code", - "execution_count": 137, + "execution_count": 146, "metadata": { "autoscroll": false, "collapsed": false, @@ -238,9 +231,9 @@ "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", + "25 & \\mqty{4 & 2 & 2} \\\\\n", + "28 & \\mqty{3 & 3 & 3}, \\mqty{5 & 1 & 1} \\\\\n", + "31 & \\mqty{5 & 2 & 1} \\\\\n", "41 & \\mqty{6 & 2 & 0} \\\\\n", "\n" ] @@ -249,6 +242,21 @@ "source": [ "print(generate_miller_table(hypothesis[0]))" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "autoscroll": false, + "collapsed": false, + "ein.hycell": false, + "ein.tags": "worksheet-0", + "slideshow": { + "slide_type": "-" + } + }, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/tem/auswertung/hrtem.ipynb b/tem/auswertung/hrtem.ipynb index d0ec512..4e0ba14 100644 --- a/tem/auswertung/hrtem.ipynb +++ b/tem/auswertung/hrtem.ipynb @@ -41,7 +41,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 117, "metadata": { "autoscroll": false, "collapsed": false, @@ -111,7 +111,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 118, "metadata": { "autoscroll": false, "collapsed": false, @@ -128,7 +128,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 128, "metadata": { "autoscroll": false, "collapsed": false, @@ -143,10 +143,10 @@ "name": "stdout", "output_type": "stream", "text": [ - "\\(\\sqrt{4}\\) & 0.409 & 0.013 & 0.013 & 0.001 \\\\\n", - "\\(\\sqrt{3}\\) & 0.424 & 0.009 & 0.01 & 0.016 \\\\\n", - "\\(\\sqrt{3}\\) & 0.405 & 0.006 & 0.008 & 0.003 \\\\\n", - "\\(\\sqrt{3}\\) & 0.418 & 0.008 & 0.01 & 0.010 \\\\\n", + "1 & \\(\\sqrt{4}\\) & 0.409 & 0.013 & 0.013 & 0.001 \\\\\n", + "2 & \\(\\sqrt{3}\\) & 0.424 & 0.009 & 0.01 & 0.016 \\\\\n", + "3 & \\(\\sqrt{3}\\) & 0.405 & 0.006 & 0.008 & 0.003 \\\\\n", + "4 & \\(\\sqrt{3}\\) & 0.418 & 0.008 & 0.01 & 0.010 \\\\\n", "\n" ] } @@ -157,7 +157,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 120, "metadata": { "autoscroll": false, "collapsed": false, @@ -174,7 +174,7 @@ "(0.4131417242218807, 0.009111543899908446, 0.007970106548602144)" ] }, - "execution_count": 33, + "execution_count": 120, "metadata": {}, "output_type": "execute_result" } @@ -186,7 +186,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 121, "metadata": { "autoscroll": false, "collapsed": false, @@ -203,7 +203,7 @@ "(0.413, 0.009, 0.008)" ] }, - "execution_count": 34, + "execution_count": 121, "metadata": {}, "output_type": "execute_result" } @@ -214,7 +214,7 @@ }, { "cell_type": "code", - "execution_count": 116, + "execution_count": 125, "metadata": { "autoscroll": false, "collapsed": false, @@ -229,8 +229,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "4 & \\mqty{1 & 1 & 1} \\\\\n", - "5 & \\mqty{2 & 0 & 0} \\\\\n", + "3 & \\mqty{1 & 1 & 1} \\\\\n", + "4 & \\mqty{2 & 0 & 0} \\\\\n", "\n" ] } @@ -238,6 +238,34 @@ "source": [ "print(generate_miller_table(hypothesis[0]))" ] + }, + { + "cell_type": "code", + "execution_count": 123, + "metadata": { + "autoscroll": false, + "collapsed": false, + "ein.hycell": false, + "ein.tags": "worksheet-0", + "slideshow": { + "slide_type": "-" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "(array([4, 3, 3, 3]), array([[0.4085 , 0.01308148, 0.01326061],\n [0.42383283, 0.00906311, 0.00981952],\n [0.4046813 , 0.00647365, 0.00820019],\n [0.41821154, 0.00823919, 0.00956327]]), array([0.0007 , 0.01603283, 0.0031187 , 0.01041154]))" + ] + }, + "execution_count": 123, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "hypothesis" + ] } ], "metadata": { diff --git a/tem/auswertung/out/figlist.txt b/tem/auswertung/out/figlist.txt index 2cf2807..ff72c11 100644 --- a/tem/auswertung/out/figlist.txt +++ b/tem/auswertung/out/figlist.txt @@ -94,4 +94,28 @@ \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} \ No newline at end of file diff --git a/tem/auswertung/utility.py b/tem/auswertung/utility.py index 83cd8fe..1057df1 100644 --- a/tem/auswertung/utility.py +++ b/tem/auswertung/utility.py @@ -221,8 +221,9 @@ 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} & ' + out += f'{i} & ' for ind in ind_list: out += r'\mqty{' + ' & '.join(ind.astype(str)) + '}, ' out = out[:-2] @@ -243,10 +244,11 @@ def evaluate_hypothesis(analyzed, maximum=10, gold=.4078): def generate_hypethsesis_table(squared, analyzed, residues): out = '' - for square, value, residue in zip(squared, analyzed, residues): + for i, square, value, residue in zip(range(1, len(squared)+1), + squared, analyzed, residues): value = np.array(scientific_round(*value)) - out += rf'\(\sqrt{{{square}}}\) & ' \ + out += rf'{i} & \(\sqrt{{{square}}}\) & ' \ + ' & '.join(value.astype(str)) + f' & {residue:.3f} \\\\\n' return out