Skip to content

Instantly share code, notes, and snippets.

View wkerzendorf's full-sized avatar

Wolfgang Kerzendorf wkerzendorf

View GitHub Profile
@wkerzendorf
wkerzendorf / pip virtualenv log
Created October 18, 2013 02:15
pip installation in an empty virtualenv
➜ virtualenvs virtualenv-2.7 --no-site-packages tardis_release
New python executable in tardis_release/bin/python
Installing setuptools............done.
Installing pip...............done.
➜ virtualenvs source tardis_release/bin/activate
(tardis_release)➜ virtualenvs cd tardis_release
bin include lib
(tardis_release)➜ ~VIRTUAL_ENV pip install astropy
Downloading/unpacking astropy
Downloading astropy-0.2.4.tar.gz (4.7MB): 4.7MB downloaded
@wkerzendorf
wkerzendorf / specwcs.py
Created March 18, 2013 23:31
Spectrum1D simple WCS
# This module provides a basic and probably temporary WCS solution until astropy has a wcs built-in
#This is all built upon @nden's work on the models class
from astropy import models
import numpy as np
class BaseSpectrum1DWCSError(Exception):
pass
class BaseSpectrum1DWCS(models.Model):
"""
@wkerzendorf
wkerzendorf / gist:2986286
Created June 25, 2012 03:19
ipython parallel recarray problem
In [1]: from IPython.parallel import Client
In [2]: rc = Client()
In [3]: myrec = random.random((10,3))
In [4]: myrec
Out[4]:
array([[ 0.83451781, 0.86186735, 0.11552798],
[ 0.4613526 , 0.01918926, 0.97660991],
@wkerzendorf
wkerzendorf / gist:1631397
Created January 18, 2012 06:12
very slow update
lines ~ 200k
levels ~ 20k
update
lines
set
level_id_upper =
(select level_id from levels
where lines.atom=levels.atom and
lines.ion=levels.ion and
SELECT
stars.name,
obs.id,
fit_gridchi_1.vcorr,
fit_gridchi_1.teff,
fit_gridchi_1.logg,
fit_gridchi_1.feh,
fit_gridchi_1.chi,
fit_minuit_1.teff,
fit_minuit_1.logg,