Tuesday, March 29, 2011

Why can't numpy do duplicate index assignment

AG

I want to do drizzling with numpy. It should be trivial, but it's impossible (without a for loop, afaik) instead.


In [2]: a = array([1,1,2,2])

In [3]: b = arange(5)

In [4]: b[a] += 1

In [5]: b
Out[5]: array([0, 2, 3, 3, 4])

In [6]: # but b should really be:

In [7]: b[a] += 1

In [8]: b
Out[8]: array([0, 3, 4, 3, 4])

Friday, March 18, 2011

pyspeckit: an astronomical spectroscopic toolkit

Jordan and I have been working on our python-based spectroscopic analysis tool for a while now:
pyspeckit is a pretty awesome, now functional but incomplete (and incompletely documented) tool.