爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 137187|回复: 67

[经验总结] “UVCDAT”此乃Python气象编程集大成者!

  [复制链接]

新浪微博达人勋

发表于 2016-10-19 21:06:27 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
本帖最后由 风往北吹 于 2016-10-20 20:51 编辑

镇图惊艳一下各位

multiplot.png

slice.png

test.png

代码量

屏幕快照 2016-10-19 21.04.19.png



1>刚开始的时候遇见“UVCDAT”,我是想哭的。因为,它确实很强大,几乎包含了气象常用的所有Python库。那时候,特别麻烦,无论是服务器还是自己的笔记本都是各种搞不定。与之相关的库看的眼花,出了错很难找到,折腾了好久好久,中间有大力出奇迹的时候,uvcdat的操作框可以弹出来,接着干啥啥出错。所以,最后放弃了。


感受下与之相关的库!!!

屏幕快照 2016-10-19 20.40.46.png 屏幕快照 2016-10-19 20.40.33.png 屏幕快照 2016-10-19 20.40.16.png



2>再后来我也对它再次动过心,然而还是不友善,我需要的其实也只是eofs2中的两个库(cdms2  / cdutil),可还是这能奢望。其实我默默的关注着UVCDAT,寄希望于他们的团队能够给力一些。结果你猜.......

屏幕快照 2016-10-19 20.49.40.png 屏幕快照 2016-10-19 20.49.50.png


3>心诚则灵,N多繁琐的步骤化为一句话,这个得益于conda的一键式解决方案。神马问题只要是预想得到的,没有搞不定的复杂N多库。

现在的指令:

UV-CDAT is installed via Anaconda
[size=18.018px]
1>conda create -n uvcdat -c uvcdat uvcdat hdf5=1.8.16 pyqt=4.11.3 jpeg=8
2>source activate uvcdat



以前必须条件和指令如下:


There are two ways to install UV-CDAT on your system; method 1 is to download a binary release of the application (available here), and method 2 is to do a full build from source. We strongly recommend the binary installation; it's a lot faster and easier to do, especially if you're not comfortable with the command line. It also requires a lot fewer pieces of software to be installed; almost everything gets bundled with the binary installation. This guide will walk you through installation on your system using both methods (binary and source).
System Requirements
First, let's start with the bare minimum you need to actually be able to install UV-CDAT.
Note: Fink/MacPort Fink/MacPort, while useful, confuse our build system. You should remove ALL reference to /sw and /opt/local from your environment. The safest way to proceed is to actually move /sw or/opt/local before building UVCDAT (sudo mv /sw /sw_back or sudo mv /opt/local /opt/local_back). Once you've finished installing, you can safely move the directories back.
Requirements for All Installations
  • OSX 10.9 or greater for Binary, OSX10.8.5 or greater for Source
  • Xquartz (2.7.8)
  • gfortran (4.6 < version < 5.0)
    • Mac gfortran
      • Change directory cd /
      • Run sudo tar xvf ~/Downloads/gfortran-4.9.2-Mac.tar.gz

  • Qt (4.8.x)

Requirements for Source InstallInstalling from Binary
  • Download the most recent release of UV-CDAT
  • Move the binary to /
    sudo mv UV-CDAT-2.4.1-Mac.tar.gz /
  • Change directory to /
    cd /
  • Extract the binary from the archive
    sudo tar xzf UV-CDAT-2.4.1-Mac.tar.gz
  • That's it! You're all done installing. Skip on down to Run UV-CDAT.
Installing from Source
  • Go to the directory you want to download UV-CDAT's source code to
    cd ~
  • Clone UV-CDAT
    git clone git://github.com/UV-CDAT/uvcdat
  • Create a build directory
    mkdir build-uvcdat
  • Change directory to the build directory
    cd build-uvcdat
  • Initialize the build scripts using CMake
    cmake ../uvcdat

    • To install to a specific location, you can use (e.g. /usr/local/uvcdat/2.4.1):
      cmake ../uvcdat -DCMAKE_INSTALL_PREFIX="/path/to/install/uvcdat"
    • Other build options are documented here
  • Run make
    make -j4
  • Once it finishes building, you're all done! UV-CDAT will be installed either in the build-uvcdat/install folder or at whatever path you provided in the -DCMAKE_INSTALL_PREFIX argument to cmake.
Run UVCDAT
  • Set up the UV-CDAT environment for your current shell session
    source /usr/local/uvcdat/2.4.1/bin/setup_runtime.sh (orsetup_runtime.csh, for cshell users)
  • Start UV-CDAT
    uvcdat



4>先分享一下自己的心得体会,Python的优雅之处不一一介绍。至于使用和如何搞定这种一键式安装(Linux、MacOS)大同小异。
Win暂时没有!

最后,对于想入门Python的建议关注:Anaconda、Atom/sublime text。能够让你的编程变为一种美的体验。

另外,UVCDAT的使用后续再跟进。~~~~~~~




评分

参与人数 3金钱 +57 贡献 +13 体力 +200 收起 理由
何永利 + 20 很给力!
mofangbao + 15 + 5
又是那隻貓 + 22 + 8 + 200

查看全部评分

本帖被以下淘专辑推荐:

密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2016-10-20 10:30:57 | 显示全部楼层
本帖最后由 风往北吹 于 2016-10-20 10:32 编辑

再补充几张样图和github上相关脚本地址。



https://github.com/UV-CDAT/UV-CDAT_scientific_examples/tree/master/scripts

BlueMarble_pr_jja_clim.png
Clim_JJA_precip_850uv_500gpha_global.png
eof_analysis_slp_np.png
eof_analysis_sst.png
example_850mb_rh_ts_gph_jja_clim.png







                               
登录/注册后可看大图
lee1043
Add example -- NAO, NH polar stereographic map

..
BlueMarble_huss_jja_clim.pyclean up
2 months ago
BlueMarble_huss_satellite_view.pyclean up
2 months ago
BlueMarble_pr_jja_clim.pyclean up
2 months ago
Clim_DJF_200mb_wnd_ts_gph.pyrename..
2 months ago
Clim_JJA_500mb_wnd_ts_gph.pyclean up
2 months ago
Clim_JJA_850mb_rh_ts_gph.pyclean up
2 months ago
Clim_JJA_precip.pyrename..
2 months ago
Clim_JJA_precip_850uv_500gpha.pyclean up
2 months ago
Clim_JJA_temperature.pyrename..
2 months ago
eof_analysis_slp_np.pyAdd example -- NAO, NH polar stereographic map
8 days ago
eof_analysis_sst.pyRename eof to eof_sst
2 months ago




密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2016-10-19 21:14:24 | 显示全部楼层
sf
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

发表于 2016-10-19 23:55:49 | 显示全部楼层
感觉现在用Python做气象的人是小众吧,人生苦短,我用Python,哈哈哈。赞楼主一个
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2016-10-19 23:57:58 | 显示全部楼层
8828 发表于 2016-10-19 23:55
感觉现在用Python做气象的人是小众吧,人生苦短,我用Python,哈哈哈。赞楼主一个

并不是的,只是国内如此吧。现在基本上走上Python的都是经过了NCL洗礼的,还有好多“抱残守旧grads”的。当然,原则上会用一门就可以了,个人喜好而已。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-10-20 00:03:14 | 显示全部楼层
风往北吹 发表于 2016-10-19 23:57
并不是的,只是国内如此吧。现在基本上走上Python的都是经过了NCL洗礼的,还有好多“抱残守旧grads”的。 ...

嗯,开始接触Python主要是数据分析,爬虫之类的,后来才发现做气象这方面内容的,不同语言各有各的优势吧,欧洲中心、unidata看起来挺支持Python的
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-10-20 08:33:14 | 显示全部楼层
本帖最后由 平流层的萝卜 于 2016-10-20 09:03 编辑

期待楼主传授经验。本人windows64,安装失败,期待楼主详细安装教程。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-10-20 09:22:37 | 显示全部楼层
这图也是够惊艳的{:5_213:}
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-10-20 10:11:43 | 显示全部楼层
uvcdat 实乃一神器,简单用了一下简直停不下来,还有说在国内小众的,我倒不是很认同,现在 几届 AMS 年会上都在推广 Python 在气象中的应用,以后的支持会越来越多
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2016-10-20 10:23:48 | 显示全部楼层
Sebastian 发表于 2016-10-20 10:11
uvcdat 实乃一神器,简单用了一下简直停不下来,还有说在国内小众的,我倒不是很认同,现在 几届 AMS 年会 ...

密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表