kbarbary / extinction

Fast interstellar dust extinction laws in Python
MIT License
43 stars 8 forks source link

broadcasting in `apply` #2

Closed dannygoldstein closed 8 years ago

dannygoldstein commented 8 years ago
In [1]: import sncosmo
In [2]: ebv = 0.1
In [3]: r_v = 3.1
In [4]: hsiao = sncosmo.get_source('hsiao')
In [5]: wave = hsiao._wave
In [6]: flux = hsiao.flux(hsiao._phase, wave)
In [7]: extinction.apply(extinction.odonnell94(wave, ebv*r_v, r_v), flux)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-9-339ad1033c9c> in <module>()
----> 1 extinction.apply(extinction.odonnell94(wave, ebv*r_v, r_v), flux)
extinction.pyx in extinction.apply (extinction.c:6377)()
ValueError: Buffer has wrong number of dimensions (expected 1, got 2)
kbarbary commented 8 years ago

This is in apply, not odonnell94. apply only takes 1-d arrays (it doesn't do broadcasting).

kbarbary commented 8 years ago

Closed by #3