{"id":9579,"date":"2011-03-18T17:41:00","date_gmt":"2011-03-18T17:41:00","guid":{"rendered":"http:\/\/melotopia.net\/b\/?p=9579"},"modified":"2011-03-18T17:41:00","modified_gmt":"2011-03-18T17:41:00","slug":"gaussian-%ec%b6%9c%eb%a0%a5","status":"publish","type":"post","link":"http:\/\/melotopia.net\/b\/?p=9579","title":{"rendered":"Gaussian \ucd9c\ub825"},"content":{"rendered":"<div class=\"desc\">\n        \uc758\uc678\ub85c \ubcc4\ub85c \uc548 \uc5b4\ub824\uc6cc\uc11c.<br \/>\n        <br \/>\n        \uc0ac\uce59\uc5f0\uc0b0, \uc870\uac74\ubb38, \ubc18\ubcf5\ubb38, \ucd9c\ub825, \ud568\uc218\uc0ac\uc6a9, \ubaa8\ub4c8\uc0ac\uc6a9\uae4c\uc9c0 \ud558\ub8e8\ub9cc\uc5d0 \ub2e4 \ub05d\ub0c8\ub2e4.<br \/>\n        <br \/>\n        \uc774\uc81c GUI\ub9cc \ubc30\uc6b0\uba74 \ub05d.<\/p>\n<div class=\"txc-textbox\" style=\"border-style: solid; border-width: 1px; border-color: rgb(254, 222, 199); background-color: rgb(254, 222, 199); padding: 10px;\">\n         #<br \/>\n         <br \/>\n         # Numerical 2D Gaussian Function generator<br \/>\n         <br \/>\n         # Copyright : KeeHwan Nam, 2011,<br \/>\n         <br \/>\n         # Advanced Photonics Research Institute, Gwang-ju Institute of Science and Technology<br \/>\n         <br \/>\n         #<br \/>\n         <br \/>\n         # E-mail : snowall@gmail.com<br \/>\n         <br \/>\n         #<br \/>\n         <br \/>\n         # Please send me what you found bugs.<\/p>\n<p>         import math # math \ubaa8\ub4c8\uc744 \ubd88\ub7ec\uc628\ub2e4<br \/>\n         <br \/>\n         print(&#8220;Numerical 2D Gaussian Function generator with Python3&#8221;) #\ud504\ub85c\uadf8\ub7a8\uc5d0 \ub300\ud55c \uae30\ubcf8\uc801\uc778 \uc815\ubcf4\ub97c \ucd9c\ub825\ud55c\ub2e4<br \/>\n         <br \/>\n         print(&#8220;Copyright : KeeHwan Nam, 2011. v1.0&#8221;)<br \/>\n         <br \/>\n         print(&#8220;E-mail : snowall@gmail.com&#8221;)<\/p>\n<p>         w = int(input(&#8220;Input X(width) pixels = &#8220;)) #input\uc73c\ub85c\ubd80\ud130 \uac12\uc744 \uc77d\uc5b4\uc11c,<br \/>\n         <br \/>\n         h = int(input(&#8220;Input Y(height) pixels = &#8220;))#\uc6a9\ub3c4\uc5d0 \ub9de\uac8c float\uacfc int\ub85c \ubc14\uafd4\uc11c \uac01 \ubcc0\uc218\uc5d0 \ub123\ub294\ub2e4.<br \/>\n         <br \/>\n         izero = float(input(&#8220;Input I_zero  = &#8220;))<br \/>\n         <br \/>\n         xfwhm=float(input(&#8220;Input sigma_x variable = &#8220;))<br \/>\n         <br \/>\n         yfwhm=float(input(&#8220;Input sigma_y variable = &#8220;))<br \/>\n         <br \/>\n         print(&#8220;Check gaussian.csv&#8221;)<\/p>\n<p>         def gaussian(i, j): #gaussian \ud568\uc218\ub97c \uc815\uc758\ud55c\ub2e4.<br \/>\n         <br \/>\n         x = (w\/2.0 &#8211; float(i))\/xfwhm #\ub9e4\uac1c\ubcc0\uc218\ub85c \ubc1b\uc740 \ub450 \uc218\ub97c \uc77c\ub2e8 float\uc73c\ub85c \ubc14\uafb8\uace0<br \/>\n         <br \/>\n         y = (h\/2.0 &#8211; float(j))\/yfwhm #\uc815\uaddc\ubd84\ud3ec \ud568\uc218\uc5d0 \ub123\uc5b4\uc11c<br \/>\n         <br \/>\n         z = izero*math.exp(-x*x-y*y) # \ud06c\uae30\ub97c \ubc14\uafb8\uace0<br \/>\n         <br \/>\n         return z #\uac12\uc744 \ub418\ub3cc\ub824\uc900\ub2e4<\/p>\n<p>         fp = open(&#8220;gaussian.csv&#8221;, &#8220;w&#8221;) #\ud30c\uc77c\uc744 \ub9cc\ub4e0\ub2e4<br \/>\n         <br \/>\n         for j in range(0, h, 1): #\ubc18\ubcf5\uad6c\ubb38\uc744 \ub3cc\ub9b0\ub2e4. range\ub294 0\ubd80\ud130 h\uae4c\uc9c0 1\uc529 \uc99d\uac00\ud558\ub294 \ub9ac\uc2a4\ud2b8\ub97c \ub9cc\ub4e4\uc5b4 \uc8fc\ub294 \ud568\uc218\uc774\ub2e4.<br \/>\n         <br \/>\n         fp.write(&#8220;{0:.3f}&#8221;.format(gaussian(0, j))) #fp\ub97c \uc5f4\uc5c8\uc73c\ub2c8 \uac70\uae30\uc5d0 \uc4f0\uae30\ub85c \ud588\ub2e4. \uc774\ubc88\uc5d4 \uac70\uafb8\ub85c float\uc744 int\ub85c \ubc14\uafd4\uc57c \ud55c\ub2e4<br \/>\n         <br \/>\n         for i in range(1, w, 1):<br \/>\n         <br \/>\n         fp.write(&#8220;,{0:.3f}&#8221;.format(gaussian(i, j))) #format\uad6c\ubb38\uc740 \uc815\uc218\ubd80\ubd84\uc740 \uc804\ubd80, \uc18c\uc218\ubd80\ubd84\uc740 3\uc790\ub9ac\uae4c\uc9c0\ub9cc \ucd9c\ub825\ud558\uae30 \uc704\ud574 \uc0ac\uc6a9\ud55c\ub2e4.<br \/>\n         <br \/>\n         fp.write(&#8220;\\n&#8221;)<\/p>\n<p>         fp.close() #\ub2e4 \uc37c\uc73c\uba74 \ud30c\uc77c\uc744 \ub2eb\ub294\ub2e4.<br \/>\n         <br \/>\n         #\ud504\ub85c\uadf8\ub7a8 \ub05d.\n        <\/div>\n<div style=\"width:100%;margin-top:30px;clear:both;height:30px\">\n<div style=\"width:31px;float:left;\">\n<a href=\"\/toolbar\/popup\/abuseReport\/?entryId=2409\" onclick=\"window.open(this.href, 'tistoryThisBlogPopup', 'width=550, height=510, toolbar=no, menubar=no, status=no, scrollbars=no'); return false;\"><br \/>\n<img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\uc2e0\uace0\" src=\"https:\/\/i0.wp.com\/t1.daumcdn.net\/tistory_admin\/static\/ico\/ico_spam_report.png\" style=\"border:0\"\/><br \/>\n<\/a>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\uc758\uc678\ub85c \ubcc4\ub85c \uc548 \uc5b4\ub824\uc6cc\uc11c. \uc0ac\uce59\uc5f0\uc0b0, \uc870\uac74\ubb38, \ubc18\ubcf5\ubb38, \ucd9c\ub825, \ud568\uc218\uc0ac\uc6a9, \ubaa8\ub4c8\uc0ac\uc6a9\uae4c\uc9c0 \ud558\ub8e8\ub9cc\uc5d0 \ub2e4 \ub05d\ub0c8\ub2e4. \uc774\uc81c GUI\ub9cc \ubc30\uc6b0\uba74 \ub05d. # # Numerical 2D Gaussian Function generator # Copyright : KeeHwan Nam, 2011, # Advanced Photonics Research Institute, Gwang-ju Institute of Science and Technology # # E-mail : snowall@gmail.com # # Please send me what you found bugs. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[12],"tags":[],"class_list":["post-9579","post","type-post","status-publish","format-standard","hentry","category-12"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8o6gA-2uv","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts\/9579","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9579"}],"version-history":[{"count":0,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts\/9579\/revisions"}],"wp:attachment":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9579"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}