dust_extinction icon indicating copy to clipboard operation
dust_extinction copied to clipboard

DOC: extinction at a single wavelength use case

Open karllark opened this issue 7 years ago • 0 comments

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.

karllark avatar Oct 11 '18 15:10 karllark