Python for Atmosphere and Ocean Scientists

Daniel Wheeler

NOAA (virtual), 12/11/2020

Operations

  • Software -- Jupyter, AOS Python stack
  • I'm assuming you have a little experience with Python
  • Please ask me to slow down in the chat interface
  • What are we doing?
    • Organize your software -- Conda environments
    • Using Xarray with NetCDF files
    • Vectorization (not writing loops in Python)
    • Anything else that you'd like to learn
    • Present your own data
    • Trying to read and manipulate your own data

Study Material

  • SWC, heavily Pandas based

    • http://swcarpentry.github.io/python-novice-gapminder/

  • Python like you mean it

    • https://www.pythonlikeyoumeanit.com/module_2.html

  • Automate the boring stuff

    • https://automatetheboringstuff.com/  

Why learn Python?

  • It's a programming language - doesn't matter

  • Alternatives: Matlab, Mathematica, Perl, Ruby, Julia

  • Widely used in science

  • Widely used outside of science (web platforms, data science)

  • Number 3 on TIOBE index (Java, C, Python), https://www.tiobe.com/tiobe-index/

  • What else: huge active community, many scientific libraries, high level, open

  • Some drawbacks (types, reproducibility)

  • What do your friends use?

AOS Stack

Python software is like the wild west compared with Matlab

Python Environments

  • What happens if we only use the "system" Python?
  • We need many different Python environments
  • In the beginning there was pip and it was ok
  • How do we share environments?
  • 5-10 years ago Conda became popular
    • create any number of new environments
    • other language support (Ruby, R, Javascript, C extensions)
  • Conda has problems
    • There are other choices (e.g. Nix)

python-aos

By Daniel Wheeler

python-aos

  • 424