PythonOverview: Difference between revisions

From CASA Guides
Jump to navigationJump to search
Jkeohane (talk | contribs)
No edit summary
Aleroy (talk | contribs)
No edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
One of CASA nicest features is that it it integrated into an python working environment (specifically an [http://www.ipython.org iPython] shell). [http://ww.python.org 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.
One of CASA nicest features is that it it integrated into an python working environment (specifically an [http://www.ipython.org iPython] shell). [http://ww.python.org 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 (more or less) integrate your astronomical analysis, observation problem, and data reduction.
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|Python 3.x]] which is now being used other places.   
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|Python 3.x]] which is now being used other places.   
Line 7: Line 7:
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: [http://docs.python.org/tutorial/ Here]). Going through a couple of these as you try to write your first programs is probably a great way to really get oriented.
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: [http://docs.python.org/tutorial/ Here]). Going through a couple of these as you try to write your first programs is probably a great way to really get oriented.


=== Test ===
== CASA Guide Python Overview ==
* [[PythonBasics | '''Python Basics''']]
* [[PythonBasics | '''Python Basics''']]


* '''Data Analysis'''
* '''Data Analysis'''
** [[NumpyBasics | Array Manipulation (Numpy)]]
** [[NumpyBasics | '''Array Manipulation (Numpy)''']]
** [[PlotBasics | Plotting (Pylab/Matplotlib)]]
** [[PythonDataAccess | '''Data Access''']]
** [[PlotBasics | '''Plotting (Matplotlib)''']]


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


* '''Other Packages'''
== 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