From 0f93422d8a8038afb8c92a3cff22af0894202be4 Mon Sep 17 00:00:00 2001 From: Benjamin Johnson Date: Tue, 5 Dec 2023 21:02:57 -0500 Subject: [PATCH] update citation info; fix line indices for AGNSpecModel to correspond to recent FSPS. --- doc/index.rst | 32 +---------------------------- doc/nebular.rst | 2 +- doc/quickstart.rst | 2 +- doc/ref.rst | 41 +++++++++++++++++++++++++++++++++++++ prospect/models/sedmodel.py | 13 +++++++----- tests/test_eline.py | 8 ++++---- 6 files changed, 56 insertions(+), 42 deletions(-) create mode 100644 doc/ref.rst diff --git a/doc/index.rst b/doc/index.rst index 1aa3ebb1..376bfbc2 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -34,6 +34,7 @@ Prospector allows you to: sfhs nebular output + ref .. toctree:: :maxdepth: 1 @@ -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 -`_. - -If you use this code, please reference `this paper `_: - -.. 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 --------- diff --git a/doc/nebular.rst b/doc/nebular.rst index cfbbfb79..0a9063cc 100644 --- a/doc/nebular.rst +++ b/doc/nebular.rst @@ -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 --------------------------- diff --git a/doc/quickstart.rst b/doc/quickstart.rst index 51f6606d..773d6b2d 100644 --- a/doc/quickstart.rst +++ b/doc/quickstart.rst @@ -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 diff --git a/doc/ref.rst b/doc/ref.rst new file mode 100644 index 00000000..07686408 --- /dev/null +++ b/doc/ref.rst @@ -0,0 +1,41 @@ + +License and Attribution +======================= + +*Copyright 2014-2023 Benjamin D. Johnson and contributors.* + +This code is available under the `MIT License +`_. + +If you use this code, please reference `this paper `_: + +.. 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 ` + + +Please also see the reference requirements for dependencies + +* `FSPS `` +* `python-fsps ` +* `dynesty ` +* `emcee ` diff --git a/prospect/models/sedmodel.py b/prospect/models/sedmodel.py index 9dc5980b..6787c2d2 100644 --- a/prospect/models/sedmodel.py +++ b/prospect/models/sedmodel.py @@ -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): diff --git a/tests/test_eline.py b/tests/test_eline.py index 78acc6b1..14d9a53c 100644 --- a/tests/test_eline.py +++ b/tests/test_eline.py @@ -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) @@ -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() @@ -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)