{"id":184,"date":"2023-07-18T03:14:35","date_gmt":"2023-07-18T03:14:35","guid":{"rendered":"https:\/\/yamaura-group.issp.u-tokyo.ac.jp\/?p=184"},"modified":"2023-07-31T03:16:40","modified_gmt":"2023-07-31T03:16:40","slug":"f2plus-to-shelx","status":"publish","type":"post","link":"https:\/\/yamaura-group.issp.u-tokyo.ac.jp\/index.php\/2023\/07\/18\/f2plus-to-shelx\/","title":{"rendered":"f2plus\u304b\u3089Shelx\u5f62\u5f0f\u3078\u306e\u5909\u63db"},"content":{"rendered":"\n<p>PF\u306eBL8A\/8B\u306a\u3069\u3067\u306f\u3001imaging plate\u578b\u56de\u6298\u8a08\u304c\u672a\u3060\u73fe\u5f79\u3067\u3059\u3002\u3053\u308c\u3089\u306fshelx\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u3092\u51fa\u529b\u3057\u306a\u3044\u306e\u3067olex2\u3084winGX\u3067\u306e\u69cb\u9020\u89e3\u6790\u306b\u306f\u5909\u63db\u304c\u5fc5\u8981\u306a\u306e\u3067\u3001\u305d\u306e\u305f\u3081\u306e\u7c21\u5358\u306a\u30b3\u30fc\u30c9\u304c\u4ee5\u4e0b\u3067\u3059\u3002Dataframe\u5f62\u5f0f\u3066\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u8a66\u307f\u307e\u3057\u305f\u304c\u3001\u914d\u5217\u306f\u3067\u304d\u3066\u3082(3I4, 2F8.2)\u5f62\u5f0f\u3067\u306e\u66f8\u304d\u8fbc\u307f\u304c\u3046\u307e\u304f\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u306e\u3067\u3001\u6ce3\u304f\u6ce3\u304ffor\u30eb\u30fc\u30d7\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u70b9\u3082\u542b\u3081\u3066\u3042\u308a\u5408\u308f\u305b\u306a\u306e\u3067\u3001\u3054\u627f\u77e5\u304a\u304d\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code># -*- coding: utf-8 -*-\n#!\/usr\/bin\/env python3\n#RAPID data exhanger: f2plus.dat to Shelx.hkl\n#PF\u306eBL8A\/8B\u3067imaging plate\u578b\u56de\u6298\u8a08\u3092\u7528\u3044\u3066\u69cb\u9020\u89e3\u6790\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u305f\u5834\u5408\n#shelx\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u3092\u51fa\u529b\u3057\u306a\u3044\u306e\u3067olex2\u3084winGX\u3067\u306e\u69cb\u9020\u89e3\u6790\u306b\u306f\u5909\u63db\u304c\u5fc5\u8981\u3067\u3059\n#(crystal structure, yadokari\u7b49\u3067\u306e\u89e3\u6790\u306b\u306f\u305d\u306e\u307e\u307ef2plus.dat\u304c\u4f7f\u3048\u308b)\n#f2plus.dat\u306f\u3001h k l F2 F2sigma F2Raw Absorption flag \u306e\u30ab\u30e9\u30e0\u5f62\u5f0f\u306b\u306a\u3063\u3066\u304a\u308a\n#F2\u306fLP\u88dc\u6b63\u6e08\u307f\u3001\u5438\u53ce\u7121\u3057\u3001\u672a\u5e73\u5747\u306e\u7a4d\u5206\u5f37\u5ea6\u3067\u3001\u3053\u308c\u306bAbsorption\u3067\u5272\u3063\u305fshelx\u5f62\u5f0f(3I4,2F8.2,I4)\u306e\u30c7\u30fc\u30bf\u306b\u5909\u63db\u3057\u307e\u3059\n#denominator\u306e\u6841\u6570\u306f\u3001\u30c7\u30fc\u30bf\u306b\u5fdc\u3058\u3066\u5b9f\u6570\u90e8\u5206\u304c6\u6841\u3092\u8d85\u3048\u306a\u3044F2\u5024\u306b\u306a\u308b\u3088\u3046\u5909\u66f4\u3057\u3066\u4e0b\u3055\u3044\n#\u5e73\u5747\u5316\u306f\u305d\u308c\u305e\u308c\u304c\u4f7f\u7528\u306e\u89e3\u6790\u30bd\u30d5\u30c8\u4e0a\u3067\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002textfile\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u5fc5\u8981\u3067\u3059\n#pip install textfile (\u81ea\u5206\u306fanaconda\u3067\u3059\u304c\u7af6\u5408\u306f\u306a\u3055\u305d\u3046\u306a\u306e\u3067pip\u3067\u5165\u308c\u307e\u3057\u305f)\u7b49\u3067\u3069\u3046\u305e\nimport textfile\n\n#filenames\nrname = &#39;f2plus.dat&#39;\nwname = &#39;shelx.hkl&#39;\ndenominator = 100\n\narr = &quot;&quot;\nalllines = &quot;&quot;\ncount = 0\nwith open(rname, &#39;r&#39;) as f:\n    for line in f:\n        df = line.split()\n        h = df[0]\n        k = df[1]\n        l = df[2]\n        f2 = float(df[3])\/float(df[6])\/denominator\n        sf2 = float(df[4])\/float(df[6])\/denominator\n        arr = f&#39;{h:&gt;4s}&#39; + f&#39;{k:&gt;4s}&#39; + f&#39;{l:&gt;4s}&#39; + f&#39;{f2:&gt;8.2f}&#39; + f&#39;{sf2:&gt;8.2f}&#39;\n        alllines = alllines + arr + &#39;\\n&#39;\n        count += 1\n\nwith open(wname, mode=&#39;w&#39;) as f:\n    f.write(alllines)\n\ntextfile.insert(wname, &#39;   0   0   0     0.0     0.0\\n&#39;, line=count)\n<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>PF\u306eBL8A\/8B\u306a\u3069\u3067\u306f\u3001imaging plate\u578b\u56de\u6298\u8a08\u304c\u672a\u3060\u73fe\u5f79\u3067\u3059\u3002\u3053\u308c\u3089\u306fshelx\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u3092\u51fa\u529b\u3057\u306a\u3044\u306e\u3067olex2\u3084winGX\u3067\u306e\u69cb\u9020\u89e3\u6790\u306b\u306f\u5909\u63db\u304c\u5fc5\u8981\u306a\u306e\u3067\u3001\u305d\u306e\u305f\u3081\u306e\u7c21\u5358\u306a\u30b3\u30fc\u30c9\u304c\u4ee5\u4e0b\u3067\u3059\u3002Dataframe\u5f62\u5f0f\u3066\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u8a66\u307f\u307e\u3057\u305f\u304c\u3001\u914d\u5217\u306f\u3067\u304d\u3066\u3082(3I4, 2F8.2)\u5f62\u5f0f\u3067\u306e\u66f8\u304d\u8fbc\u307f\u304c\u3046\u307e\u304f\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u306e\u3067\u3001\u6ce3\u304f\u6ce3\u304ffor\u30eb\u30fc\u30d7\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u70b9\u3082\u542b\u3081\u3066\u3042\u308a\u5408\u308f\u305b\u306a\u306e\u3067\u3001\u3054\u627f\u77e5\u304a\u304d\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-184","post","type-post","status-publish","format-standard","hentry","category-d2mate"],"_links":{"self":[{"href":"https:\/\/yamaura-group.issp.u-tokyo.ac.jp\/index.php\/wp-json\/wp\/v2\/posts\/184"}],"collection":[{"href":"https:\/\/yamaura-group.issp.u-tokyo.ac.jp\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yamaura-group.issp.u-tokyo.ac.jp\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yamaura-group.issp.u-tokyo.ac.jp\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yamaura-group.issp.u-tokyo.ac.jp\/index.php\/wp-json\/wp\/v2\/comments?post=184"}],"version-history":[{"count":2,"href":"https:\/\/yamaura-group.issp.u-tokyo.ac.jp\/index.php\/wp-json\/wp\/v2\/posts\/184\/revisions"}],"predecessor-version":[{"id":186,"href":"https:\/\/yamaura-group.issp.u-tokyo.ac.jp\/index.php\/wp-json\/wp\/v2\/posts\/184\/revisions\/186"}],"wp:attachment":[{"href":"https:\/\/yamaura-group.issp.u-tokyo.ac.jp\/index.php\/wp-json\/wp\/v2\/media?parent=184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yamaura-group.issp.u-tokyo.ac.jp\/index.php\/wp-json\/wp\/v2\/categories?post=184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yamaura-group.issp.u-tokyo.ac.jp\/index.php\/wp-json\/wp\/v2\/tags?post=184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}