(English version follows Chinese Part)
最近比较忙,又有挺久没更新日志了,趁稍稍有空赶紧写一篇。
Lots of works recently and less update of the log. One post must be done today when I had a break.
我在之前的Lab建设日志里提到过天文板块第一个工程是引用晴天钟的API,所以我研究了一下基本的搭建步骤。
I have mention about the 1st Project of Astronomy Part in my Lab in past lab log, which is a web-based meteorological forecast. So I did some preview for building the page.
晴天钟的工作原理是通过检索或识别IP的方式,取得一个地理坐标,然后根据坐标点检索美国国家大气海洋局/气候环境预测局(NOAA/NCEP)“全球预测系统”(Global Forecast System, GFS)的天气数据,然后通过生成数据图表的形式,提供天气预报。
How 7Timer! works? By searching a location or notifying IP add, coordinate is recognized and used to pick up weather data from the 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 meteorological forecast.
根据晴天钟API的介绍,通过提交:
According to the introduction of 7Timer!’s API, these data should be submited
lon, lat – 指定地点的经纬度,必须是浮点数,比如+23.090或-23.090,精确到0.001度即可。
ac – 高度改正,只对天文用途产品有效。可取0(默认)、2或7。
lang – 语言。对气象用途产品无效。
unit – 公制或英制。
output – 可设定为internal(图表输出)、xml或json。
tzshift – 时区微调,可取0、1或-1。
lon, lat – 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.
ac – Altitude Correction, only applicable in ASTRO forecast. Should be 0 (default), 2 or 7.
lang – Language. Not applicable in METEO product.
unit – Metric or British.
output – should be internal (for graphical output), xml or json.
tzshift – Adjustment of timezone, should be 0, 1 or -1.
的变量调用API,返回一个生成的数据图表,亦即天气预报。
to the API and the report graph will be processed.
如果要在GoYuWei的Lab里实现这一工作,就需要:
If I wish to run a graph forecast in my lab, things must be done:
- 申请一个Google或者百度的地理坐标API,编写一个函数,识别访问者的IP并转换成地理坐标,并输入经纬度变量。
- 将变量提交至晴天钟的API接口,返回一个或多个天气预报图标。
- 显示在一个尽可能美观的网页上。
- Apply for geography API of Google.com or Baidu.com, write down a function to recognize IP add of visitors and transform into coordinates.
- submit those data to the 7Timer!’s API, then return the graphs.
- Build a well look web page with the forecast graphs.
关于晴天钟,请访问http://202.127.24.18/about.php?lang=zh-CN
About 7Timer! Web-Based Meteorological Forecast , visit http://202.127.24.18/about.php?lang=en