User Tools

Site Tools


other:python:jyp_steps

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
other:python:jyp_steps [2016/02/23 10:03]
jypeter Added links to Numexpr and PyTables
other:python:jyp_steps [2016/09/30 09:07]
jypeter Added hints for non French readers
Line 1: Line 1:
 ====== JYP's recommended steps for learning python ====== ====== JYP's recommended steps for learning python ======
 +
 +<note tip>If you don't know which python distribution to use and how to start the python interpreter,​ you should first read the [[starting|Working with Python]] page</​note>​
  
 As can be expected, there is **a lot** of online python documentation available, and it's easy to get lost. You can always use google to find an answer to your problem, and you will probably end up looking at lots of answers on [[http://​stackoverflow.com/​questions/​tagged/​python|Stack Overflow]] or a similar site. But it's always better to know where you can find some good documentation... and to spend some time to read the documentation As can be expected, there is **a lot** of online python documentation available, and it's easy to get lost. You can always use google to find an answer to your problem, and you will probably end up looking at lots of answers on [[http://​stackoverflow.com/​questions/​tagged/​python|Stack Overflow]] or a similar site. But it's always better to know where you can find some good documentation... and to spend some time to read the documentation
Line 11: Line 13:
 You can start using python by reading the {{:​other:​python:​python_intro_ipsl_oct2013_v2.pdf|Bien démarrer avec python}} tutorial that was used during a 2013 IPSL python class: You can start using python by reading the {{:​other:​python:​python_intro_ipsl_oct2013_v2.pdf|Bien démarrer avec python}} tutorial that was used during a 2013 IPSL python class:
   * this tutorial is in French (my apologies for the lack of translation,​ but it should be easy to understand)   * this tutorial is in French (my apologies for the lack of translation,​ but it should be easy to understand)
 +    * If you have too much trouble understanding this French Tutorial, you can read the first 6 chapters of the **Tutorial** in [[#​the_official_python_documentation|the official Python documentation]] and chapters 1.2.1 to 1.2.5 in the [[#​scipy_lecture_notes|Scipy Lecture Notes]]. Once you have read these, you can try to read the French tutorial again
   * it's an introduction to python (and programming) for the climate scientist: after reading this tutorial, you should be able to do most of the things you usually do in a shell script   * it's an introduction to python (and programming) for the climate scientist: after reading this tutorial, you should be able to do most of the things you usually do in a shell script
     * python types, tests, loops, reading a text file     * python types, tests, loops, reading a text file
Line 126: Line 129:
 ==== cdms2 ==== ==== cdms2 ====
  
-Summary: cdms2 can read/write netCDF files (and read //grads// dat+ctl files) and provides a higher level interface than netCDF4. Unfortunately,​ cdms2 is only available in the UV-CDAT distribution,​ and distributions where somebody has installed some version of //​cdat-lite//​. When you can use cdms2, you also have access to //cdtime//, that is very useful for handling time axis data.+Summary: cdms2 can read/write netCDF files (and read //grads// dat+ctl files) and provides a higher level interface than netCDF4. Unfortunately,​ cdms2 is only available in the [[other:​python:​starting#​uv-cdat|UV-CDAT distribution]], and distributions where somebody has installed some version of //​cdat-lite//​. When you can use cdms2, you also have access to //cdtime//, that is very useful for handling time axis data.
  
 How to get started: How to get started:
Line 161: Line 164:
  
 ===== Basemap ===== ===== Basemap =====
 +
 +<note warning>​It seems that basemap is going to be slowly phased out, in favor of [[#​cartopy]]\\ More information in this [[https://​github.com/​matplotlib/​basemap/​issues/​267|basemap github issue]]
 +</​note>​
  
 Summary: Basemap is an extension of Matplotlib that you can use for plotting maps, using different projections Summary: Basemap is an extension of Matplotlib that you can use for plotting maps, using different projections
Line 169: Line 175:
   - look at the [[http://​matplotlib.org/​basemap/​users/​examples.html|examples]]   - look at the [[http://​matplotlib.org/​basemap/​users/​examples.html|examples]]
   - check the [[http://​matplotlib.org/​basemap/​users/​mapsetup.html|different projections]]   - check the [[http://​matplotlib.org/​basemap/​users/​mapsetup.html|different projections]]
-  - look at the [[http://​matplotlib.org/​basemap/​api/​basemap_api.html#​module-mpl_toolkits.basemap|detailed documentation]]+  ​- read some documentation! 
 +    - the **really nice** [[http://​basemaptutorial.readthedocs.io/​en/​latest/​index.html|basemap tutorial]] seems much better than the official documentation below 
 +    ​- look at the [[http://​matplotlib.org/​basemap/​api/​basemap_api.html#​module-mpl_toolkits.basemap|detailed ​official ​documentation]] 
 + 
 +===== Cartopy =====
  
 +Summary: //Cartopy makes use of the powerful PROJ.4, numpy and shapely libraries and has a simple and intuitive drawing interface to matplotlib for creating publication quality maps//
  
 +Where: [[http://​scitools.org.uk/​cartopy/​docs/​latest/​|Cartopy web site]]
 ===== Scipy Lecture Notes ===== ===== Scipy Lecture Notes =====
  
other/python/jyp_steps.txt · Last modified: 2024/03/07 10:15 by jypeter