利用geopandas地图白化
前言
偶然间看到摸鱼咯大佬在和鲸社区发的帖子 geopandas白化,利用了geopandas对等值线进行白化。以往我是用气象家园中的maskout.py函数进行白化的。但使用maskout.py需要结合meteoinfo对地图文件进行查看,相对来说还是比较麻烦的。在这里就记录一下使用geopandas的方法。
以下用的数据存放在网盘中
百度网盘:j4d3
代码示例
12345678910111213141516import proplot as ppltimport xarray as xrimport pandas as pdimport numpy as npdata = xr.open_dataset('D:/data_english/era5/slp.sst.pre.1979-2020mon.global.nc')# 海平面气压距平slp = data['msl'][:,0,...].sel(latitude=slice(None,None,4), longitude=slice(None,None,4))lon, lat = np. ...
Proplot相关说明及示例
前言
今天发现一个python模块包: Proplot 。
ProPlot 文档
Proplot_github
它整合封装了matplotlib,cartopy,basemap。将画图命令精简整合,图窗和轴的排列更加智能整齐,可以说解决了我的很多痛点。但proplot的文档中给出的例子太少,我打算自己做一些例子,帮助自己学会proplot。
fig和ax的创建
fig,ax参数列表
Fig-Subplots
nrows: int; 子图行数
ncols: int;子图列数
space/wspace/hspace: float, str, None, turple;子图间距
refwidth: float; 子图宽度
refheight: float;子图高度
refaspect: float; 长宽比,默认1
figsize: tuple; 图窗大小
figwidth: float, str; 图窗宽度
figheight: float, str; 图窗高度
bottom/right/left/top: float, str, None; 图窗边界宽度
grid/xgrid/yg ...
hexo相关命令以及本地文件备份
今天为了整博客的图库差点把博客源文件整没了。恢复以后,尝试了很久在github上备份本地博客文件。参考了以下文章:
博客备份与换设备
在这里顺便写点hexo相关命令,防止以后忘记了。
清除和再生成 (大概是这个意思吧)
1hexo clean && hexo g
部署至github
1hexo d
生成静态地址(本地)
1hexo s
新建文章
1hexo new post test
将静态文件推送到master分支
12hexo clean hexo d -g
将相关更改推送到hexo分支
123git add .git commit -m "发表文章test"git push origin hexo
我的第一篇文章!!!O(∩_∩)O哈哈~
第一篇文章!!!
这是第一篇文章,测试一下效果
本博客计划写一些气象方面的学习经验。如气象编程、学习笔记、文献回顾总结。
另外还有英语学习。如口语句式、学术论文写作笔记。
最后可能有一些日记性质的文章,记录自己五年读博生涯。
下面测试一下markdown
1. 首先是代码块
1234#%% 去趋势1979-2020,春、秋季位势高度temp = data2.sel(time=slice('1979','2020'))hgt500Spring1979_2020Detrend = temp.sel(time=temp['time.season']=='MAM').mean('time')hgt500Autumn1979_2020Detrend = temp.sel(time=temp['time.season']=='SON').mean('time')
2. 然后是图片
3. 试一下公式
$y={x^2}$
$y = {x^2} ...
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick Start
Create a new post
1$ hexo new "My New Post"
More info: Writing
Run server
1$ hexo server
More info: Server
Generate static files
1$ hexo generate
More info: Generating
Deploy to remote sites
1$ hexo deploy
More info: Deployment









