Hostname: page-component-89b8bd64d-nlwjb Total loading time: 0 Render date: 2026-05-08T22:01:24.318Z Has data issue: false hasContentIssue false

Why scientists should learn to program in Python

Published online by Cambridge University Press:  18 December 2014

Vidya M. Ayer
Affiliation:
Svaksha.com, Bangalore, India
Sheila Miguez
Affiliation:
Chicagopythonworkshop.org, Chicago, Illinois, USA
Brian H. Toby*
Affiliation:
Advanced Photon Source, Argonne National Laboratory, 9700 S. Cass Avenue, Argonne, Illinois 60439–4814
*
a) Author to whom correspondence should be addressed. Electronic mail: toby@anl.gov

Abstract

The importance of software continues to grow for all areas of scientific research, no less for powder diffraction. Knowing how to program a computer is a basic and useful skill for scientists. This paper explains the three approaches for programming languages and why scripting languages are preferred for non-expert programmers. The Python-scripting language is extremely efficient for science and its use by scientists is growing. Python is also one of the easiest languages to learn. The language is introduced, as well as a few of the many add-on packages available that extend its capabilities, for example, for numerical computations, scientific graphics, and graphical user interface programming. Resources for learning Python are also provided.

Information

Type
Crystallography Education
Copyright
Copyright © International Centre for Diffraction Data 2014 
Figure 0

Figure 1. (Color online) An example of simple screen graphics from the Matplotlib package, generated with a simple command. Note that the plot can be shifted and zoomed. Also, the cursor position is indicated.

Figure 1

Figure 2. (Color online) An image that has been recolored to show the luminance of each pixel according to a Matplotlib color mapping.

Figure 2

Figure 3. (Color online) An example of a computation performed in an IPython notebook showing a simple computation and the graphed result. The IPython notebook file can be shared by e-mail or even within a network, with a secured server.

Supplementary material: File

Ayer Supplementary Material

Ayer Supplementary Material

Download Ayer Supplementary Material(File)
File 278.2 KB