Monthly Archives: September 2014

关于twentytwelve主题中使用google字体的问题

经Bruno网友的提醒,原来国内禁止访问google字体,我使用的主题twentytwelve默认是使用了google的open sans开源字体。

因为google字体的存在,博客网页在显示前试图访问googleapis.com网站,会延迟很长时间。怪不得此前有朋友反映很慢,我还以为是电信网访问科技网速度慢的问题(当然这也是慢的另一个原因)。

Bruno有相关的插件可以考虑,如这个地址:http://www.brunoxu.com/wordpress-google-fonts-plugin-removal-remove-google-fonts-references.html,可以很好处理各处使用google字体的情况。但也许有性能下降的担忧,同时过滤掉了google字体,默认采用的字体也许不是想要的。

我使用了Bruno的Useso take over Google插件,使用奇虎360缓存的google字体。该插件可以从wordpress.org的插件库里找到。作者主页地址是http://www.brunoxu.com/useso-take-over-google.html

Matlab科学数据处理:如何补上缺失的时间序列

Matlab科学数据处理:如何补上缺失的时间序列

Zhuotong Nan (南卓铜, [email protected])

问题提出

假设我们有一个时间序列文件,内容如下

286880 19480223 -5.7

286880 19480227 10.8

286880 19480229 7.7

286880 19480301 -15.7

286880 19480302 3.2

286880 19480303 7.7

286880 19480305 21.2

第一列是站点名,第二列是时间信息,第三列是温度值。时间并不连接,我们经常需要把时间补全,这些时间上的观测以缺失值(比如999.9)替代。即,我们希望是,

286880 19480223 -5.7

286880 19480224 999.9

286880 19480225 999.9

286880 19480226 999.9

286880 19480227 10.8

286880 19480228 999.9

286880 19480229 7.7

286880 19480301 -15.7

286880 19480302 3.2

286880 19480303 7.7

286880 19480304 999.9

286880 19480305 21.2

那么在matlab里要如何实现呢。

基本思路 Continue reading

将Global AVHRR NDVI 3g转换为ESRI ASCII Grid栅格的Matlab代码

我在前面的帖子(previous post)介绍了用ArcGIS读取GIMMS AVHRR NDVI 3g格式的数据文件的方法,但并不十分好用。所以写了一点代码,用于方便的将之转换为ESRI ASCII Grid栅格,后者可以很容易的被GIS软件支持。

从这个帖子可以下载到相关的代码和样例ndvi3g数据。

注意运行代码需要 Matlab的支持。

Purpose: Convert GIMMS Global AVHRR NDVI 3g files to ESRI ASCII Grid, which is very easy to be accessed with popular GIS software.
Author: Zhuotong Nan ([email protected])
Web: http://nanzt.info
Date: Sep 11,2014

Last update: Nov 3,2014

Please distribute codes with this header attached.

Usage:

type convert_ndvi3g_ascii in Matlab to run

Open convert_ndvi3g_ascii.m, modify the ndvi3gfl variable to make it point to the ndvi 3g file you wanto to convert.

After run, three grid files will be created. One is the grid
corresponding to the 3g data file, the other is the ndvi grid extracted from the 3g data file, and the last one is its associated flag grid.

Files included with this code:

  • convert_ndvi3g_ascii.m, the main matlab script
  • geo82dec15a.n07-VI3g, example avhrr ndvi 3g file
  • geo82dec15a.n07-VI3g.asc, ascii grid file corresponding to geo82dec15a.n07-VI3g
  • geo82dec15a.n07-VI3g.ndvi.asc, ascii grid file of the extracted ndvi
  • geo82dec15a.n07-VI3g.flag.asc, grid file of associated flags
  • header.txt, esri grid header information, used in code
  • Readme.txt, this file.

The meaning of the FLAG:
FLAG = 7 (missing data)
FLAG = 6 (NDVI retrieved from average seasonal profile, possibly snow)
FLAG = 5 (NDVI retrieved from average seasonal profile)
FLAG = 4 (NDVI retrieved from spline interpolation, possibly snow)
FLAG = 3 (NDVI retrieved from spline interpolation)
FLAG = 2 (Good value)
FLAG = 1 (Good value)

Nov 3, 2014
Fix bugs that wrongly computing ndvi.asc and flag.asc

Sep 11, 2014
Initial version

Download codes (9,875KB); Link2 (Baidu)

78ae077b84d7455913382971da7731ef  soft.ndvi3g.11032014.zip

Download codes (6,483KB)

MD5:  006d2d630a5c94f3ca629fc9f751d7f1  soft.ndvi3g.zip

自己或他人衣服着火如何自救或救人?–stop, drop and roll

温州两大学生在烧烤店就餐,因服务员不慎女学生不幸被大火烧着重伤。太悲惨的事了,花季姑娘就这样被无知的服务员毁掉了。那么如何自救或救人。

Image美国学校教导小朋友关于着火自救,叫stop, drop and roll。我们大家也应该学会,并且教导给自己的小朋友们。

第一步:stop。停下来,不要乱动或跑动,任何动作会使得火更大。保持镇静(实际上可能没有专门训练是很难做到的)。

第二步:drop。马上倒在地上,用手把自己的脸掩住,保护脸不被烧伤。

第三步:roll。在地上滚动。滚动可以把大量的火熄灭。如果附近有毯子,往毯子方向滚,毯子可以帮助灭火。

作为边上的人,除了大声求救外,应该大声喊叫,让着火人马上做stop, drop, roll的动作(着火人慌张之下往往忘记)。然后使用毛毯、自己的衣服(不能是尼龙等容易着火的衣服)在着火人滚动的过程中帮助熄火。呼喊其他人找水。如果附近有灭火器,可以结合使用。

等火灭后,不要喂水,因为这时着火人喉咙往往是肿的;不要试图脱着火人受伤的衣服,这时衣服往往已经融进皮肤。安慰着火人,等待救援。

英文许可的朋友请移步阅读美国防火协会的这个小朋友训练材料

http://www.nfpa.org/~/media/Files/Safety%20information/Public%20educators/Education%20programs/learn%20not%20to%20burn/Level%201/lntblevel1stopdroproll.pdf

家长应该多次训练自己的小孩子stop, drop and roll的自救手段。家长可以与小孩子一起做这个练习。

* 本文材料参考英文wikipedia,美国国家防火协会等材料。

移掉一个目录的版本控制

在桌面上checkout了一个svn文件,然后桌面被TotoiseSVN加上了版本控制。要想把一个目录的版本控制移掉,可以这样做:

1. 此目录中右键,从TotoiseSVN菜单里选取export。

2. export时选取此目录本身,如桌面。

这时会提示:

Image

选取第一个。

3. 搞定。