kbarbary / extinction Goto Github PK
View Code? Open in Web Editor NEWFast interstellar dust extinction laws in Python
License: MIT License
Fast interstellar dust extinction laws in Python
License: MIT License
error happens when
import extinction
No module named 'extinction_plot'
Hi @kbarbary,
Would it be possible to implement different units for the wavelength to calculate the extinction?
In the v0.4.6 release, all wheels build successfully except for the MacOS wheel on CPython 3.10, which failed with this error.
@kboone any ideas?
Any plans to include the SMC bar extinction curve from Gordon et al 2003? Would be super helpful for high-z work.
When I make a numpy array of integers, I get a ValueError. It would be nice to be able to use integers as wavelengths. I don't speak Cython - is this an easy thing to implement?
Here is the call:
extinction.ccm89(np.array([2000]), 1, 3.1)
ValueError Traceback (most recent call last)
in ()
----> 1 extinction.ccm89(np.array([2000]), 1, 3.1)
extinction.pyx in extinction.ccm89 (extinction.c:3133)()
ValueError: Buffer dtype mismatch, expected 'double' but got 'long'
Thanks for creating this helpful Python package, so that I don't have to go code up all those equations!! This code is very helpful in a project I am working on, and I would like to be able to cite it.
Would you consider making a release to Zenodo to get a DOI, so that it could be easily cited in a paper?
I am using this module for some features in a package/paper (https://github.com/nikhil-sarin/redback), so Is there a specific way to acknowledge this module? Is there a paper I am supposed to cite?
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)
Hello!
I have a simple doubt: Do I have to deredshift a spectra from observer frame in order to use these extinction models?
Thank you!
For whatever reason, on a clean image I cannot pip install extinction. MWE
$ docker run --rm -ti python bash
/# pip install extinction
Collecting extinction
Using cached https://files.pythonhosted.org/packages/b6/60/70dfa9d770385ae10b768be1a6511bde72060478c5b817de72333863dfc8/extinction-0.4.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-69plqivp/extinction/setup.py", line 7, in <module>
import numpy
ModuleNotFoundError: No module named 'numpy'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-69plqivp/extinction/
I had opened #14 because I thought pyproject.toml
was simply missing the build-backend
key, but I've realized that any local install of the package will work. I tried the following all with success
$ pip install git+https://github.com/kbarbary/extinction#egg=extinction
$ git clone https://github.com/kbarbary/extinction && pip install extinction/
$ echo 'build-backend = "setuptools.build_meta"\n' >> extinction/pyproject.toml && pip install extinction/
I followed the guide on the documentation, but an error occurred.
AttributeError Traceback (most recent call last)
in ()
1 flux = np.ones(3)
2 wave = np.array([5., 2.5, 1.25])
----> 3 extinction.remove(extinction.ccm89(wave, 1.0, 3.1), flux)
It appears that extinction
only works with 1-d wavelength inputs.
Example:
import extinction
import numpy as np
a = extinction.fitzpatrick99(
wave=np.random.uniform(3800., 10000., (1000, 10, 10)), r_v=3.1, a_v=1.)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-12-d87da702ce4d> in <module>
----> 1 extinction.fitzpatrick99(wave=np.random.uniform(3800., 10000., (1000, 10, 10)), r_v=3.1, a_v=1.)
extinction.pyx in extinction.fitzpatrick99()
extinction.pyx in extinction.Fitzpatrick99.__call__()
ValueError: Buffer has wrong number of dimensions (expected 1, got 3)
Hey there,
I am trying to install extinction in order to use MOSFIT for some SNe LC work.
Via pip3 install
for 0.45 install dies on OSX 11.3.0 and 11.3.1 after attempting several deprecated versions of extinction under Python 3.9.5. (via homebrew) This is even with the clang compiler set to x86_64 target and homebrew working in x86_64 mode
Am happy to help you guys diagnose this and even try to help solve it if I can (and hey, I need it =p ), so lemme know what additional information I might provide to help run this down and solve it.
I've attached logs to the message in case that helps to figure out the problem.
thanks!
Daryl.
extinction_went_extinct_osx.txt
(note: it installs on POP OS 21.04 pre-release fine under Python 3.9.4 so imagine this is an OSX only thing - though I did have to wrestle mpi4py on 21.04 to also be installed.).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.