06/07/2016 – Cheers For Successful First Launch of CZ-7 Rocket – 祝贺长征七号首发成功

(English version follows Chinese Part)

科技的进步永远是人类发展的动力,长征系列运载火箭成功发射的喜悦值得我们与世界人民一同分享。除了能够观看有关太空的电影比如<星际穿越><星际迷航>一类的科幻电影,玩<群星><坎巴拉太空计划>这样的太空游戏,还能够生活在人类太空技术发展的现代,无疑是一件幸事。

Human progress powered by technology advancing, and it is worth to share the success and happiness of CZ-7 launching with people all over the world. Luckily born in the era, which I can not only watch science fiction movies like ‘Star Wars’, ‘Interstellar’, play games like ‘Stellaris’, ‘Kerbal Space Program’, but also I can enjoy the aero tech in real life. 

太空探索本身就是一种美学。当长征7号火箭从中国海南文昌的发射阵地腾空而起,

Space exploration itself, is a kind of aesthetics. It reminds me something when CZ-7 taking of,

2016-7-6-CZ7Launched (1)

(CZ-7 Launching Photo by Weibo.Com@goneless

让我想起地球另一端猎鹰9号从美国佛罗里达州卡角腾空而起的场面。

it must be the similar scene at the other place of the planet.

2016-7-6-CZ7Launched (2)

(Falcon 9 Launching Photo form SpaceX official website

正是人类在地球的各个角落里不断地发展太空技术,我们才有畅想未来星际旅行的机会。愿全世界的航空航天工作者都能取得成功!

Thanks to pioneers working at the corners around the Earth, we have our dreams to looking forward a chance to travel through the stars.

 

03/05/2016 – Astronomical Weather Forecast Ver2.0 – 天文天气预报2.0版

>Astronomical Weather Forecast Dev Log – 天文天气预报开发日志<


1.0版本由IP获取经纬度没多大问题,但是百度地图API只能提供东亚地区城市的经纬度信息,然而晴天钟可以提供全球绝大部分地区的预报信息,所以不太匹配。按照晴天钟介绍中,其本身所使用的经纬度信息主要取自谷歌和GeoIP。我决定将经纬度信息引擎换成GeoIP。

Version 1.0 worked well, but it can provide forecast of East Asian cities due to the Baidu Map API area limit. It was a little wasteful for 7Timer!’s global  forecast. Reading from 7Timer!’s introduction, coordinate resources what it is using are Google and GeoIP. I decided to changed into GeoIP as well.

调用方法也不复杂,就是需要前往MaxMind下载开源的全球城市地理信息包,然后上传到网站目录中进行调用。

It was not complicated, all I should do is downloading open source global cities geography data pack and uploading to my website directory.

具体调用语句比较简单

The data pack function is called by

[php]

$gi = geoip_open("GeoLiteCity.dat",GEOIP_STANDARD);
$record = geoip_record_by_addr($gi,$ip);

[/php]

其中的$ip即已经获取到的访问者IP地址。调用后,需要的地址、经纬度、时区等信息从$record中提取即可。

$ip is the IP address fetched from visitor. The address, coordinate and time zone information can be picked out after the function is called.

其他内容并没有什么修改。

The other parts of the forecast core code has not been changed.

不过为了符合GoYuwei.Com的『双语』特征,多弄了个英文版界面。不过由于并非专业,还只能是中、英双语分为两个页面,这也提供了契机,下次可以学习php的多语种页面实现方法。

Pages are in Chinese&English and GoYuwei.Com is called ‘bilingual website’. I created a English version of the forecast. However, they are in two page files. There will be chance I can learn more about PHP and present the bilingual page in one web file.

01/05/2016 – Astronomical Weather Forecast Dev Log – 天文天气预报开发日志

前期规划日志 Previous Development Plan :

10/02/2016  & 27/02/2016


后续开发日志 Development Update:

03/05/2016


>前往中文预报页面<     >Go to the English forecast page<


以下为主要开发内容 The following is the main content:

由于公差查询器核心已经比较稳定,剩下的主要工作就是利用零碎时间完成公差数据的输入,所以开始着手完成天文天气预报。在研究清楚晴天钟天气图表API的调用方法后,开始着手研究根据访问者IP获取经纬度信息的办法。与公差查询器一样,由于我建站的空间支持php语言,所以天气预报页面也使用php来编写。

The core of the tolerance checker has been stable, the rest work is typing the tolerance data which can be done in spare time. I can turn to develop the astronomical weather forecast now. It’s not time-consuming to understand how to use 7Timer!’s API, then the method of obtaining coordinate by visitors’IP address must be figured out. The same reason as the tolerance checker, I choose PHP to set up the page due to my website server’s PHP environment.

为了降低初期的学习难度和开发难度,当然也考虑到测试网络环境,地理信息(IP-经纬度转换和地图)的API选用了百度而没有选用谷歌。

For decreasing the study and develop difficulties, and considering about testing web environment, Baidu Map was selected as geography API instead of Google.

首先通过

First, by using

[php]

$_SERVER["REMOTE_ADDR"]

[/php]

来获得访问者IP地址(这也造成一个问题,获取的是设备接入网络服务商时的IP,造成移动设备通过蜂窝网络接入或透过VPN访问的用户提供的IP是不准确的,造成定位错误,不能实现“本地”天气预报)

to obtain visitor’s IP (There’s problem here. Wrong IP will be fetched if the visitor is using mobile devices through cellular network or visiting the web through VPN, because the code can read the Internet service providers’ IP only)

接着将IP提交给百度地理API(可免费申请有限次数的应用,调用方法请参照百度地图API的相关手册),获取json格式的地理信息,包括地址、经纬度等。

Then hand up the IP to Baidu Map API for returning geography data including address and coordinate in json format. Baidu Map API application can be applied for free.

解码返回的地理信息并提取经纬度信息,分别提交给晴天钟的API(调用方法参见晴天钟的手册)和百度地图API,获取天气预报图表和访问者位置地图。

Decode the json and pick out the coordinate, exchange the weather chart and map image by 7Timer!’s API and Baidu Map API.

再给页面稍微美化一下,成品如图1。

Beautify the page, it works! (As Fig.1)

20160501-weatherforecast

图.1(Fig.1)


最后,再次声明利用的资源并鸣谢:

预报图表来源: 晴天钟 – 地理信息引擎: MaxMind GeoIP & 百度地图

Resources used by weather forecast and  acknowledgements

– Weather Chart Resource: 7Timer!

– Geography Resource & API: MaxMind GeoIP & Baidu Map

 

27/02/2016 – Tips of Using Web-Based Meteorological Forecast API– 晴天钟API使用备忘

(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:

  1. 申请一个Google或者百度的地理坐标API,编写一个函数,识别访问者的IP并转换成地理坐标,并输入经纬度变量。
  2. 将变量提交至晴天钟的API接口,返回一个或多个天气预报图标。
  3. 显示在一个尽可能美观的网页上。

 

  1. Apply for geography API of Google.com or Baidu.com, write down a function to recognize IP add of visitors and transform into coordinates.
  2. submit  those data to the 7Timer!’s API, then return the graphs.
  3. 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

 

13/02/2016 – Cheers For Gravitational Waves Spotting – 祝贺发现引力波

(English version follows Chinese Part)

20160213-Gravitational Waves

工程学出身的我也必须为科学界的巨大成就——人类首次直接探测到引力波而庆贺。这是对爱因斯坦理论的又一次证明,更是人类在挑战自我认知和宇宙认知上的一大进步。至少,证明人类有足够的能力去制造自己需要的实验设备,比如此次发现的功臣——激光干涉引力波天文台 (LIGO),也是工程学界和实验物理学的骄傲!

更多关于此项研究的新闻,可以参考阅读<科学>杂志网站的新闻:链接

Although I am a student majoring in engineering, I must show my congratulation and respect to the huge success in field of science, gravitational waves have been spotted by human being for first time. It is a solid evidence for Einstein’s theory, and a big step of  self-cognition and universe-cognition for people on earth. At least, Laser Interferometer Gravitational-Wave Observatory (LIGO) proves that mankind has its power to build up what is needed for experiment. The academic circles of engineering and experimental physics are proud of it.

You may discover more information and news about this research on website of Science magazine by this Link.