Git Product home page Git Product logo

dust_extinction's People

Contributors

aidantmcb avatar bsipocz avatar karllark avatar krislars avatar pllim avatar sohamvg 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dust_extinction's Issues

Code to replicate IDL ccm_unred

Would be good to have such code to replicate the functionality of ccm_unred (and fm_unred) as some general users are likely familiar with this way of using dust extinction curve.

Likely would be good to have it a bit more general where the extinction model could be picked as part of the call. Otherwise, would need one such convenience function for each extinction model. But maybe this would be good (as well as the general unred function).

New release (v0.7)?

New models and new docs. Time for a new release?
Remember to update CHANGES.rst.

DOC: Add "Quick Start" in index.rst

A "Quick Start" section in index.rst (main page) would be nice for someone who just discovered this package and would like to know its usage at a glance.

Conversion model to provide extinguish for composite models

If simultaneously fitting the stellar and extinction, it would be good to do this with a composite model.
For example, assume a blackbody for the stellar and one of the dust_extinction models. Need a way to have the extinguishing factors as a model so then the model to fit is just, for example (BlackBody1D | ExtFactor | CCM89).

Logo for package/docs

Would be cool to have a logo.
Astropy and other logos often have a snake (python) in them.
One idea: a snake in the rough outline of the MW NIR/optical/UV extinction curve.
Other ideas?

DOC: Extinction vs Attenuation

This package provides extinction curves. Extinction curves describe the effects of dust for the specific geometry of a single star behind a screen of dust. Extinction is due to dust absorption and scattering out of the line-of-sight.

All other geometries require attenuation curves that include radiative transfer effects. Radiative transfer effects include having significant dust scattered light in the measurement and mixing stars and dust together. Examples are galaxies or regions of galaxies and circumstellar dust.

Formally:
All extinction curves are attenuation curves, but not all attenuation curves are extinction curves.

A separate package (dust_attenuation?) could/should be created to provide attenuation curves. E.g., averages (e.g., Calzetti starburst law), results of dust radiative transfer models (e.g. DirtyGrid), and various literature proposed shape models (e.g., Fall & Charlot).

DOC: extinction at a single wavelength use case

Got an email about this use case. Email below and my response. Need to add docs for this use case. (Note name of user removed on purpose as I have not asked if they are ok having it in public).


Hi Karl,

I recently installed your dust_extinction package (thanks for coding this by the way!), but I think I am misunderstanding how to use it. I simply want to get the extinction in magnitudes of a given wavelength. I was using Fitzpatrick '99 and could not get the program to reproduce the A(lambda) "anchor points" published.

For example when I run the following code:

ext = F99(Rv=3.1)
ext(0.377)

I get the value of 0.08537820792950197. The Fitzpatrick paper says I should get 0.265.

I think that your code returns values in A(lambda)/A(V) and Fitzpatrick uses A(lambda)/E(B-V). Is there a built in switch I could use to get the published version instead of A(lambda)/A(V)?

Thank you so much for your time,
XXXXXX


Hi XXXX,
Glad you found and (may) use the dust_extinction package. The issue is that if you do not have units on the input x values, you need to input x as inverse microns. So, it should work if you use

ext(1.0/0.377)

if you would like the extinction at 0.377 microns. Alternatively, you can do

import astropy.units as u
ext(0.377*u.micron)

and that should work as well.

You will get the result in A(lambda)/A(V), so will need to multiply by the A(V) desired. Of course, if you have E(B-V) instead of A(V), then just multiply by R(V)*E(B-V).

Your question is a good one and I have opened an issue to add documentation for this use case.

Thanks,
Karl.

Add S07 class

Adding S07 extinction curve from PAHFIT (Smith et al. 2007)

extinction through filter

It would be nice to have the built-in functionality to feed in a filter bandpass (wavelength & transmission) and either A_V or E(B-V) to get the total extinction for a given extinction law.

The situation that made me think of this: going from E(B-V) of galactic foreground to the extinction in each of my filters.

No module named 'dust_extinction.averages'

Hi,
I installed the package in a conda environment by first active that environment and then
"pip install dust_extinction", the output of install process are print as follow:

(sci) ➜ ~ pip install dust_extinction
Collecting dust_extinction
Downloading https://files.pythonhosted.org/packages/43/99/709405d47967296abd6b7f477231d533c85d516363825a9f06463fb4ffc8/dust_extinction-0.6.tar.gz (164kB)
100% |████████████████████████████████| 174kB 76kB/s
Requirement already satisfied: astropy in /anaconda3/envs/sci/lib/python3.6/site-packages (from dust_extinction) (3.0.5)
Requirement already satisfied: scipy in /anaconda3/envs/sci/lib/python3.6/site-packages (from dust_extinction) (1.1.0)
Requirement already satisfied: numpy>=1.10.0 in /anaconda3/envs/sci/lib/python3.6/site-packages (from astropy->dust_extinction) (1.15.3)
Building wheels for collected packages: dust-extinction
Running setup.py bdist_wheel for dust-extinction ... done
Stored in directory: /Users/kyika/Library/Caches/pip/wheels/73/44/f7/b7629459b119cee574a89b01c1712bb7ef56bb77c1cd31687a
Successfully built dust-extinction
Installing collected packages: dust-extinction
Successfully installed dust-extinction-0.6
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

I think that it is successuful. However, when I using ipython or jupyter-notebook to import this package by:
from dust_extinction.averages import G03_SMCBar
I get an error:

ModuleNotFoundError Traceback (most recent call last)
in
----> 1 from dust_extinction.averages import G03_SMCBar

ModuleNotFoundError: No module named 'dust_extinction.averages'

What had happened here? Didn't I install a full-version of dust-extinction?

Any help and suggestion is grateful.

Code to forward/reverse model extinction

Need to provide a model that takes as input one of the dust_extinction model and parameters and outputs the values needed to extinguish(redden) or unextinguish(deredden) a spectrum.

Add R(V) calc function to G16

G16 model has R(V)_A and f_A as inputs. From these, the R(V) of the G16 mixture model can be calculated.

Maybe also add in the inverse with a way to designated when a value of R(V) is not allowed. This happens for f_A < 1 as R(V)_B is fixed (f_A = 0 model).

"high-level" function for extinguishing spectra?

If I look at http://dust-extinction.readthedocs.io/en/latest/dust_extinction/extinguish.html it is extremely useful for understanding how to use the various models (and hence should not be removed even if the "high-level" functions are added)... But it also seems like it has a certain amount of repetitive work required to handle wavelengths.

So what I would like to see is the following:

import specutils
import dust_extinction

spec = specutils.Spectrum1D.read(...wherever my spectrum file is...)
ext = CCM89(Rv=3.1)

extspec = ext.extinguish(spec, EBmV=0.5)

and have extspec be a Spectrum1D. It's debatable whether this should be the actual extinguish method - maybe an extinguish_spectrum would make more sense... but I think it's one of the most straightforward use cases I can see with real data.

Caveat: the specutils APE was just merged last month. I believe Spectrum1D is compatible enough already that you could do this now, but it might be one more specutils release is required before it's worth putting in the effort to make this method.

It may be there are some other areas where this sort of "high-level" function/method might be useful, too (particularly given the package-scope discussion f #47), but this is the immediately obvious case that I saw.

Publish paper on package -> citations

Just listened to Arfon Smith's talk at Python in Astronomy 2018 on getting credit for software in astronomy. Publishing a citable paper is one way. The Journal of Open Source Software (JOSS; https://joss.theoj.org/) looks like a good fit for this package. And not too much work. :-)

Astropy Affiliated Package Review

This package has been reviewed by the Astropy coordination committee for inclusion in the Astropy affiliated package ecosystem.

We have adopted a review process for affiliated package that includes assigning quantitative ‘scores’ (red/orange/green) for different categories of review. You can read up more about this process here. (This document, currently in Google Docs, will be moved to the documentation in the near future.) For each of the categories below we have listed the score and have included some comments when the score is not green.

Functionality/ScopeSpecialized%20package
Strictly speaking this is generalized functionality because of course dust extinction is critical for pretty much all extragalactic astronomy. But this particular *package* is primarily for the "expert" - even though some of its functionality is general I think it's best thought of as having a spcialist "target audience"?
Integration with Astropy ecosystemGood
No further comments
DocumentationPartial
Sort of borderline between orange and green. The examples/API are excellent, but the thing that is missing is a clear motivation/science background. Obviously it's out-of-scope to write a ton on this, but because of the complexity of the topic, a bit more motivation of the *bounds* of this package and the intended user audience for various pieces might be helpful.
TestingGood
No further comments
Development statusGood
No further comments
Python 3 compatibilityGood
No further comments

Other comments

A great example of use of the package-template to speed development of a fundamentally science-based code.

Summary/Decision: Things are looking good! There are a few areas where things could be improved as described above. However, these aren't critical and this package still meets the criteria to be an affiliated package. Keep up the good work!

If you agree with the above review, please feel free to close this issue. If you have any follow-up questions or disagree with any of the comments above, leave a comment and we can discuss it here. At any point in future you can request a re-review of the package if you believe any of the scores should be updated - contact the coordination committee, and we’ll do a new review. Note that we are in the process of redesigning the http://affiliated.astropy.org page to show these scores (but not the comments). Finally, please keep the title of this issue as-is (“Astropy Affiliated Package Review”) to make it easy to search for affiliated package reviews in future.

Documentation on how to use

Need to create documentation with examples.
How to extinguish a data/model. Unextinguish data/model.
How to fit extinction curves.

CCM89 with variable bump strength

There's a nice generalization of CCM89 in the Appendix of Conroy+10 that varies the bump strength. Is adding that (either as its own function or within CCM89) within the scope of this package?

DOC: Add in naming convention

How to name models:
1-3 authors, initials of last names (e.g., CCM89, FM90)
3+ authors, initials of 1st author last name (e.g., G03)

No module named 'dust_extinction.averages'

Hi,
I installed the package in a conda environment by first active that environment and then
"pip install dust_extinction", the output of install process are print as follow:

(sci) ➜ ~ pip install dust_extinction
Collecting dust_extinction
Downloading https://files.pythonhosted.org/packages/43/99/709405d47967296abd6b7f477231d533c85d516363825a9f06463fb4ffc8/dust_extinction-0.6.tar.gz (164kB)
100% |████████████████████████████████| 174kB 76kB/s
Requirement already satisfied: astropy in /anaconda3/envs/sci/lib/python3.6/site-packages (from dust_extinction) (3.0.5)
Requirement already satisfied: scipy in /anaconda3/envs/sci/lib/python3.6/site-packages (from dust_extinction) (1.1.0)
Requirement already satisfied: numpy>=1.10.0 in /anaconda3/envs/sci/lib/python3.6/site-packages (from astropy->dust_extinction) (1.15.3)
Building wheels for collected packages: dust-extinction
Running setup.py bdist_wheel for dust-extinction ... done
Stored in directory: /Users/kyika/Library/Caches/pip/wheels/73/44/f7/b7629459b119cee574a89b01c1712bb7ef56bb77c1cd31687a
Successfully built dust-extinction
Installing collected packages: dust-extinction
Successfully installed dust-extinction-0.6
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

I think that it is successuful. However, when I using ipython or jupyter-notebook to import this package by:
from dust_extinction.averages import G03_SMCBar
I get an error:

ModuleNotFoundError Traceback (most recent call last)
in
----> 1 from dust_extinction.averages import G03_SMCBar

ModuleNotFoundError: No module named 'dust_extinction.averages'

What had happened here? Didn't I install a full-version of dust-extinction?

Any help and suggestion is grateful.

Add F99+FM07 model

FM07 models includes a 7th parameter for the star of the far-UV curvature term.
Might also consider the option to tie c1 and c2 as these are completely correlated by all measures.

Remove analytic derivative from AxAvToExv

If AxAvToExv only used in a compound model with other models, the analytic derivative code will never be used. Probably better to remove it as it is not tested nor used.

astropy lts with python 2.7 failing tests

Tests are failing with the astropy lts version with python 2.7.
The issue is the use of the 'validator' option for checking the input Rv values. The 'validator' is not present for the lts python 2.7 version.

Split dust_extinction.py into smaller files

All the module code is currently contained in the single dust_extinction.py file. This makes for a fairly large file. It would be more readable to have smaller, potentially one for each models. The idea for a single file was that if it was ever incorporated into the astropy core, a single file would be what is needed. Given the growth of this package, it does not seem likely that a move to astropy core will ever happen. Hence, I am proposing that we split the large file into one per model and one with the classes that each model inherits.
Comments welcome!

Add analytic derivative function for P92

Should increase the speed and accuracy.

Also may fix the decrease in coverage when the AxAvtoElv function was added. Used in conjunction with P92 to solve simultaneously for A(V). Test coverage not hitting the analytic derivative of AxAvtoElv when used with P92. Maybe due to P92 not have analytic derivatives?

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.