Skip to content

Commit

Permalink
Merge pull request #305 from bd-j/ref
Browse files Browse the repository at this point in the history
update citation info, AGNSpecModel line indices
  • Loading branch information
bd-j authored Dec 6, 2023
2 parents f46ca4e + 0f93422 commit 9526327
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 42 deletions.
32 changes: 1 addition & 31 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Prospector allows you to:
sfhs
nebular
output
ref

.. toctree::
:maxdepth: 1
Expand All @@ -55,37 +56,6 @@ Prospector allows you to:
api/plotting_api
api/utils_api

License and Attribution
------------------------------

*Copyright 2014-2022 Benjamin D. Johnson and contributors.*

This code is available under the `MIT License
<https://raw.github.com/bdj/prospector/blob/main/LICENSE>`_.

If you use this code, please reference `this paper <https://ui.adsabs.harvard.edu/abs/2021ApJS..254...22J/abstract>`_:

.. code-block:: none
@ARTICLE{2021ApJS..254...22J,
author = {{Johnson}, Benjamin D. and {Leja}, Joel and {Conroy}, Charlie and {Speagle}, Joshua S.},
title = "{Stellar Population Inference with Prospector}",
journal = {\apjs},
keywords = {Galaxy evolution, Spectral energy distribution, Astronomy data modeling, 594, 2129, 1859, Astrophysics - Astrophysics of Galaxies, Astrophysics - Instrumentation and Methods for Astrophysics},
year = 2021,
month = jun,
volume = {254},
number = {2},
eid = {22},
pages = {22},
doi = {10.3847/1538-4365/abef67},
archivePrefix = {arXiv},
eprint = {2012.01426},
primaryClass = {astro-ph.GA},
adsurl = {https://ui.adsabs.harvard.edu/abs/2021ApJS..254...22J},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
Changelog
---------

Expand Down
2 changes: 1 addition & 1 deletion doc/nebular.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ photometry). These parameters are:

In all cases the line names to use in these lists are those given in the FSPS
emission line line information table, ``$SPS_HOME/data/emlines_info.dat``, e.g.
``"Ly alpha 1216"`` for the Lyman-alpha 1216 Angstrom line.
``"Ly-alpha 1215"`` for the Lyman-alpha 1216 Angstrom line.

Nebular Parameter Templates
---------------------------
Expand Down
2 changes: 1 addition & 1 deletion doc/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Get a 'Source'
Now we need an object that will actually generate the galaxy spectrum using
stellar population synthesis. For this we will use an object that wraps FSPS
allowing access to all the parameterized SFHs. We will also just check which
spectral and isochrone librariews are being used.
spectral and isochrone libraries are being used.

.. code:: python
Expand Down
41 changes: 41 additions & 0 deletions doc/ref.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

License and Attribution
=======================

*Copyright 2014-2023 Benjamin D. Johnson and contributors.*

This code is available under the `MIT License
<https://raw.github.com/bdj/prospector/blob/main/LICENSE>`_.

If you use this code, please reference `this paper <https://ui.adsabs.harvard.edu/abs/2021ApJS..254...22J/abstract>`_:

.. code-block:: none
@ARTICLE{2021ApJS..254...22J,
author = {{Johnson}, Benjamin D. and {Leja}, Joel and {Conroy}, Charlie and {Speagle}, Joshua S.},
title = "{Stellar Population Inference with Prospector}",
journal = {\apjs},
keywords = {Galaxy evolution, Spectral energy distribution, Astronomy data modeling, 594, 2129, 1859, Astrophysics - Astrophysics of Galaxies, Astrophysics - Instrumentation and Methods for Astrophysics},
year = 2021,
month = jun,
volume = {254},
number = {2},
eid = {22},
pages = {22},
doi = {10.3847/1538-4365/abef67},
archivePrefix = {arXiv},
eprint = {2012.01426},
primaryClass = {astro-ph.GA},
adsurl = {https://ui.adsabs.harvard.edu/abs/2021ApJS..254...22J},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
and `Leja et al 2019 <https://ui.adsabs.harvard.edu/abs/2017ApJ...837..170L/abstract>`


Please also see the reference requirements for dependencies

* `FSPS <https://github.com/cconroy20/fsps#references>``
* `python-fsps <https://python-fsps.readthedocs.io/en/latest/#license>`
* `dynesty <https://dynesty.readthedocs.io/en/latest/references.html>`
* `emcee <https://emcee.readthedocs.io/en/stable/#license-attribution>`
13 changes: 8 additions & 5 deletions prospect/models/sedmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,15 +908,18 @@ def _available_parameters(self):

def init_aline_info(self):
"""AGN line spectrum. Based on data as reported in Richardson et al.
2014 (Table 3, the 'a42' dataset) and normalized to Hbeta.index=48 is Hbeta
2014 (Table 3, the 'a42' dataset) and normalized to Hbeta.
index=59 is Hbeta
"""
ainds = np.array([31, 33, 34, 35, 37, 42, 43, 44, 48,
49, 50, 52, 56, 57, 58, 60, 61, 62,
63, 64, 65, 66, 68])
ainds = np.array([38, 40, 41, 43, 45, 50, 51, 52, 59,
61, 62, 64, 68, 69, 70, 72, 73, 74,
75, 76, 77, 78, 80])
afluxes = np.array([2.96, 0.06, 0.1 , 1. , 0.2 , 0.25, 0.48, 0.13, 1.,
2.87, 8.53, 0.07, 0.02, 0.1 , 0.33, 0.09, 0.79, 2.86,
2.13, 0.03, 0.77, 0.65, 0.19])
self._aline_lum = np.zeros(128)
self._aline_lum = np.zeros(len(self.emline_info))
assert np.abs(self.emline_info["wave"][59] - 4863) < 2
self._aline_lum[ainds] = afluxes

def predict_spec(self, obs, sigma_spec=None, **extras):
Expand Down
8 changes: 4 additions & 4 deletions tests/test_eline.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ def test_eline_parsing():
model_pars.update(TemplateLibrary["nebular"])

# test ignoring a line
lya = "Ly alpha 1216"
lya = "Ly-alpha 1215"
model_pars["elines_to_ignore"] = dict(init=lya, isfree=False)
model = SpecModel(model_pars)
model.parse_elines()
assert not np.isin(lya, model.emline_info["name"][model._use_eline])
assert np.isin("H alpha 6563", model.emline_info["name"][model._use_eline])
assert np.isin("Ba-alpha 6563", model.emline_info["name"][model._use_eline])
assert np.all(model._fix_eline)
assert model._use_eline.sum() == len(model._use_eline) - 1
assert len(model._use_eline) == len(model.emline_info)
Expand All @@ -36,7 +36,7 @@ def test_eline_parsing():
assert model._fit_eline.sum() == len(model._use_eline)

# test fitting just a line or two
fit_lines = ["[OIII]5007"]
fit_lines = ["[O III] 5007"]
model_pars["elines_to_fit"] = dict(init=fit_lines)
model = SpecModel(model_pars)
model.parse_elines()
Expand Down Expand Up @@ -173,7 +173,7 @@ def test_eline_implementation():
spec, phot, mfrac = model.predict(model.theta, obs=obs, sps=sps)

# test ignoring a line
lya = "Ly alpha 1216"
lya = "Ly-alpha 1215"
model_pars["elines_to_ignore"] = dict(init=lya, isfree=False)
model = SpecModel(model_pars)
spec_nolya, phot_nolya, mfrac = model.predict(model.theta, obs=obs, sps=sps)
Expand Down

0 comments on commit 9526327

Please sign in to comment.