- 积分
- 22798
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-12-7
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 葫芦爷儿 于 2018-9-2 22:53 编辑
为了展示fvcom计算的潮位数据,用basemap来制作gif。做图思路:
读取nc数据 ->设置basemap底图 ->利用matplotlib的ArtistAnimation,循环每一时刻的数据(插值数据 ) -> 保存gif
用到这些东西的原因:
1 fvcom为非结构网格,于是利用matplotlib中的tri工具来插值到结构网格中
2 matplotlib 做动图有三种思路:
a) 是animation.ArtistAnimation, 将每一张图片生成,存入列表,然后制作动图
b) 是animation.FuncAnimation,创建函数,刷新数据,然后制作动图
c) 是控制屏幕刷新时间(不推荐)
注意 linux、mac下可以直接从conda中装imagemagick
windows要麻烦一些,但是可以通过ffmpe来实现.(下面有参考网址)
3 basemap设置
4 在集群下运行python需要
import matplotlib
matplotlib.use("agg")
下面参考到的网址- https://www.cnblogs.com/xionggeclub/p/6146484.html 集群中的字体问题
- https://blog.csdn.net/gdkyxy2013/article/details/79585922 linux下的问题
- https://matplotlib.org/gallery/color/colormap_reference.html colormap
- https://stackoverflow.com/questions/3279560/reverse-colormap-in-matplotlib 调换
- https://blog.csdn.net/weixin_41789707/article/details/81035997 不想显示坐标轴
- https://stackoverflow.com/questions/18363987/basemap-how-to-remove-actual-lat-lon-lines-while-keeping-the-ticks-on-the-axis 网格线
- https://stackoverflow.com/questions/14280312/world-map-without-rivers-with-matplotlib-basemap 去除湖泊
- https://blog.csdn.net/pianzang5201/article/details/76070268 加logo
- https://stackoverflow.com/questions/29548704/matplotlib-pyplot-logo-image-in-plot 加logo
- https://www.cnblogs.com/chuangshaogreat/p/7498016.html python format
- https://www.114la.com/other/rgb.htm Colormap 配色参考
- https://matplotlib.org/gallery/images_contours_and_fields/irregulardatagrid.html#sphx-glr-gallery-images-contours-and-fields-irregulardatagrid-py contour等值线参考
- http://www.pythonware.com/products/pil/ 这个只有python2.7的内容,建议不要用,
- https://www.bdmweather.com/2018/04/python-m-arcgisimage-basemap-options/ 设置一些高清陆地影像
- https://anaconda.org/conda-forge/ffmpeg windows下安装ffmpe
- https://stackoverflow.com/questions/41699931/how-to-install-imagemagick-with-anaconda-on-windows-64bits 保存动画为GIF和MP4
- https://blog.csdn.net/weixin_34613450/article/details/80678522 指定像素
- https://matplotlib.org/tutorials/intermediate/imshow_extent.html?highlight=extent 调整extent
- http://epanf.scsio.ac.cn/storm/storm.php 参考图片来源
|
评分
-
查看全部评分
|