在国外新购置了一台PC,性能比从国内带来的Mac笔记本要好,也可以继续玩Steam上的游戏。决定将个人学习工作环境迁移至Windows系统。在此记录相关配置步骤,以便未来之需。

Read More

Xarray provides pandas-level convenience for working with ultidimensional data. Xarray has two fundamental data structure: a DataArray, which holds a single multi-dimensional variable and its coordinates;
a Dataset, which holds multiple variables that potentially share the same coordinates.

Moreover, a DataArray has four attributes:

  • values: a numpy.ndarray holding the array’s values (矩阵数值,例如地表温度具体数值)
  • dims: dimension names for each axis (e.g., (‘x’, ‘y’, ‘z’)) (维度名称,如经度、纬度、垂直分层、时间等)
  • coords: a dict-like container of arrays (coordinates) that label each * point (e.g., 1-dimensional arrays of numbers, datetime objects or strings) (各维度坐标体系,如时间序列)
  • attrs: an OrderedDict to hold arbitrary metadata (attributes) (对各属性的描述)

Read More

提要:Altair是强大的可视化库,其基于Vega-lite,可快速生成简洁、美观、可互动的统计图形。本文介绍个人相关学习经历,具体包括:(1)数据载入与基本图形绘制; (2)基于web端呈现

Read More

部分互联网资料仅提供在线预览,无法直接下载。若预览系统设计欠佳,或限于网速内容加载过慢,都会对阅读体验造成严重影响。在此分别以国家自然基金研究报告和学位论文为例,介绍两种不同的下载合成方法,供有需要的老师同学们参考。欢迎大家提出宝贵意见。

Read More

In this post, I address an common problem in geoscience research: how to arrange the original geodata into pre-defined grid system. Sometimes, we need to unify the resolution of various dataset or summary the scatter data to raster one.

Specifically, this brief tutorial will look at two different original data, and allow you to creat gridded data in python. For better illustration, two practial cases with detailed code are shown:

  • Creating an emission inventory based on the emissions from point sources (e.g., power plants, cement plants)
  • Remapping a population density map to a coarser resolution

Read More

When you’ve got the all the files from WRF simulations, you might want to merge them without the spin-up frames (to reach a balanced state with the boundary conditions, i.e., 12 hours for a 5-day simulation). Meanwhile, the variables/grids which are not focused on can be ignore. Therefore, a general workflow in pythonic way is presented. I will also rewritten this function as my first Python Package. Please note the updates on my website.

Read More

有时,我们无法直接获取某些地理数据的精确位置信息,仅能从网络中下载他人的地图作品。因而,我请教了一名规划师同学,参考网络图像,通过适配地理范围,手工获取其实际地理属性。本文以我国集中采暖南北分界线的绘制为例,简述QGIS软件的具体实现步骤。

Read More

Sometimes, we need to clip or extract the raster image with polygon features, e.g., only focus on the percipitation within China using global dataset. This post will introduce two methods to mask the 2-d array-like dataset by a specific geometry using Python.

  • The first method use GeoPandas module to test those raster coordidnates within/out of the shapefile
  • The second method which I strongly recommended with faster speed was based on shapely module.

Read More

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×