Difference between revisions of "Programming"

(Python)
Line 3: Line 3:
 
== Python ==
 
== Python ==
  
[https://www.python.org Python] is a language widely used in the climate community for data analysis.
+
[https://www.python.org Python] is a language widely used in the climate community for data analysis. It's also one of the most commonly used languages generally, knowing Python is a very useful skill.
  
 
'''Beginner'''
 
'''Beginner'''
Line 13: Line 13:
 
'''Intermediate'''
 
'''Intermediate'''
 
* [https://docs.python.org/3/ Python Language Documentation]
 
* [https://docs.python.org/3/ Python Language Documentation]
 +
 +
'''Advanced'''
 +
* [https://dask.org/ Dask (parallelisation library)]
  
 
=== Jupyter Notebooks ===
 
=== Jupyter Notebooks ===
 +
 +
A handy way to work with Python is to use the [https://jupyter.org/ Jupyter Notebook] interface. This lets you make documents combining text, python code and images. You can run Jupyter at NCI using the [[Conda#Interactive_Analysis_.2F_Jupyter|CLEX Conda environment]].
  
 
=== Plotting ===
 
=== Plotting ===
  
=== Analysing NetCDF data ===
+
[https://matplotlib.org/ Matplotlib] is the starting point for Python plotting. Most of the time you use its [https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.html pyplot] interface, which is much easier to work with.
 +
 
 +
If you're making plots on a map check out the [https://scitools.org.uk/cartopy/docs/latest/ Cartopy] library - this handles things like map projections, drawing coastlines and adding background images.
 +
 
 +
=== Analysing data ===
 +
 
 +
The [http://xarray.pydata.org/en/stable/ xarray] library is a great place to start if you're working with gridded NetCDF data. It allows you to easily open a file, perform common types of analyses like climatologies, and easily plot results.
 +
 
 +
[https://pandas.pydata.org/ Pandas] is a similar library for tabular data, like you'd get from observations at a weather station.
 +
 
 +
[https://numpy.org/ Numpy] and [https://www.scipy.org/ Scipy] are the grandfathers of Python science. They provide optimised versions of standard mathematical functions, especially for working with arrays. Xarray and Pandas both use Numpy arrays to store data.
  
 
== Fortran ==
 
== Fortran ==

Revision as of 00:30, 29 April 2021

Starting point for topics related to programming

Python

Python is a language widely used in the climate community for data analysis. It's also one of the most commonly used languages generally, knowing Python is a very useful skill.

Beginner

Intermediate

Advanced

Jupyter Notebooks

A handy way to work with Python is to use the Jupyter Notebook interface. This lets you make documents combining text, python code and images. You can run Jupyter at NCI using the CLEX Conda environment.

Plotting

Matplotlib is the starting point for Python plotting. Most of the time you use its pyplot interface, which is much easier to work with.

If you're making plots on a map check out the Cartopy library - this handles things like map projections, drawing coastlines and adding background images.

Analysing data

The xarray library is a great place to start if you're working with gridded NetCDF data. It allows you to easily open a file, perform common types of analyses like climatologies, and easily plot results.

Pandas is a similar library for tabular data, like you'd get from observations at a weather station.

Numpy and Scipy are the grandfathers of Python science. They provide optimised versions of standard mathematical functions, especially for working with arrays. Xarray and Pandas both use Numpy arrays to store data.

Fortran

Parallel Programming

Debugging

Bash

Bash is the most common language used in the Linux terminal, though there are alternatives like 'csh' and 'zsh'. There are a wide variety of command line programs available

Beginner


Template:Needs Update This page needs updating

Pages about programming related topics

Running IPython Notebook

Jenkins

Object-oriented Fortran

FortranIntro

Hybridmpi

Python