=== Perry Greenfield - pysynphot === - simulate expected detected photon count given - model of source - telescope, instrument, detector - spectrum * (optics, including filters) = response - legacy app written in early 90s in SPP for IRAF - IRAF problems: - single precision arithmetics - everything is an array (poor spectral sampling) - no memory caching - steep learning curve for minilanguage - solutions (with Python): - double precision - object-oriented features - do things in memory - expose objects as building blocks - be flexible on wavelength sampling - leave plotting and arrays to libraries (numpy, pyFITS, matplotlib) - objects: - SpectralElement (telescope, lens, or mirror) - can be multiplied to other sources - should know how to sample themselves appropriately - analytical or table-based - Spectrum (source of light) - can be added to other sources - Observation (observed spectrum) - cannot be manipulated or combined further - knows how to bin flux - units... - with python: - OO features allow object composition by operator overloading - composition constructs relationships, does not force evaluation - ...which provides smart wavelength handling - python is user interface === Robert Lupton - LLST and Python === - joke about physicist, wife, mistress - LSST: 8.4m mirror on Cerro Pachón in Chile - field is 9.6 deg^2 (full moon is 0.25) - 3.2Gpixel camera (50k x 50k) -> 800 Mb/s - LSST software in three parts: - process incoming pixels, derive source properties - middleware will marshall application layer over cluster - database to handle catalogs - (and also a build system -- scons) - applications in C++, wrapped in swig (non-invasive, well-supported, high-level semantics also for STL) - image-handling based on VisionWorkbench -> classes in C++ - by contrast, PyRAF defines all classes in Python - python fits in for: - writing tests - as high-level debugger - scripting - numpy integration - it would be nice if C++ functions could return numpy arrays - tried to create python class than inherits from ndarray and LSST Image, but that's fragile - also possible to have Image inherit from ndarray? === Dan Starr - real-time astronomical transient classification and broadcast pipeline === - science classification with minimal astronomer input - python useful for rapid development - packages - adapt to evolving constraint and architecture - allows contribution by less experienced - PyEphem to filter out minor planets - various classification packages - broadcast with smtplib, socket, jabber - simple data stored with MySQL - structured data with VOEvent XML, stored with Berkeley-DB XML === Matthew Turk - Enzo and yt === - very impressive AMR multiscale cosmology simulation packages === Travis Oliphant - ufuncs === - generic function: def _float_func(x): ... func_dispatch = {} func_dispatch[float] = _float_func def func(x): try: return func_dispatch[type(x)](x) except: ... - ufuncs are C-based implementation of generic functions for array arguments - dispatch based on dtype - default rules for mixed-mode type coercion - many other features (broadcasting, errors, output arrays) - easy to write one... (many details) see scipy/special for examples === Evan Patterson - numpy optimizations === - loop unrolling - gcc does not seem to do it - data alignment - intel SSE - loop peeling - completed generic Python genetic programming library === Ilan Schnell - converting Python functions to dynamically compiled C === - CPython implemented in C, PyPy in Python (now RPYthon) - RPython can be translated to C, LLVM - compile decorator: use pypy translator to compile functions to C on the fly - fast_vectorize decorator to make numpy ufuncs; pypy makes C, weave.inline turns it to Python-callable object code - available in scipy (perhaps as mkufunc?) === Rahul Garg - converting numerical Python programs to C === - numpy and python -> unpython compiler -> GPU code, open MP + C code - features: type signatures as decorators, local types inferred, numpy supported, parallel loops supported, basic support for classes, tuples, lists, dicts - e.g. @unpython.type('int','int','int') def f(x,y): tmp = x + y return tmp - more types: ndarray[int 2] list[float] tuple[double] - parallel loop: "for i in unpython.range(n): x[i] = x[i]*2.0" becomes #pragma omp parallel for for(i=0;i