{"id":316,"date":"2016-02-27T00:13:37","date_gmt":"2016-02-26T16:13:37","guid":{"rendered":"http:\/\/goyuwei.com\/blog\/?p=316"},"modified":"2016-02-27T00:13:37","modified_gmt":"2016-02-26T16:13:37","slug":"27022016-tips-of-using-web-based-meteorological-forecast-api-%e6%99%b4%e5%a4%a9%e9%92%9fapi%e4%bd%bf%e7%94%a8%e5%a4%87%e5%bf%98","status":"publish","type":"post","link":"http:\/\/goyuwei.com\/blog\/?p=316","title":{"rendered":"27\/02\/2016 \u2013 Tips of Using Web-Based Meteorological Forecast API\u2013 \u6674\u5929\u949fAPI\u4f7f\u7528\u5907\u5fd8"},"content":{"rendered":"<p>(English version follows Chinese Part)<\/p>\n<p>\u6700\u8fd1\u6bd4\u8f83\u5fd9\uff0c\u53c8\u6709\u633a\u4e45\u6ca1\u66f4\u65b0\u65e5\u5fd7\u4e86\uff0c\u8d81\u7a0d\u7a0d\u6709\u7a7a\u8d76\u7d27\u5199\u4e00\u7bc7\u3002<\/p>\n<p>Lots of works recently and less update of the log. One post must be done today when I had a break.<\/p>\n<p>\u6211\u5728\u4e4b\u524d\u7684Lab\u5efa\u8bbe\u65e5\u5fd7\u91cc\u63d0\u5230\u8fc7\u5929\u6587\u677f\u5757\u7b2c\u4e00\u4e2a\u5de5\u7a0b\u662f\u5f15\u7528\u6674\u5929\u949f\u7684API\uff0c\u6240\u4ee5\u6211\u7814\u7a76\u4e86\u4e00\u4e0b\u57fa\u672c\u7684\u642d\u5efa\u6b65\u9aa4\u3002<\/p>\n<p>I have mention about the 1st Project of Astronomy Part in my Lab in past lab log, which is a \u00a0web-based meteorological forecast. So I did some preview for building the page.<\/p>\n<p>\u6674\u5929\u949f\u7684\u5de5\u4f5c\u539f\u7406\u662f\u901a\u8fc7\u68c0\u7d22\u6216\u8bc6\u522bIP\u7684\u65b9\u5f0f\uff0c\u53d6\u5f97\u4e00\u4e2a\u5730\u7406\u5750\u6807\uff0c\u7136\u540e\u6839\u636e\u5750\u6807\u70b9\u68c0\u7d22\u7f8e\u56fd\u56fd\u5bb6\u5927\u6c14\u6d77\u6d0b\u5c40\/\u6c14\u5019\u73af\u5883\u9884\u6d4b\u5c40(NOAA\/NCEP)\u201c\u5168\u7403\u9884\u6d4b\u7cfb\u7edf\u201d(Global Forecast System, GFS)\u7684\u5929\u6c14\u6570\u636e\uff0c\u7136\u540e\u901a\u8fc7\u751f\u6210\u6570\u636e\u56fe\u8868\u7684\u5f62\u5f0f\uff0c\u63d0\u4f9b\u5929\u6c14\u9884\u62a5\u3002<\/p>\n<p>How<i> 7Timer! \u00a0<\/i>works? By searching a location or notifying IP add, coordinate is recognized and used to pick up weather data from\u00a0the NOAA\/NCEP-based numeric weather model, the Global Forecast System (GFS). A chart\/graph would be generated and post on the web page, which is the\u00a0meteorological forecast.<\/p>\n<p>\u6839\u636e\u6674\u5929\u949fAPI\u7684\u4ecb\u7ecd\uff0c\u901a\u8fc7\u63d0\u4ea4\uff1a<\/p>\n<p>According to the introduction of\u00a0<i>7Timer!&#8217;<\/i>s API, these data should be\u00a0submited<\/p>\n<blockquote><p>lon, lat \u2013 \u6307\u5b9a\u5730\u70b9\u7684\u7ecf\u7eac\u5ea6\uff0c\u5fc5\u987b\u662f\u6d6e\u70b9\u6570\uff0c\u6bd4\u5982+23.090\u6216-23.090\uff0c\u7cbe\u786e\u52300.001\u5ea6\u5373\u53ef\u3002<br \/>\nac \u2013 \u9ad8\u5ea6\u6539\u6b63\uff0c\u53ea\u5bf9\u5929\u6587\u7528\u9014\u4ea7\u54c1\u6709\u6548\u3002\u53ef\u53d60\uff08\u9ed8\u8ba4\uff09\u30012\u62167\u3002<br \/>\nlang \u2013 \u8bed\u8a00\u3002\u5bf9\u6c14\u8c61\u7528\u9014\u4ea7\u54c1\u65e0\u6548\u3002<br \/>\nunit \u2013 \u516c\u5236\u6216\u82f1\u5236\u3002<br \/>\noutput \u2013 \u53ef\u8bbe\u5b9a\u4e3ainternal\uff08\u56fe\u8868\u8f93\u51fa\uff09\u3001xml\u6216json\u3002<br \/>\ntzshift \u2013 \u65f6\u533a\u5fae\u8c03\uff0c\u53ef\u53d60\u30011\u6216-1\u3002<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<blockquote><p>lon, lat \u2013 Geographic coordinates of the specified site, must be given as pure float numbers, such as +23.090 or -23.090. At this stage, the precision of any incoming coordinate float number is expected to be 0.001. Incoming float with higher precision will be rounded.<br \/>\nac \u2013 Altitude Correction, only applicable in ASTRO forecast. Should be 0 (default), 2 or 7.<br \/>\nlang \u2013 Language. Not applicable in METEO product.<br \/>\nunit \u2013 Metric or British.<br \/>\noutput \u2013 should be internal (for graphical output), xml or json.<br \/>\ntzshift \u2013 Adjustment of timezone, should be 0, 1 or -1.<\/p><\/blockquote>\n<p>\u7684\u53d8\u91cf\u8c03\u7528API\uff0c\u8fd4\u56de\u4e00\u4e2a\u751f\u6210\u7684\u6570\u636e\u56fe\u8868\uff0c\u4ea6\u5373\u5929\u6c14\u9884\u62a5\u3002<\/p>\n<p>to the API and the report graph will be processed.<\/p>\n<p>\u5982\u679c\u8981\u5728GoYuWei\u7684Lab\u91cc\u5b9e\u73b0\u8fd9\u4e00\u5de5\u4f5c\uff0c\u5c31\u9700\u8981\uff1a<\/p>\n<p>If I wish to run a graph forecast in my lab, things must be done:<\/p>\n<ol>\n<li>\u7533\u8bf7\u4e00\u4e2aGoogle\u6216\u8005\u767e\u5ea6\u7684\u5730\u7406\u5750\u6807API\uff0c\u7f16\u5199\u4e00\u4e2a\u51fd\u6570\uff0c\u8bc6\u522b\u8bbf\u95ee\u8005\u7684IP\u5e76\u8f6c\u6362\u6210\u5730\u7406\u5750\u6807\uff0c\u5e76\u8f93\u5165\u7ecf\u7eac\u5ea6\u53d8\u91cf\u3002<\/li>\n<li>\u5c06\u53d8\u91cf\u63d0\u4ea4\u81f3\u6674\u5929\u949f\u7684API\u63a5\u53e3\uff0c\u8fd4\u56de\u4e00\u4e2a\u6216\u591a\u4e2a\u5929\u6c14\u9884\u62a5\u56fe\u6807\u3002<\/li>\n<li>\u663e\u793a\u5728\u4e00\u4e2a\u5c3d\u53ef\u80fd\u7f8e\u89c2\u7684\u7f51\u9875\u4e0a\u3002<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li>Apply for geography API of Google.com or Baidu.com, write down a\u00a0function to recognize IP add of visitors and transform into coordinates.<\/li>\n<li>submit \u00a0those data to the\u00a0<i>7Timer!&#8217;<\/i>s API, then return the graphs.<\/li>\n<li>Build a well look web page with the forecast graphs.<\/li>\n<\/ol>\n<hr \/>\n<p>\u5173\u4e8e\u6674\u5929\u949f\uff0c\u8bf7\u8bbf\u95ee<a href=\"http:\/\/202.127.24.18\/about.php?lang=zh-CN\" target=\"_blank\">http:\/\/202.127.24.18\/about.php?lang=zh-CN<\/a><\/p>\n<p>About\u00a0<i>7Timer!\u00a0<\/i>Web-Based Meteorological Forecast , visit\u00a0<a href=\"http:\/\/202.127.24.18\/about.php?lang=en\" target=\"_blank\">http:\/\/202.127.24.18\/about.php?lang=en<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>(English version follows Chinese Part) \u6700\u8fd1\u6bd4\u8f83\u5fd9\uff0c\u53c8\u6709\u633a\u4e45\u6ca1\u66f4\u65b0\u65e5\u5fd7\u4e86 &hellip; <a href=\"http:\/\/goyuwei.com\/blog\/?p=316\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">27\/02\/2016 \u2013 Tips of Using Web-Based Meteorological Forecast API\u2013 \u6674\u5929\u949fAPI\u4f7f\u7528\u5907\u5fd8<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"aside","meta":{"footnotes":""},"categories":[20,21,3],"tags":[],"class_list":["post-316","post","type-post","status-publish","format-aside","hentry","category-astronomy-","category-lab-log-","category-site-construction-","post_format-post-format-aside"],"_links":{"self":[{"href":"http:\/\/goyuwei.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/316","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/goyuwei.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/goyuwei.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/goyuwei.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/goyuwei.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=316"}],"version-history":[{"count":0,"href":"http:\/\/goyuwei.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/316\/revisions"}],"wp:attachment":[{"href":"http:\/\/goyuwei.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/goyuwei.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=316"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/goyuwei.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}