PythonOverview: Difference between revisions

From CASA Guides
Jump to navigationJump to search
Aleroy (talk | contribs)
No edit summary
Aleroy (talk | contribs)
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 13: Line 13:
** [[NumpyBasics | '''Array Manipulation (Numpy)''']]
** [[NumpyBasics | '''Array Manipulation (Numpy)''']]
** [[PythonDataAccess | '''Data Access''']]
** [[PythonDataAccess | '''Data Access''']]
** [[PlotBasics | '''Plotting (Pylab/Matplotlib)''']]
** [[PlotBasics | '''Plotting (Matplotlib)''']]


* '''The CASA Toolkit'''
* [[OtherPackages | '''Installing Third-Party Packages in the CASA''']]
 
* '''Other Packages'''


== Links to Other Sites ==
== Links to Other Sites ==

Latest revision as of 18:05, 13 September 2013

One of CASA nicest features is that it it integrated into an python working environment (specifically an iPython shell). Python is a high-level programming language that has gained a lot of traction for scripting and scientific programming over the last few years. The features that make Python high-level and the strong supporting libraries (especially for array handling) mean that in practice it has a lot of similarities to other commonly used analysis packages like IDL or MatLab.

These pages will step you through some basics of python. What you learn will have direct applications to scripting CASA. If you dig a little deeper then you will also find some of the tools to integrate your astronomical analysis, observation problem, and data reduction.

This is a CASA guide, so we will assume that you are working inside of a "casapy" shell, but much of what you learn can be directly ported to any iPython shell or to write compiled python code (which on most systems you will be able to run simply by typing "python my_program.py"). The only thing to be slightly careful about, is that Python 2.x (what we use) is not quite compatible with Python 3.x which is now being used other places.

We'll start with the very basics: arithmetic, data collections, control flow. These will heavily duplicate several other tutorials on the web (we strongly recommend the introductory tutorials at the basic python site: Here). Going through a couple of these as you try to write your first programs is probably a great way to really get oriented.

CASA Guide Python Overview

Links to Other Sites