Name | astro-ssptools JSON |
Version |
2.0.0
JSON |
| download |
home_page | None |
Summary | Simple Stellar Population Tools |
upload_time | 2024-12-03 02:50:33 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | MIT License Copyright (c) 2018, Eduardo Balbinot Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
ssptools
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# SSPTools
[](https://github.com/pjs902/ssptools/blob/master/LICENSE)
[](https://github.com/SMU-clusters/ssptools/actions/workflows/tests.yml)
### Simple Stellar Population Tools
Provides access to the `EvolvedMF` class (and similar subclasses), which
evolves an arbitrary N-component power law initial mass function (IMF) to a
binned present-day mass function (PDMF) at any given set of ages, and computes
the numbers and masses of stars and remnants in each mass bin.
To be used for populating mass models and other such simulations based on
an IMF and various other initial population parameters.
Can optionally account for all of the evolution of stars off the main-sequence,
the loss of low-mass stars to a host tidal field, the ejection of
black holes due to both dynamical ejections and natal kicks.
### Note
This is a fork of [SSPTools](https://github.com/balbinot/ssptools) which has been updated to use an N-component
mass function, updated remnant initial-final mass relations and implements
further black hole retention calculations, among other changes.
### Quickstart
SSPTools can be installed from [PyPI](https://pypi.org/project/astro-ssptools/) using:
```
pip install astro-ssptools
```
An evolved mass function can be computed using the `EvolvedMF` class:
```python
import ssptools
m_break, a_slopes, nbins = [0.08, 0.5, 150.], [+1.3, -2.3], [5, 30]
pdmf = ssptools.EvolvedMF.from_powerlaw(m_break, a_slopes, nbins,
FeH=-1.5, tout=13000, Ndot=0, N0=1e6)
```
Alternatively, an IMF class can be instantiated and used directly:
```python
imf = ssptools.masses.PowerLawIMF(m_break, a_slopes, N0=1e6)
pdmf = ssptools.EvolvedMF(imf, nbins, FeH=-1.5, tout=[0, 1000, 13000], Ndot=0)
```
See the documentation of each class for more details on all possible parameters.
The final element of `tout` (in Myr) defines the age to which the mass function
is evolved to, where the masses and numbers of stars and remnants (together)
can then be accessed easily:
```python
pdmf.N # Total number of stars in each bin
pdmf.M # Total mass of stars in each bin
pdmf.m # Mean mass of stars in each bin
pdmf.M[pdmf.types == 'MS'] # Star bins only
pdmf.M[pdmf.types == 'BH'] # Black hole bins only
```
All other outputted times can also be seen in the underlying attributes, which
generally have shape (`len(tout)`, `sum(nbins)`). Note that these arrays will
also contain bins with basically no objects in them (i.e. N<0.1), which are not
valid and are typically filtered out in the output arrays above.
```python
pdmf.Ns[0] # Initial star bin amounts
pdmf.Ns[-1] # Final star bin amounts
pdmf.Mr # Named tuple with fields ('WD', 'NS', 'BH')
pdmf.Mr.BH[-1] # Final BH bin masses
```
```python
import matplotlib.pyplot as plt
for i in range(pdmf.nout):
mes = pdmf.massbins.turned_off_bins(pdmf.tout[i]) # mass bins at t_i
plt.step(pdmf.ms[i], pdmf.Ns[i] / (mes.upper - mes.lower),
ls='-', label=f"Stars @ t={pdmf.tout[i]} Myr")
#
mebh = pdmf.massbins.bins.BH # BH mass bins
plt.step(pdmf.mr.BH[i], pdmf.Nr.BH[i] / (mebh.upper - mebh.lower),
ls='--', c=str(0.8 * 1 - (i / pdmf.nout)),
label=f" BHs @ t={pdmf.tout[i]} Myr")
plt.ylabel(r"$\frac{\mathrm{d}N}{\mathrm{d}m}$", rotation=0)
plt.xlabel(r"$m\ [M_\odot]$")
plt.yscale('log'); plt.xscale('log')
plt.ylim(bottom=1)
plt.legend(); plt.show()
```

Raw data
{
"_id": null,
"home_page": null,
"name": "astro-ssptools",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "ssptools",
"author": null,
"author_email": "Eduardo Balbinot <eduardo.balbinot@gmail.com>, Nolan Dickson <nolan.dickson@smu.ca>, Peter Smith <smith.peter.902@gmail.com>, Mark Gieles <m.gieles@surrey.ac.uk>, Miklos Peuten <m.peuten@surrey.ac.uk>",
"download_url": "https://files.pythonhosted.org/packages/2e/82/feb3af0acecf6725edfd2ed761d5e7d075db6ed1efc6b17112c4e16cf9d3/astro_ssptools-2.0.0.tar.gz",
"platform": null,
"description": "# SSPTools\n\n[](https://github.com/pjs902/ssptools/blob/master/LICENSE)\n[](https://github.com/SMU-clusters/ssptools/actions/workflows/tests.yml)\n### Simple Stellar Population Tools\n\nProvides access to the `EvolvedMF` class (and similar subclasses), which\nevolves an arbitrary N-component power law initial mass function (IMF) to a\nbinned present-day mass function (PDMF) at any given set of ages, and computes\nthe numbers and masses of stars and remnants in each mass bin.\n\nTo be used for populating mass models and other such simulations based on\nan IMF and various other initial population parameters.\n\nCan optionally account for all of the evolution of stars off the main-sequence,\nthe loss of low-mass stars to a host tidal field, the ejection of\nblack holes due to both dynamical ejections and natal kicks.\n\n\n### Note\nThis is a fork of [SSPTools](https://github.com/balbinot/ssptools) which has been updated to use an N-component\nmass function, updated remnant initial-final mass relations and implements\nfurther black hole retention calculations, among other changes.\n\n\n### Quickstart\n\nSSPTools can be installed from [PyPI](https://pypi.org/project/astro-ssptools/) using:\n\n```\npip install astro-ssptools\n```\n\nAn evolved mass function can be computed using the `EvolvedMF` class:\n\n```python\nimport ssptools\n\nm_break, a_slopes, nbins = [0.08, 0.5, 150.], [+1.3, -2.3], [5, 30]\npdmf = ssptools.EvolvedMF.from_powerlaw(m_break, a_slopes, nbins,\n FeH=-1.5, tout=13000, Ndot=0, N0=1e6)\n```\n\nAlternatively, an IMF class can be instantiated and used directly:\n\n```python\nimf = ssptools.masses.PowerLawIMF(m_break, a_slopes, N0=1e6)\npdmf = ssptools.EvolvedMF(imf, nbins, FeH=-1.5, tout=[0, 1000, 13000], Ndot=0)\n```\n\nSee the documentation of each class for more details on all possible parameters.\n\nThe final element of `tout` (in Myr) defines the age to which the mass function\nis evolved to, where the masses and numbers of stars and remnants (together)\ncan then be accessed easily:\n\n```python\n\npdmf.N # Total number of stars in each bin\npdmf.M # Total mass of stars in each bin\npdmf.m # Mean mass of stars in each bin\n\npdmf.M[pdmf.types == 'MS'] # Star bins only\npdmf.M[pdmf.types == 'BH'] # Black hole bins only\n\n```\n\nAll other outputted times can also be seen in the underlying attributes, which\ngenerally have shape (`len(tout)`, `sum(nbins)`). Note that these arrays will\nalso contain bins with basically no objects in them (i.e. N<0.1), which are not\nvalid and are typically filtered out in the output arrays above.\n\n```python\npdmf.Ns[0] # Initial star bin amounts\npdmf.Ns[-1] # Final star bin amounts\n\npdmf.Mr # Named tuple with fields ('WD', 'NS', 'BH')\npdmf.Mr.BH[-1] # Final BH bin masses\n```\n\n```python\nimport matplotlib.pyplot as plt\n\nfor i in range(pdmf.nout):\n mes = pdmf.massbins.turned_off_bins(pdmf.tout[i]) # mass bins at t_i\n plt.step(pdmf.ms[i], pdmf.Ns[i] / (mes.upper - mes.lower),\n ls='-', label=f\"Stars @ t={pdmf.tout[i]} Myr\")\n#\n mebh = pdmf.massbins.bins.BH # BH mass bins\n plt.step(pdmf.mr.BH[i], pdmf.Nr.BH[i] / (mebh.upper - mebh.lower),\n ls='--', c=str(0.8 * 1 - (i / pdmf.nout)),\n label=f\" BHs @ t={pdmf.tout[i]} Myr\")\n\nplt.ylabel(r\"$\\frac{\\mathrm{d}N}{\\mathrm{d}m}$\", rotation=0)\nplt.xlabel(r\"$m\\ [M_\\odot]$\")\nplt.yscale('log'); plt.xscale('log')\nplt.ylim(bottom=1)\n\nplt.legend(); plt.show()\n```\n\n\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2018, Eduardo Balbinot Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Simple Stellar Population Tools",
"version": "2.0.0",
"project_urls": {
"repository": "https://github.com/SMU-clusters/ssptools.git"
},
"split_keywords": [
"ssptools"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ad3b302c5ca2d0fb322612a20e818f9275add1cbd80cc5d8491e671b4a051479",
"md5": "747bb37ffda499f6a8b07e96109065a1",
"sha256": "4219f5fd54b7444b97b92f4e5a6b248703703867413c64e6e69fc602eb0430aa"
},
"downloads": -1,
"filename": "astro_ssptools-2.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "747bb37ffda499f6a8b07e96109065a1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 17153060,
"upload_time": "2024-12-03T02:50:30",
"upload_time_iso_8601": "2024-12-03T02:50:30.019200Z",
"url": "https://files.pythonhosted.org/packages/ad/3b/302c5ca2d0fb322612a20e818f9275add1cbd80cc5d8491e671b4a051479/astro_ssptools-2.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2e82feb3af0acecf6725edfd2ed761d5e7d075db6ed1efc6b17112c4e16cf9d3",
"md5": "81ebb96f61bfdfe7bd8d7637798f2dee",
"sha256": "083c05e53aac66f52f85cde376d5097c159bfdca251dddef3dc36b820169c596"
},
"downloads": -1,
"filename": "astro_ssptools-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "81ebb96f61bfdfe7bd8d7637798f2dee",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 16404075,
"upload_time": "2024-12-03T02:50:33",
"upload_time_iso_8601": "2024-12-03T02:50:33.935025Z",
"url": "https://files.pythonhosted.org/packages/2e/82/feb3af0acecf6725edfd2ed761d5e7d075db6ed1efc6b17112c4e16cf9d3/astro_ssptools-2.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-03 02:50:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "SMU-clusters",
"github_project": "ssptools",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "astro-ssptools"
}