astrofrog / astrofrog/sedfitter
Extinction is not self-consistent internally
- Dominant language
- Python
- Stars
- 21
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Description
The Extinction module wants `chi` defined in cm^2/g:
https://github.com/astrofrog/sedfitter/blob/master/sedfitter/extinction/extinction.py#L41-L43
but the function `get_av` treats `chi` as if it is a pure opacity:
https://github.com/astrofrog/sedfitter/blob/master/sedfitter/extinction/extinction.py#L86-L87
I guess the idea is that `chi` is "tau per (cm^2 / g)", so just multiplying by -0.4 turns it to a magnitude?
In any case, I suggest the following approach for generating extinction objects, based on Karl Gordon's dust extinction:
```python
from dust_extinction.parameter_averages import F19
# a_v to N(H) from https://arxiv.org/pdf/0903.2057.pdf
# m(particle) ~ 1.34 m(H) from memory...
guyver2009_avtocol = (2.21e21 * u.cm**-2 * (1.34*u.Da)).to(u.g/u.cm**2)
ext_wav = np.sort((np.geomspace(0.301, 8.699, 1000)/u.um).to(u.um, u.spectral()))
ext_vals = ext.evaluate(ext_wav, Rv=3.1)
extinction = Extinction()
extinction.wav = ext_wav
extinction.chi = ext_vals / guyver2009_avtocol
```
but I'd like to know if this looks halfway reasonable?
Contributor guide
No contributing guide indexed for this repository
Research direction
Read sedfitter/extinction/extinction.py at lines 41-43 and 86-87, then trace how Extinction.chi is consumed by get_av. Compare the documented units with the proposed dust_extinction and Astropy-unit calculation. Done means the intended chi units and conversion to magnitudes are agreed, implemented consistently, and covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100