Skip to content

Instantly share code, notes, and snippets.

View cdeil's full-sized avatar

Christoph Deil cdeil

View GitHub Profile
@cdeil
cdeil / gist:3135561
Created July 18, 2012 11:02
Macports pymc 2.0 test failures
christoph-deils-macbook:tmp deil$ python2.6 -c 'import pymc; pymc.test()'
Running unit tests for pymc.tests
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/pkgutil.py:186: ImportWarning: Not importing directory '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/virtualenvwrapper': missing __init__.py
file, filename, etc = imp.find_module(subname, path)
NumPy version 1.6.2
NumPy is installed in /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy
Python version 2.6.8 (unknown, Apr 19 2012, 09:26:08) [GCC 4.2.1 Compatible Apple Clang 3.1 (tags/Apple/clang-318.0.45)]
nose version 1.1.2
Plotting disabled
...S.S.....F.F..SS...........S.....S......S..............S....S.......S........S.....S..S......../opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pymc/distributions.py:2090: RuntimeWarning: divide by zero encountered in log
@cdeil
cdeil / fit_with_root.py
Created July 23, 2012 14:04
Example of how to fit linear and nonlinear models to data with ROOT
"""
Example of how to fit linear and nonlinear models to data with ROOT [1],
the most widely used data analysis / fitting package for physicists.
It would be great if statsmodels [2] could also fit non-linear models
and if the documentation could be improved to be understandable by physicists.
[1] http://root.cern.ch
[2] http://statsmodels.sourceforge.net
"""
@cdeil
cdeil / allsky.py
Created July 25, 2012 11:31
Plot an allsky image with aplpy
"""Plot an allsky image with aplpy"""
import matplotlib
matplotlib.use('Agg')
import aplpy
f = aplpy.FITSFigure('allsky.fits')
print('Plotting ...')
f.set_theme('publication')
@cdeil
cdeil / gist:3175720
Created July 25, 2012 11:48
aplpy astropy pywcs issue
(astro_python)lfs1> python runtests.py
================================================================== test session starts ===================================================================
platform linux2 -- Python 2.6.6 -- pytest-2.2.0
collected 0 items / 13 errors
========================================================================= ERRORS =========================================================================
_______________________________________________________ ERROR collecting tests/test_axis_labels.py _______________________________________________________
tests/test_axis_labels.py:7: in <module>
> from aplpy import FITSFigure
aplpy/__init__.py:1: in <module>
@cdeil
cdeil / gist:3175727
Created July 25, 2012 11:50
aplpy pywcs issue for allsky image plot script
(astro_python)lfs1> python allsky.py
/lfs/l1/hess/users/deil/bin/HESSSurveyBin/astro_python/lib/python2.6/site-packages/astropy-0.2.dev1517-py2.6-linux-x86_64.egg/pywcs/__init__.py:30: DeprecationWarning: pywcs is deprecated. Use astropy.wcs instead.
DeprecationWarning)
WARNING: hdu=0 does not contain any data, using hdu=1 instead
ERROR: Exception: An error occured while parsing the WCS information [aplpy.aplpy]
ERROR: Exception: An error occured while parsing the WCS information
Traceback (most recent call last):
File "allsky.py", line 7, in <module>
f = aplpy.FITSFigure('allsky.fits')
File "<string>", line 2, in __init__
@cdeil
cdeil / pyephem_coordinate_transforms.py
Created August 1, 2012 12:31
Convenience function for common coordinate functions using pyephem
"""Coordinate transformation methods using PyEphem
http://rhodesmill.org/pyephem/
"""
import numpy as np
import ephem
def transform(in_position, in_system, out_system, observer=None):
"""Simple coordinate transforms between commonly used coordinate systems.
@cdeil
cdeil / gist:3349048
Created August 14, 2012 12:52
Sherpa 4.4.1 standalone build error on Mac OS X Lion with clang 4
christoph-deils-macbook:sherpa deil$ python setup.py build
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building library "sherpa" sources
building extension "sherpa.estmethods._est_funcs" sources
@cdeil
cdeil / gist:3359660
Created August 15, 2012 12:20
ipython test failures
ip0x0872:~ deil$ nosetests IPython
.............................S...........S.................................F........................................................................................................................................................................................................................................................................................................................................................................................................................E.....................................E.......E.....................................................................................................................................................................................S.............E......................................................S.................................................SS...S..............S............S..S.........................................................................................................................
@cdeil
cdeil / deltat.png
Created August 23, 2012 05:46
Compute and plot times scale differences
deltat.png
@cdeil
cdeil / test_file_log.txt
Created September 9, 2012 15:42
rootpy.io.tests.test_file.test_file failure
$ cd rootpy/rootpy/io/tests/
$ python test_file.py
.E
======================================================================
ERROR: __main__.test_file
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "test_file.py", line 20, in test_file