Skip to content

IRFM/Python_Course_For_Fusion

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binder

Python Crash Course

for Fusion Scientists in a hurry

Crash course: a class in which a lot of information is taught in a short period of time [merriam-webster]

This is a Python elementary course for scientists (physicists or engineers and eventually students) who already know how to use Matlab.

Much of the content of this course is very inspired from the book Effective Computation in Physics from Anthony Scopatz and Kathryn D.Huff (which I really recommand!).

The goal of this course is to empower the audience for typical control room work: retrieving, manipulating and plotting data. The duration is expected to be one or two days at max.

This objective is certainly somewhat limited with respect to the potential of Python for science, and thus criticable. This choice is motivated mainly for time and utility purpose, as the audience will be faced to a crude problem during WEST restart: a reduced number of Matlab licences. They will be busy beside on other projects and won't have few days available for a complete (and proper) Python course.

Because this solution does not please me (but rather circunstance imposed), the first part of the course is dedicated to carefully explain what is Python and to show how broad its usage can be (i.e.: Python is not only a cheap Matlab-replacement).

Moreover, each course sections include a where could I find more information?, in order to insist on the fact that the online ressources concerning Python are significant (numerous but scattered!), which is a change in habits over Matlab for which the documentation is very well centralized.

The course topics slides are the following:

  • Whats is Python?
  • Why should I care?
  • Python at IRFM
  • Python terminal
  • IPython
  • Jupyter (ex-IPython notebook)
  • Spyder
  • Need help?

Notebook Course

2.Répéter des actions 3.Introduction à NumPy, la librairie Python pour manipuler des tableaux numériques 4.Réaliser des graphiques, avec la librairie Matplotlib 5.Accéder aux données des bases de données Fusion, avec la TSlib (WEST) et MDSplus (JET) 6.Lire et écrire des fichiers, texte ou Matlab

  • Python Files
  • Comments
  • Variables
  • Dealing with Errors
  • (Some) Python Operators
  • Strings
  • String Manipulations
  • Blocks : if/else, for, while
  • Functions
  • Exceptions
  • List comprehension

Notebook Course

  • Numpy arrays
  • Opérations et manipulation des arrays, slicing
  • Ouvrir des fichiers de données (.csv, .mat)
  • Où trouver de l’aide ?

Notebook Course

  • Simple plot
  • Changer les options graphiques, depuis l'interface ou en commandes (axes, set_, etc.)
  • Exporter une figure depuis l'interface ou en commandes
  • Subplots
  • pcolor ou assimilé
  • Figures en 3D (projection=3D)
  • Où trouver de l’aide ?

Notebook Course

  • Le module PyWed : tsbase. Scalaires, Signaux, Groupes de signaux
  • Accessing data via MDSplus: Tore Supra, JET

Notebook Course

Write or read text files

Notebook Course

Manipulating Images

Notebook Course

The SciPy module, examples

Notebook Course

SymPy

Notebook Course

Ressources and references

About

Python crash course with a specific focus on fusion science

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 70.9%
  • Jupyter Notebook 29.0%
  • Other 0.1%