Git Product home page Git Product logo

extinction's People

Contributors

jalusk avatar kbarbary avatar kboone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

extinction's Issues

SMC extinction?

Any plans to include the SMC bar extinction curve from Gordon et al 2003? Would be super helpful for high-z work.

Accept integer wavelengths

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)

And the error:

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'

Create release for Zenodo?

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?

broadcasting in `apply`

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)

frame of reference

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!

Can't pip install

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/

Attribute ``remove`` does not exist

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)

AttributeError: module 'extinction' has no attribute 'remove'

dimensionality of input

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)

Extinction errors out on pip3 and compiled install on OSX 11.3.x Big Sur Python 3.9.4/5 (M1 mba)

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.).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.