carpentries-lab / python-aos-lesson

Python for Atmosphere and Ocean Scientists
https://carpentries-lab.github.io/python-aos-lesson/
Other
87 stars 49 forks source link

Expand the vectorisation lesson to "xarray thinking" #56

Open DamienIrving opened 2 years ago

DamienIrving commented 2 years ago

At the moment the vectorisation lesson is very short and simply introduces the idea of not looping over arrays in Python.

It would be good to extend that lesson to talk more broadly about how to think about array operations using xarray. The following tutorial from @dcherian talks about working in index versus label space, and how to use methods like reduce and map to apply functions to arrays: https://github.com/ProjectPythiaTutorials/thinking-with-xarray_2022_03_09

In terms of the data analysis example in these PyAOS lessons, the concepts introduced in an extended xarray thinking lesson could be used to plot the seasonal climatology (i.e. four panels in one plot), custom seasons (e.g. 'NDJFMA', 'MJJASO'), apply spatial smoothing, etc.

DamienIrving commented 2 years ago

Here's the lesson recording: https://www.youtube.com/watch?v=TSw3GF_d2y8