Why Python Is the Next Wave in Earth Sciences Computing

Why Python Is the Next Wave in Earth Sciences Computing
复制标题

为什么 Python 是地球科学计算的下一波浪潮

DOI:
--
复制
发表时间:
2012
期刊:
影响因子:
--
通讯作者:
J. Lin
J. Lin
中科院分区:
--
文献类型:
--
作者:
J. Lin

文献摘要

被引文献

相似文献

那么,为什么对 Python 如此大惊小怪呢?也许您从同事那里听说过 Python,在会议的演示中听到过对这种编程语言的提及,或者点击了科学计算页面上的链接,但想知道考虑到地球科学已有的强大计算工具套件,Python 语言还能提供哪些额外好处。本文将论证 Python 是地球科学计算的下一波浪潮,原因很简单:Python 使用户能够进行更多更好的科学研究。我们将了解该语言的功能以及这些功能的好处。本文将介绍这些功能如何提供目前现有工具不太可能提供的科学计算能力,并重点介绍地球科学中对 Python 日益增长的支持,以及即将召开的 2013 年 AMS 年会上将讨论地球科学中的 Python 的活动。 Python 是一种现代的、解释性的、面向对象的开源语言,用于各种软件工程。尽管它已经存在了二十年,但就在几年前,当开发社区集中在大气科学工作所需的标准科学包(例如阵列处理)之后,它在大气科学中得到了爆炸性的应用。 Python 现在是一个强大的集成平台,适用于各种大气科学工作,从数据分析到分布式计算,从图形用户界面到地理信息系统。 Python 的显着特点之一是,对于数组和非数组都具有简洁而自然的语法,使程序极其清晰易读;俗话说,“Python 是可执行的伪代码”。此外,由于该语言是解释性的,因此开发更加容易;您不必花费额外的时间来操作编译器和链接器。此外,现代数据结构和语言的面向对象性质使 Python 代码更加健壮且不易损坏。最后,Python 的开源血统,在工业和科学领域庞大的用户和开发人员基础的帮助下,意味着您的程序可以利用现有的数以万计的 Python 包。其中包括可视化、数值库、与编译语言和其他语言的互连、内存缓存、Web 服务、移动和桌面图形用户界面编程等。在许多情况下,上述每个域区域中都存在多个包。您不仅限于一家供应商可以提供的产品,甚至不限于只有科学界可以提供的产品!许多其他语言也具有 Python 的一些功能:例如,Fortran 90 也支持数组语法。 Python 的独特优势在于其工具套件的互连性和全面性,以及可以轻松应用其他社区和学科的创新。考虑一个典型的地球科学计算工作流程。我们想要研究一些现象,并决定分析数据或进行模型实验。因此,我们访问数据存档并通过 Web 请求下载数据,或者更改模型(可能是 Fortran)源代码中的参数并运行模型。有了数据集或模型输出文件,我们可能会使用 IDL 或 MATLAB 编写分析程序来对数据进行统计分析。最后,我们通过线图或等高线图可视化数据。一般来说,我们使用一系列工具来完成此工作流程:用于 Web 请求和文件管理的 shell 脚本、用于代码和编译管理的 Unix 工具 Make、用于建模的编译语言以及用于数据分析和可视化的 IDL 或 MATLAB。每个工具都与其他工具隔离,工具之间的通信通过文件进行。编程
So, why all the fuss about Python? Perhaps you have heard about Python from a coworker, heard a reference to this programming language in a presentation at a conference, or followed a link from a page on scientific computing, but wonder what extra benefits the Python language provides given the suite of powerful computational tools the Earth sciences already has. This article will make the case that Python is the next wave in Earth sciences computing for one simple reason: Python enables users to do more and better science. We’ll look at features of the language and the benefits of those features. This article will describe how these features provide abilities in scientific computing that are currently less likely to be available with existing tools, and highlight the growing support for Python in the Earth sciences as well as events at the upcoming 2013 AMS Annual Meeting that will cover Python in the Earth sciences. Python is a modern, interpreted, object-oriented, open-source language used in all kinds of software engineering. Though it has been around for two decades, it exploded into use in the atmospheric sciences just a few years ago after the development community converged upon the standard scientific packages (e.g., array handling) needed for atmospheric sciences work. Python is now a robust integration platform for all kinds of atmospheric sciences work, from data analysis to distributed computing, and graphical user interfaces to geographical information systems. Among its salient features, Python has a concise but natural syntax for both arrays and nonarrays, making programs exceedingly clear and easy to read; as the saying goes, “Python is executable pseudocode.” Also, because the language is interpreted, development is much easier; you do not have to spend extra time manipulating a compiler and linker. In addition, the modern data structures and object-oriented nature of the language makes Python code more robust and less brittle. Finally, Python’s open-source pedigree, aided by a large user and developer base in industry as well as the sciences, means that your programs can take advantage of the tens of thousands of Python packages that exist. These include visualization, numerical libraries, interconnection with compiled and other languages, memory caching, Web services, mobile and desktop graphical user interface programming, and others. In many cases, several packages exist in each of the above domain areas. You are not limited to only what one vendor can provide or even what only the scientific community can provide! A number of other languages have some of Python’s features: Fortran 90, for instance, also supports array syntax. Python’s unique strengths are the interconnectedness and comprehensiveness of its tool suite and the ease with which one can apply innovations from other communities and disciplines. Consider a typical Earth sciences computing workflow. We want to investigate some phenomena and decide to either analyze data or conduct model experiments. So, we visit a data archive and download the data via a Web request, or we change parameters in the (probably Fortran) source code of a model and run the model. With the dataset or model output file in hand, we write an analysis program, perhaps using IDL or MATLAB, to conduct statistical analyses of the data. Finally, we visualize the data via a line plot or contour plot. In general, we accomplish this workflow using a kludge of tools: shell scripting for Web requests and file management, the Unix tool Make for code and compilation management, compiled languages for modeling, and IDL or MATLAB for data analysis and visualization. Each tool is isolated from every other tool, and communication between tools occurs through files. programming