PythonOverview: Difference between revisions
No edit summary |
No edit summary |
||
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 | 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. | ||
=== | === Python Overview === | ||
* [[PythonBasics | '''Python Basics''']] | * [[PythonBasics | '''Python Basics''']] | ||
Revision as of 18:37, 1 November 2011
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.
Python Overview
- Data Analysis
- The CASA Toolkit
- Other Packages