Python is a very expressive language which means you type less to do more. We have been using Python for our analysis for more than a year. Interactive environment provided by IPython couples with matplotlib allows us to make beautiful plots with quick turnaround. Analysis Tools can take full advantage Python's introspection capability. This enables us to think less about how to get the tools to do what we want and focus more on the analysis. In this tutorial we will be covering how to perform various analysis procedures typically done after skimming process with IPython. Take a look at our advertisement slides for why we think IPython will make life easier.
Location and Time
Somewhere at SLAC. There will be 2 sessions. The tutorial session will be on the day AFTER the collaboration meeting. So make sure you book your flight for an extra day (leaving on Thursday afternoon or Friday).
- Setup Session. One hour long session on Monday Jan 28 2013 16:00-17:30 to help you set your laptop with necessary tools. Preparation instruction is given here. It is recommended that you try to follow to follow instruction before coming to the session. If there is any problem with installation, come to this session for help
- Tutorial Session Three hour long tutorial seesion on Thursday 31st Jan 2013 8:30am-12:30pm, the day right AFTER the collaboration meeting. Remember to book your plane ticket for an extra day.
- Overview. [HTML][ipynb]
- Basic Python [HTML] [.ipynb] and Extended version [HTML] [.ipynb]
- Read Root File with root_numpy and making pretty plots with matplotlib. [HTML] [.ipynb]
- Multivariate analysis using scikit-learn. [HTML] [.ipynb]
- Fit using iminuit and probfit. [HTML] [.ipynb]
Using Virtual Machine (Recommended. Any OS.)
Big download but very easy install. This way you don't really have to mess with your system and you can throw it away afterward if you don't like it. [Show]
I did this on a freshly installed 12.04. [Show]
Please report if it works or not. I do not have a clean mac to try out.[Show]
- Download our entire tutorial project.[ zip|
git clone git://github.com/piti118/babar_python_tutorial.gitfrom your terminal.
If you have cloned it before but want to get the latest version, go to the directory
cd ~/babar_python_tutorial/, then
- If you have cloned it before but want to get the latest version, go to the directory
You should be able to type
ipython notebook --pylab=inline --scriptand a browser should pop up. You will be using this a lot. I alias mine to
alias ipylabnb='ipython notebook --pylab=inline --script'The
.pyfile along side with the notebook file.
You will see 5 notebook choices. You should be able to
play with any of those. To go through each cell, just press