Proceedings of the 9Th Python in Science Conference
Total Page:16
File Type:pdf, Size:1020Kb
Proceedings of the 9th Python in Science Conference June 28 - July 3 Austin, Texas • Stefan´ van der Walt Jarrod Millman PROCEEDINGS OF THE 9TH PYTHON IN SCIENCE CONFERENCE Edited by Stefan´ van der Walt and Jarrod Millman. SciPy 2010 Austin, Texas June 28 - July 3, 2010 Copyright c 2010. The articles in the Proceedings of the Python in Science Conference are copyrighted and owned by their original authors This is an open-access publication and is distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited. For more information, please see: http://creativecommons.org/licenses/by/3.0/ ISSN:2575-9752 https://doi.org/10.25080/Majora-92bf1922-012 ORGANIZATION Conference Chairs ERIC JONES, Enthought, Inc., USA JARROD MILLMAN, Neuroscience Institute, UC Berkeley, USA Program Chair STEFAN´ VAN DER WALT, Applied Mathematics, Stellenbosch University, South Africa Program Committee CHRISTOPHER BARKER, Oceanographer, NOAA Emergency Response Division, USA C. TITUS BROWN, Computer Science and Biology, Michigan State, USA ROBERT CIMRMAN, Mechanics and New Technologies Research, University of West Bohemia, Plzen,ˇ Czech Republic DAVID COURNAPEAU, School of Informatics, Kyoto University, Japan DARREN DALE, Cornell High Energy Synchrotron Source, Cornell University, USA FERNANDO PEREZ´ , Neuroscience Institute, UC Berkeley, USA PRABHU RAMACHANDRAN, Aerospace Engineering, IIT Bombay, India JAMES TURNER, Gemini Observatory, Chile WARREN WECKESSER, Enthought, Inc., USA Tutorial Chair BRIAN GRANGER, Physics, CalPoly, USA Student Sponsorship Chair TRAVIS OLIPHANT, Enthought, Inc., USA Biomedical/Bioinformatics Track Chair GLEN OTERO, Dell, USA Parallel Processing/Cloud Computing Track Chairs KEN ELKABANY, PiCloud, USA BRIAN GRANGER, Physics, CalPoly, USA Proceedings Reviewers MATTHEW BRETT, Neuroscience Institute, UC Berkeley, USA C. TITUS BROWN, Computer Science and Biology, Michigan State, USA DAMIAN EADS, Computer Science, UC Santa Cruz, USA RALF GOMMERS, Healthcare Department, Philips Research Asia, Shanghai, China EMMANUELLE GOUILLART, CNRS Saint Gobain, France YAROSLAV O. HALCHENKO, PBS Department, Dartmouth College, USA JOSH HEMANN, Marketing Analytics and Business Strategy, Sports Authority, USA NEIL MULLER, Applied Mathematics, University of Stellenbosch, South Africa EMANUELE OLIVETTI, NeuroInformatics Laboratory, Bruno Kessler Foundation and University of Trento, Italy DAG SVERRE SELJEBOTN, Theoretical Astrophysics, University of Oslo, Norway ANDREW STRAW, Molecular Pathology, Austria JAMES TURNER, Data Processing Software Group, Gemini Observatory, Chile Program Staff AMENITY APPLEWHITE, Enthought, Inc., USA JODI HAVRANEK, Enthought, Inc., USA LEAH JONES, Enthought, Inc., USA SCHOLARSHIP RECIPIENTS ELAINE ANGELO, Harvard University JAMES BERGSTRA, University of Montreal KADAMBARI DEVARAJAN, University of Illinois GERARDO GUTIERREZ, Universidad de Antioquia RYAN MAY, University of Oklahoma KRISTOPHER OVERHOLT, University of Texas FABIAN PEDREGOSA, University of Granada NICOLAS PINTO, Massachusetts Institute of Technology SKIPPER SEABOLD, American University KURT SMITH, University of Wisconsin STEFAN´ VAN DER WALT, Stellenbosch University DAVID WARDE FARLEY, University of Toronto OMAR ANDRES ZAPATA MESA, Universidad de Antioquia JUMP TRADING AND NUMFOCUS DIVERSITY SCHOLARSHIP RECIPIENTS , CONTENTS Keeping the Chandra Satellite Cool with Python 1 Tom Aldcroft Astrodata 6 Craig Allen Divisi: Learning from Semantic Networks and Sparse SVD 12 Rob Speer, Kenneth Arnold, Catherine Havasi Theano: A CPU and GPU Math Compiler in Python 18 James Bergstra, Olivier Breuleux, Fred´ eric´ Bastien, Pascal Lamblin, Razvan Pascanu, Guillaume Desjardins, Joseph Turian, David Warde-Farley, Yoshua Bengio A High Performance Robot Vision Algorithm Implemented in Python 25 Steven C. Colbert, Gregor Franz, Konrad Woellhaf, Redwan Alqasemi, Rajiv Dubey Unusual Relationships: Python and Weaver Birds 31 Kadambari Devarajan, Maria A. Echeverry-Galvis, Rajmonda Sulo, Jennifer K. Peterson Weather Forecast Accuracy Analysis 36 Eric Floehr Rebuilding the Hubble Exposure Time Calculator 40 Perry Greenfield, Ivo Busko, Rosa Diaz, Vicki Laidler, Todd Miller, Mark Sienkiewicz, Megan Sosey Using Python with Smoke and JWST Mirrors 45 Warren J. Hack, Perry Greenfield, Babak Saif, Bente Eegholm Modeling Sudoku Puzzles with Python 49 Sean Davis, Matthew Henderson, Andrew Smith Data Structures for Statistical Computing in Python 56 Wes McKinney Protein Folding with Python on Supercomputers 62 Jan H. Meinke SpacePy - A Python-based Library of Tools for the Space Sciences 67 Steven K. Morley, Daniel T. Welling, Josef Koller, Brian A. Larsen, Michael G. Henderson, Jonathan Niehof Numerical Pyromaniacs: The Use of Python in Fire Research 73 Kristopher Overholt A Programmatic Interface for Particle Plasma Simulation in Python 77 Min Ragan-Kelley, John Verboncoeur PySPH: A Python Framework for Smoothed Particle Hydrodynamics 80 Prabhu Ramachandran, Chandrashekhar Kaushik Audio-Visual Speech Recognition using SciPy 85 Helge Reikeras, Ben Herbst, Johan du Preez, Herman Engelbrecht Statsmodels: Econometric and Statistical Modeling with Python 92 Skipper Seabold, Josef Perktold PROC. OF THE 9th PYTHON IN SCIENCE CONF. (SCIPY 2010) 1 Keeping the Chandra Satellite Cool with Python ‡ Tom Aldcroft ∗ ! Abstract—The Chandra X-ray Observatory has been providing groundbreaking astronomical data since its launch by NASA in July of 1999. Now starting the second decade of science the Chandra operations team has been using Python to create predictive thermal models of key spacecraft components. These mod- els are being used in the mission planning and command load review process to ensure that the series of planned observations and attitudes for each week will maintain a safe thermal environment. Speaking from my perspective as a scientist working to create and calibrate the models, I will discuss the process and the key off-the-shelf tools that made it all possible. This includes fitting many-parameter models with the Sherpa package, parallel computation with mpi4py/MPICH2, large table manipulations with pytables/HDF5, and of course fast array math with NumPy. Index Terms—telescope, NASA, MPI, astronomy, control Motivation This paper describes the use of off-the-shelf tools in Python to tackle a relatively challenging engineering problem facing the Chandra X-ray Observatory satellite [CHANDRA]. While Fig. 1: Artist’s rendering of the Chandra X-ray satellite. The silverized presenting no fundamentally new algorithms or packages, the goal teflon which wraps the spacecraft has degraded so it is now far less reflective than shown. here is to take this as a case study for understanding how scientists and engineers can make Python the foundation of their analysis toolkit. planning. Note that Chandra is in a high elliptical orbit, so unlike Hubble no repair is possible. Chandra Different parts of the spacecraft are heated at different pitch angles (the angle that the telescope boresight axis makes to the The Chandra satellite was launched in July of 1999 as one of sun line). This is shown in Figure 2 which presents a side view of NASA’s four "Great Observatories". This satellite can be com- Chandra along with the subsystems that are sensitive over different pared in size and scope to the Hubble Space Telescope except that pitch ranges. Temperatures can be maintained within limits by it views the universe in X-rays instead of optical or UV light. Some ping-ponging to different attitudes, never letting one part get too people will argue that the universe is a much more exciting place hot. Thus in order to plan the weekly observing schedule a few when viewed with X-ray photons, for then the sky comes alive simple models were created to predict temperatures or otherwise with black holes, supernova explosions, massive galaxy clusters, constrain the observing duration at certain attitudes. pulsars, and many other highly energetic phenomena. As the constraints became more significant a need developed Early in the mission it became apparent that temperatures on to improve the models in order to maintain the highest scientific the spacecraft, particularly on the side which normally faces the output without endangering the spacecraft. In response, about Sun, were increasing at a rate well above pre-launch predictions. three years ago the CXC Science Operations Team (SOT, scientists It turned out that the ionizing particle radiation environment was closely involved in satellite operations) and the engineers of the higher than expected and that it was degrading the silverized teflon Flight Operations Team (FOT) formed a joint working group to insulation which wraps much of the spacecraft. Since this time the study thermal issues and to develop higher fidelity thermal models. constraint of keeping spacecraft components within safe operating This paper discusses one facet of the results coming out of the temperatures has been a major driver in operations and schedule thermal modeling working group. Early in the process the author chose Python as the program- * Corresponding author: [email protected] ‡ Smithsonian Astrophysical Observatory ming language for supporting this effort. Around this time NumPy had emerged as a strong (and consolidated) numeric array manip- Copyright © 2010 Tom Aldcroft. This is an open-access article distributed ulation tool for Python. Adding