搜索此博客
2008年4月15日星期二
2008年4月12日星期六
小功告成
在熬了两夜,整整两天连登陆学校邮箱都顾不上的不断 scripting 和 debug 之后,我总算完成了研究地区的一部分净初级生产力分布图。
Labels:
AVHRR,
Geography,
GRASS,
Happy Hacking,
remote sensing,
Work Log
2008年4月9日星期三
GRASS GIS 中的 r.mask 和 readRAST6
生成上篇记录里那种印花桌布的原因已经查明,修改后的脚本正在跑,应该最多只有些小问题了。
我早该想到的,就是我以为在 GRASS 中对图像进行 mask 操作以后,用
事实上
早上就写完了脚本,因为这个问题 debug 到半夜,当然主要还是对 R 不熟悉,其间也发现了一些脚本其他的问题。最近看一本国人写的 R 教材,有些我使用中知道的东西书上也没有提到。莫非 R 已经庞大到无法系统全面地描述其所有的功能了么?spgrass6 这个函数包的文档相当简陋,更让我有 R 的发展超过了文档编写的速度的感觉,这未必是件好事……
这个脚本总共要计算 540 * 7 个图像,等它算完估计天亮了……我先去见周公,明天看结果,如果图好看的话补贴图。
我早该想到的,就是我以为在 GRASS 中对图像进行 mask 操作以后,用
as.vector(data.frame(readRAST6())) 这样的操作得到的图像仍然是全幅的,缺少数值的地方用 NA 填充。事实上这个操作去掉了所有标记为 NA 的像素,留给我的只有少数几个像素而已。R 在这种情况下默认用重复较短的数组/矩阵来填充较长的,于是我就得到了漂亮的印花桌布-_-事实上
readRAST6() 本身返回的结果就是类似于 data frame 的结构,其中第一个变量是我们关心的属性,假设原来的栅格图像在 GRASS 中的名字叫 foo,导入 R 后的结构名称为 bar,则 bar 中这个变量的名字可以用 names(foo) 获得,可能是类似 "Xfoo" 这样的形式。在 R 下用 bar[["Xfoo"]] 这样的形式引用就可以了(bar$Xfoo 大概也行)。早上就写完了脚本,因为这个问题 debug 到半夜,当然主要还是对 R 不熟悉,其间也发现了一些脚本其他的问题。最近看一本国人写的 R 教材,有些我使用中知道的东西书上也没有提到。莫非 R 已经庞大到无法系统全面地描述其所有的功能了么?spgrass6 这个函数包的文档相当简陋,更让我有 R 的发展超过了文档编写的速度的感觉,这未必是件好事……
这个脚本总共要计算 540 * 7 个图像,等它算完估计天亮了……我先去见周公,明天看结果,如果图好看的话补贴图。
Labels:
GRASS,
programming,
R,
Work Log
Pattern by Error
用 bash 和 R 联合编了一个比较复杂的脚本,计算研究区域的 FAPAR (Fraction of Absorbed Photosynthetically Active Radiation)。但是在某一步出错了,产生了这样的东西……
2008年4月4日星期五
Loss of water system resilience
ScienceDaily has a story on possible "ecosystem flipping" in water systems. Traditionally water management focused on "blue water", which includes water bodies that are easy to perceive, such as rivers and lakes. It is argued that water managers have long ignored "green water", whose cycles are not readily observable yet are essential for the function of ecosystems. It is pointed out that
Modern agriculture and land-use practices may lead to major disruptions of the world's water flows, with potentially sudden and dire consequences for regions least able to cope with them[...]
Soil nutrient as a slow variable is being changed due to agriculture practices, and that may cause a sudden ecosystem flip when it reaches a threshold. Yet it is difficult to tell where the threshold is. The original article claims that the most vulnerable area may be poor dryland areas. Using the "ball in the bowl" analogy, one can say that the domain of attraction for the current system is small and shallow. Modern agriculture may have contributed to the situation. But would it be better if the old way of planting crops remains? Would it jeopardise other aspects of the system? The adoption of modern agriculture can be seen as a necessary step to take when the system transits from r to K phase in the adaptive cycle. The task now is to prevent the system from collapsing in the next phase.
To build the resilience, or to build the capacity of adaptation is probably the key. Both call for more flexible mechanisms. This would be difficult for a system in K phase. Some local measures are feasible, but the change of the whole system may depend on external aid. There are other systems yet at the dawn of r phase. Is it possible to focus the accumulation of capital on resilience in order to facilitate the transition and reconstruction in the Ω phase?
By the way, it seems there are too few influential people in the resilience study circle. Buzz Holling, Garry Peterson mentioned in the article, and Brian Walker, they are about all and share almost the same opinion. Perhaps we can say the resilience researchers as a community is not resilient due to lack of diversity.
Modern agriculture and land-use practices may lead to major disruptions of the world's water flows, with potentially sudden and dire consequences for regions least able to cope with them[...]
Soil nutrient as a slow variable is being changed due to agriculture practices, and that may cause a sudden ecosystem flip when it reaches a threshold. Yet it is difficult to tell where the threshold is. The original article claims that the most vulnerable area may be poor dryland areas. Using the "ball in the bowl" analogy, one can say that the domain of attraction for the current system is small and shallow. Modern agriculture may have contributed to the situation. But would it be better if the old way of planting crops remains? Would it jeopardise other aspects of the system? The adoption of modern agriculture can be seen as a necessary step to take when the system transits from r to K phase in the adaptive cycle. The task now is to prevent the system from collapsing in the next phase.
To build the resilience, or to build the capacity of adaptation is probably the key. Both call for more flexible mechanisms. This would be difficult for a system in K phase. Some local measures are feasible, but the change of the whole system may depend on external aid. There are other systems yet at the dawn of r phase. Is it possible to focus the accumulation of capital on resilience in order to facilitate the transition and reconstruction in the Ω phase?
By the way, it seems there are too few influential people in the resilience study circle. Buzz Holling, Garry Peterson mentioned in the article, and Brian Walker, they are about all and share almost the same opinion. Perhaps we can say the resilience researchers as a community is not resilient due to lack of diversity.
Labels:
Academic Thought,
Ecology,
environmental management,
resilience,
water
2008年4月3日星期四
又更换平台了
-_- MT 用起来感觉很好,不过改模板和找 plugin 实在有些痛苦。 所以我又换成 Wordpress 了……你们骂我吧…… MT 上的文章都在,不会删除。新的 blog 地址为
http://snakehsu.info/wordpress/
直接输入 snakehsu.info 或 blog.snakehsu.info 也可。
新的 feed 地址:
Yahoo! Pipes
需要其它功能的读者可访问该 pipe 页面并自行 clone、修改之,如订阅某些分类或评论的 RSS。操作方法请查看 Wordpress 文档和 Pipes 在线帮助。
在国外或轻功好的读者请使用
http://feeds.feedburner.com/SigmaCube
国内读者请使用豆瓣9点对付一下先。
2008年4月1日星期二
NewScientist: China's boom sparks mass species invasion
http://environment.newscientist.com/channel/earth/...-invasion.html
This problem is hardly new, I think. Although the author did mention that the rapidly increasing foreign trade ports and airports in China makes the control of imported horticulture products more difficult. Apparently, species emigration and immigration happens at the same time on both borders. This is a new challenge to biodiversity conservation, and perhaps a result of globalisation. The problem is as old as trade itself, but nowadays at a completely different scale. Impact can be limited, though, if both sides take actions.
This problem is hardly new, I think. Although the author did mention that the rapidly increasing foreign trade ports and airports in China makes the control of imported horticulture products more difficult. Apparently, species emigration and immigration happens at the same time on both borders. This is a new challenge to biodiversity conservation, and perhaps a result of globalisation. The problem is as old as trade itself, but nowadays at a completely different scale. Impact can be limited, though, if both sides take actions.
订阅:
博文 (Atom)